Hi,
I'm trying to use the struts html:options tag an am getting this error:
javax.servlet.jsp.JspException: Cannot find bean under name
org.apache.struts.taglib.html.BEAN at
org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:283) at
jsp_servlet._viewbudgets._jspService(_viewbudgets.java:292) at
weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:213) at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:157) at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1727) at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:213) at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1265)        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1622) at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

This is the portion of the JSP file where it is happening:
  <html:select property="showby" >
    <html:options collection="optionList" labelProperty="display"
property="value" />
  </html:select>

The optionList is initialized with this code:

    OptionList optionList = new OptionList();
    pageContext.setAttribute("optionList", optionList,
PageContext.REQUEST_SCOPE);
    optionList.initFromProperty("SHOW_BUDGET_OPTIONS");


The source for OptionList.java is
public class OptionList extends org.apache.struts.util.FastArrayList
{
    public void addOption(String option)
    {
        add(new OptionElement(option,option));
    }
    public void addOption(String name, String value)
    {
        add(new OptionElement(name,value));
    }
    public void initFromProperty(String propertyName)
    {
        ResourceBundle b = ResourceBundle.getBundle("bundle");
        String select = "";

        if (b != null)
            select = b.getString(propertyName);
        StringTokenizer tokenizer = new StringTokenizer(select,",|",false);
        while (tokenizer.hasMoreTokens())
        {
            String token = tokenizer.nextToken();
            addOption(token);
        }
    }
}

The source for OptionElement is:

public class OptionElement
{
    String display = "";
    String value = "";

    OptionElement(String display)
    {
        this.display = display;
        this.value = display;
    }

    OptionElement(String display, String value)
    {
        this.display = display;
        this.value = value;
    }

    public String getDisplay()
    {
        return this.display;
    }

    public String getValue()
    {
        return this.value;
    }
    public String toString()
    {
        return (display + "|" + value);
    }
}


Does anyone have any idea on what is causing the exception and how to fix
it?

Thanks,

Richard Yee


Zoho (Z)*
*The Premier Online Hospitality Marketplace

============================================================================
Richard Yee
Zoho Corporation
470 Potrero Ave.
Sunnyvale, CA. 94086
408-469-4216
[EMAIL PROTECTED]
============================================================================

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to