• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getter method error

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry about all those "&rt;" and " " in the post.....i thought those would also get changed
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic