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:[EMAIL PROTECTED] 
Gesendet: Montag, 21. Juli 2003 21:18
An: [EMAIL PROTECTED]
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/> 
 

Reply via email to