struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Caroline Jen <jiapei_...@yahoo.com>
Subject Re: AW: Error Using select tag To Create Drop-Down Menu
Date Mon, 21 Jul 2003 23:19:46 GMT
Hi, Dirk:  Thanks for your help.  My code works now. 
I am able to see the drop-down menu in the browser.

--- Dirk Behrendt <schnoerk@web.de> wrote:
> Hello!
>  
> I had the same problem...
>  
> You have to include the <html:select> tag into
> <html:form> tags.  Look:
>  
>  
> <html:form action="/language" method = "GET" >
>  
> <html:select property="language"
> onchange="javascript: submit ()">
> <html:option value="Deutsch"/> <html:option
> value="Englisch"/>
> </html:select>
>  
> </html:form>  
>  
> I have an ActionBean and a FormBean for the action
> "/language".
>  
> Without that you will get the exception 
> "Cannot find bean under name
> org.apache.struts.taglib.html.BEAN" 
>  
> Hope, that will help!
>  
> Dirk
>  
>  
> -----Ursprüngliche Nachricht-----
> Von: Caroline Jen [mailto:jiapei_jen@yahoo.com] 
> Gesendet: Montag, 21. Juli 2003 21:18
> An: struts-user@jakarta.apache.org
> Betreff: Error Using select tag To Create Drop-Down
> Menu
>  
> I am doing testings step by step. I simply want to
> add
> a drop-down menu feature to something that works
> OKay.
> I am a newbie to struts. I do not know where to look
> for my mistakes when I encounter problems. 
> Something is wrong in my .jsp page. This .jsp page
> had
> worked fine before <html:select>...</html:select>
> tags were added. The error message is:
>  
>  
> code:
>
------------------------------------------------------
>  
> 2003-07-21 01:24:51
> StandardWrapperValve[action]:Servlet.service() for
> servlet action threw
> exceptionorg.apache.jasper.JasperException: Cannot
> find bean under name
> org.apache.struts.taglib.html.BEAN
>  
>
-------------------------------------------------------
>  
> Here is the source code of my MainMenu.jsp:
>  
>  
> code:
>
-------------------------------------------------------
>  
> <%@ taglib uri="/WEB-INF/struts-html.tld"
> prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld"
> prefix="bean" %>
> <jsp:useBean id="LogonBean" scope="request"
> class="resources.version1.LogonBean" /> <HTML>
> <HEAD>
> <TITLE><bean:message key="title.mainmenu" />
> </TITLE> </HEAD> <BODY>
>       <bean:message key="heading.mainmenu" />  <p>
> <bean:message key="label.userType" />:
> <b><jsp:getProperty name="LogonBean"
> property="userType" /></b>
> <br>
>         <B>State: </B>
>         <html:select property="state">              
>  
>         <html:options collection="STATES"        
>                        property="value"   
>                        labelProperty="label" />     
>  
>       
>         </html:select>
> </BODY>
> </HTML>
>  
>
-------------------------------------------------------
>  
>  
> In the LogonBean.java, I inserted in the
> setParameters(....) method the following code:
>  
>  
> code:
>
-------------------------------------------------------
>  
> public void setParameters( HttpServletRequest
> request
> ){   userID = request.getParameter("userID");  
> password = request.getParameter("password");  
> ArrayList states = new ArrayList();   states.add(new
> LabelValueBean("Virginia", "VA"));   states.add(new
> LabelValueBean("Maryland", "MD"));   states.add(new
> LabelValueBean("Ohio", "OH"));   states.add(new
> LabelValueBean("Rode Island", "RI"));  
> states.add(new
> LabelValueBean("New York", "NY"));  
> request.setAttribute("STATES", states);}
>  
>
------------------------------------------------------
>  
> I would appreciate if anybody could point out my
> mistakes.
>  
>  
>  
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> <http://sbc.yahoo.com/> 
>  
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message