You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/07/21 21:17:32 UTC
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
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org