aspose file tools*
The moose likes Struts and the fly likes getter method error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getter method error" Watch "getter method error" New topic
Author

getter method error

Mohammad Akon
Greenhorn

Joined: Jul 17, 2007
Posts: 19
hi,
I am new at struts.......I am trying to follow some tutorials and tried to create an application by my own:

I did the following:

struts-config.xml:


EmailForm.java:


EmailAction.java:


and the email.jsp:



While trying to load the email.jsp from the browser I am getting the following error:


javax.servlet.ServletException: No getter method for property email1 of bean org.apache.struts.taglib.html.BEAN
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:495)
at org.apache.jsp.email_jsp._jspService(email_jsp.java:184)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
......
......
......




Any help would be appreciated.

Thanks,

mohammad
[ February 13, 2008: Message edited by: Mohammad Akon ]
Mohammad Akon
Greenhorn

Joined: Jul 17, 2007
Posts: 19
sorry about all those "&rt;" and " " in the post.....i thought those would also get changed
Naresh Talluri
Ranch Hand

Joined: Oct 12, 2007
Posts: 115
Originally posted by Mohammad Akon:
sorry about all those "&rt;" and " " in the post.....i thought those would also get changed


Hi Mohammod
Can you try like change the access modifer with public instead of public..

Thanks & Regards
Naresh
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try changing the action in your html:form tag from "email" to "/email". It's also a good idea to get rid of the name, type and scope attributes, as these are deprecated in later versions of Struts.


Merrill
Consultant, Sima Solutions
Mohammad Akon
Greenhorn

Joined: Jul 17, 2007
Posts: 19
Originally posted by Merrill Higginson:
Try changing the action in your html:form tag from "email" to "/email". It's also a good idea to get rid of the name, type and scope attributes, as these are deprecated in later versions of Struts.


I did and it was working fine. Then I changed my email.jsp, EmailForm.java, EmailAction.java and struts-config.xml as follows:

EmailForm.java

EmailAction.java

and email.jsp:


emailfailure.jsp


and still getting the same error:

[ February 13, 2008: Message edited by: Mohammad Akon ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Property names in Struts tags are based on the names of the getters and setters. Since your getter and setter are getEmailToAdmin and setEmailToAdmin, the property name you reference should be "emailToAdmin", not "email_to_admin".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getter method error