File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getter method error

 
Mohammad Akon
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about all those "&rt;" and " " in the post.....i thought those would also get changed
 
Naresh Talluri
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mohammad Akon
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic