wood burning stoves*
The moose likes Struts and the fly likes Combo-box not displaying in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Combo-box not displaying in JSP" Watch "Combo-box not displaying in JSP" New topic
Author

Combo-box not displaying in JSP

Sachin Negi
Greenhorn

Joined: Feb 02, 2012
Posts: 23
Hello to all the ranchers n greenhorns like me.. i am making a form in Struts2 that takes values from database..and i am having problem in combo-box..
here's the content of mu project that is related to the current problem ...

stuts.xml :





MaritalStatusList.java




PersonalDetailsAction.java:




DAOPersonalDetails.java:




registration.jsp





now the problem is that when its nor displaying the combobox..but when i am using the config-browser to see the action..the whole page is displayed correctly with combobox having list containing "name" from the MaritalStatusList class with values from the database!!!

i am getting the following errors on log:

Feb 16, 2012 8:10:14 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/registration.jsp' in namespace: ''. Form action defaulting to 'action' attribute's literal value.


Here i am getting all the statements of System.out.println();

Feb 16, 2012 8:10:14 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Caught an exception while evaluating expression 'maritalstatuslistlist.{name}' against value stack
java.lang.NullPointerException

Feb 16, 2012 8:10:14 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: NOTE: Previous warning message was issued due to devMode set to true.
Feb 16, 2012 8:10:14 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
tag 'combobox', field 'list', name 'maritalstatuslistlist': You must specify a collection/array/map/enumeration/iterator. Example: people or people.{name} - [unknown location]



i think there is a problem with my jsp...please help me figure it out..

Thanks in advance n Cheerzz!!!
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 384

Hi there,

I think you need to specify 'action' attribute in your <s:form> inside registration.jsp

and also ... try these changes inside the <s:combobox>



Hope this works for you ...


http://plainoldjavaobject.blogspot.in
Sachin Negi
Greenhorn

Joined: Feb 02, 2012
Posts: 23
Thanks for your help..i have changed this a little bit and have called the action from the the jsp in which i had made the menu aND ITS WORKING FINE FOR ME AND i have used the format like you have told me and its working...
Thanks for your help..
 
Don't get me started about those stupid light bulbs.
 
subject: Combo-box not displaying in JSP
 
Similar Threads
problem in struts validation
Struts2 Interceptor Error in struts.xml file
Model object is not populated directly in struts2
Struts2 tiles ActionClass not detected
Pass bean from one action to another in strust2