Hello... I have 2 pages, main.jsp and add.jsp, when a button from the main.jsp is clicked, it will add.jsp and should populate a select box in this page. I'm encountering this error when trying to populate the select box with data coming from the database: javax.servlet.jsp.JspException: No getter method available for property strTemplateDesc for bean under name matrixList org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:210)
Please help, i've just started experimenting with struts. Appreciate it!
Below is my source code:
---JSP (add.jsp) ---FORM BEAN (form bean of main.jsp)
---ACTION CLASS (action class of main.jsp) ---DAO
[BSouther: Added UBB CODE tags] [ September 05, 2007: Message edited by: Ben Souther ]
Hi Merrill, Thanks for the reply, i did what you've suggested and i encountered this error: javax.servlet.ServletException: Failed to obtain specified collection. Is there anything lacking in my bean? i already placed a getter/setter for the select tag property but that didnt solve it. i checked the result from the dao and it was successfully retrieved. Really appreciate your help! Thanks!
Joined: Feb 15, 2005
One problem I see is that in your Action class, you create an instance of StripAddForm and set its properties, but you don't put this instance into any scope. You must place this instance into the scope specified by the action mapping (either request or session) and use the same name used by the action mapping's name attribute. So, if the scope is request, and the name is stripAddForm, you must add the following statement to your Action class:
[ September 06, 2007: Message edited by: Merrill Higginson ]
Joined: Aug 20, 2007
Thanks Merill!! Got it to work now! I've placed it in session scope though. Really appreciate it.