001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.taglib.util.IncludeTag;
019
020 import javax.servlet.http.HttpServletRequest;
021
022
026 public class WriteTag extends IncludeTag {
027
028 public void setBean(Object bean) {
029 _bean = bean;
030 }
031
032 public void setProperty(String property) {
033 _property = property;
034 }
035
036 @Override
037 protected void cleanUp() {
038 _bean = null;
039 _property = null;
040 }
041
042 @Override
043 protected String getPage() {
044 if ((_bean == null) || Validator.isNull(_property)) {
045 return null;
046 }
047 else {
048 return _PAGE;
049 }
050 }
051
052 @Override
053 protected void setAttributes(HttpServletRequest request) {
054 request.setAttribute("liferay-ui:write:bean", _bean);
055 request.setAttribute("liferay-ui:write:property", _property);
056 }
057
058 private static final String _PAGE = "/html/taglib/ui/write/page.jsp";
059
060 private Object _bean;
061 private String _property;
062
063 }