Struts-el strange behav.
hello, I'm having the following problem (Furtunately I've found the solution). if i use html-el:hidden property='selectedCode'/ The container reply with an error WARNING: Exception for /webappointments/secure/specialitylistview.jsp javax.servlet.jsp.JspException: No getter method for property selectedCode of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:161) at precompiled.secure.specialitylistview._jspService(specialitylistview.java:164) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366) If I use this form html-el:hidden property='selectedCode' value=''/ No error is shown and I can access the page. Do you have any comment? What's that? === Here it is a pice of my ActionForm (nothing special) public class ListedSpecialityViewForm extends ActionForm { private String specialitiesChecked[]; private Collection specialitiesFound; private String selectedCode; private String selectedDescription; /** Creates a new instance of ListedSpecialitiesForm */ public ListedSpecialityViewForm() { super(); specialitiesFound = new Vector(); resetFields(); } /** * Restets all fields */ public void resetFields () { selectedCode = ; selectedDescription = ; specialitiesChecked = new String[0]; specialitiesFound.clear(); } //Getters public String getSelectedCode() { return this.selectedCode; } public String getSelectedDescription() { return this.selectedDescription; } . -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts-el strange behav.
if i use html-el:hidden property='selectedCode'/ The container reply with an error If I use this form html-el:hidden property='selectedCode' value=''/ No error is shown and I can access the page. I *think* that if you provide the value then the getter method is not called. So I don't think you've solved your problem, just masked it. I assume there's JavaScript somewhere that's going to set a value for that field before the form is submitted. What does the 'set' method for selectedCode look like? I've seen strange issues crop up when the get/set methods do not match exactly (different data type, for example.) I haven't seen it in an official document, but someone here (Craig??) said that your Forms must conform to the Bean spec. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management
RE: Struts-el strange behav.
You need to provide the name of your form bean in the name attribute. -Original Message- From: kiuma [mailto:[EMAIL PROTECTED]] hello, I'm having the following problem (Furtunately I've found the solution). if i use html-el:hidden property='selectedCode'/ The container reply with an error WARNING: Exception for /webappointments/secure/specialitylistview.jsp javax.servlet.jsp.JspException: No getter method for property selectedCode of bean org.apache.struts.taglib.html.BEAN -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts-el strange behav.
No you don't because they are form elements then the form to which they are associated is inferred by the action path. An element will attempt to populate itself with the get method of the form. Make sure that you either declare the variable and give it a starting value (even if it just blank - anything but null) or have your getter return a non-null default value if the variable is currently null. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Sent: 26 November 2002 16:52 To: Struts Users Mailing List Subject: RE: Struts-el strange behav. You need to provide the name of your form bean in the name attribute. -Original Message- From: kiuma [mailto:[EMAIL PROTECTED]] hello, I'm having the following problem (Furtunately I've found the solution). if i use html-el:hidden property='selectedCode'/ The container reply with an error WARNING: Exception for /webappointments/secure/specialitylistview.jsp javax.servlet.jsp.JspException: No getter method for property selectedCode of bean org.apache.struts.taglib.html.BEAN -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts-el strange behav.
Thank you guys, As usual we problems are so strange, one has to see in the xml file. Now I think xml is a very good innovation, but sometimes it is the hell ;-P thx, kiuma Beeson, Ashley wrote: No you don't because they are form elements then the form to which they are associated is inferred by the action path. An element will attempt to populate itself with the get method of the form. Make sure that you either declare the variable and give it a starting value (even if it just blank - anything but null) or have your getter return a non-null default value if the variable is currently null. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Sent: 26 November 2002 16:52 To: Struts Users Mailing List Subject: RE: Struts-el strange behav. You need to provide the name of your form bean in the name attribute. -Original Message- From: kiuma [mailto:[EMAIL PROTECTED]] hello, I'm having the following problem (Furtunately I've found the solution). if i use html-el:hidden property='selectedCode'/ The container reply with an error WARNING: Exception for /webappointments/secure/specialitylistview.jsp javax.servlet.jsp.JspException: No getter method for property selectedCode of bean org.apache.struts.taglib.html.BEAN -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] . -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]