01: /*
02: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
03: * @author <a href="mailto:oliver.wehrens@aei.mpg.de">Oliver Wehrens</a>
04: * @version $Id: ListTag.java 6385 2007-10-25 14:02:26Z wehrens $
05: */
06: package org.gridsphere.provider.portletui.tags;
07:
08: import org.gridsphere.provider.portletui.beans.ListBean;
09:
10: import javax.servlet.jsp.JspException;
11: import javax.servlet.jsp.JspWriter;
12:
13: /**
14: * A <code>ListBoxTag</code> represents a list box element
15: */
16: public class ListTag extends BaseComponentTag {
17:
18: protected ListBean listBean = null;
19:
20: public void setListBean(ListBean listBean) {
21: this .listBean = listBean;
22: }
23:
24: public ListBean getListBean() {
25: return listBean;
26: }
27:
28: public int doStartTag() throws JspException {
29: if (!beanId.equals("")) {
30: listBean = (ListBean) getTagBean();
31: }
32: return SKIP_BODY;
33: }
34:
35: public int doEndTag() throws JspException {
36: if (listBean != null) {
37: try {
38: JspWriter out = pageContext.getOut();
39: out.print(listBean.toEndString());
40: } catch (Exception e) {
41: throw new JspException(e.getMessage());
42: }
43: }
44: return EVAL_PAGE;
45: }
46:
47: }
|