This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:options collection tag help URGENT

 
parthasarathy madhira
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to populate a <html:select> box with values from database,
and the code for that is as follows:
<html:select name="InboxForm" property="userWorkGroup">
<html ptions collection="userWorkGroup" scope="request" property="id" labelProperty="description"/>
</html:select>
and i defined a java.util.Collection variable in the ActionForm with the name userWorkGroup and my config file looks as :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- ========== Form Bean Definitions =================================== -->
<form-beans>
<form-bean name="LoginForm" type="com.lmig.cmit.indep2.login.LoginForm"/>
<form-bean name="InboxForm" type="com.lmig.cmit.indep2.inbox.InboxForm"/>
</form-beans>

<!-- ========== Global Forward Definitions ========= -->
<global-forwards>
<forward name="home" path="/main.jsp?displayJSP=home" />
</global-forwards>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<action
path="/login"
type="com.lmig.cmit.indep2.login.LoginAction"
name="LoginForm"
input="/login.jsp"
validate="true">
<forward name="valid" path="/main.jsp?displayJSP=inbox"/>
</action>
<action
path="/setUpInboxForm"
type="com.lmig.cmit.indep2.inbox.SetUpInboxAction"
name="InboxForm"
scope="session"
validate="true">
<forward name="continue" path="/main.jsp?displayJSP=inbox" />
</action>
<action
path="/inboxAction"
type="com.lmig.cmit.indep2.inbox.InboxAction"
name="InboxForm"
scope="session"
validate="true"
input="/main.jsp?displayJSP=inbox">
<forward name="valid" path="/main.jsp?displayJSP=home" />
</action>
</action-mappings>
<!-- ========== Associated Request Processor settings =================== -->
<!-- Here we specify the tiles processor -->
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />
<!-- ========== Message Resources Definitions =========================== -->
<message-resources parameter="ApplicationResources" />
</struts-config>
But when i try to run the application i always get the error :
----- Root Cause -----
javax.servlet.jsp.JspException: Cannot find bean userWorkGroup in scope request
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:692)
at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:227)
at org.apache.jsp.inbox$jsp._jspService(inbox$jsp.java:136)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
Anyone who were hit this error earlier may please help me..
It is urgent.
Thanks in adv.
Partha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic