1
14
15 package com.liferay.taglib.aui;
16
17 import com.liferay.taglib.util.IncludeTag;
18
19 import javax.servlet.http.HttpServletRequest;
20
21
27 public class ModelContextTag extends IncludeTag {
28
29 public void setBean(Object bean) {
30 _bean = bean;
31 }
32
33 public void setModel(Class<?> model) {
34 _model = model;
35 }
36
37 protected void cleanUp() {
38 _bean = null;
39 _model = null;
40 }
41
42 protected void setAttributes(HttpServletRequest request) {
43 if (_model != null) {
44 pageContext.setAttribute("aui:model-context:bean", _bean);
45 pageContext.setAttribute("aui:model-context:model", _model);
46 }
47 else {
48 pageContext.removeAttribute("aui:model-context:bean");
49 pageContext.removeAttribute("aui:model-context::model");
50 }
51 }
52
53 private Object _bean;
54 private Class<?> _model;
55
56 }