This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes struts framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "struts framework" Watch "struts framework" New topic
Author

struts framework

jothish chokkalingam
Ranch Hand

Joined: Jan 02, 2006
Posts: 57
i m having my action bean in path C:\Program Files\Apache Group\Tomcat 4.1\webapps\jothish\WEB-INF\classes\verify as well as action servlet......
both these file compile well.....
i m having index.jsp in the path C:\Program Files\Apache Group\Tomcat 4.1\webapps\jothish
my web.xml file is
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>verify.acs</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
my struts-config.xml file
<struts-config>
<form-bean name="che" type="verify.check"/>
<message-resources parameter="verify.ApplicationResources"/>
<action path="/checking" type="verify.acs" name="che" input="/index.jsp">
<forward name="ok" path="/success.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</struts-config>
while i m loading the index.jsp page ...
it is showing error
org.apache.jasper.JasperException: /index.jsp(20,0) Unable to find setter method for attribute: name
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:186)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:1753)
at org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:1356)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1179)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:707)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:232)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
at org.apache.jasper.compiler.Generator.generate(Generator.java:1917)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:242)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)

help is urgently needed


jothish
Betsy Camel
Ranch Hand

Joined: Oct 02, 2003
Posts: 119
Check your formbean.must have missed your setters & getters
or maybe you have not followed the coding conventions(in case of tomcat, coding conventions are very much important)
jothish chokkalingam
Ranch Hand

Joined: Jan 02, 2006
Posts: 57
hey camel,
this is my index.jsp
<table width="45%" border="0">
<tr>
<td><jothi:select property="username">
<jothi ption value="Marie">Marie</jothi ption>
<jothi ption value="Klaus">Klaus</jothi ption>
</jothi:select>
</td>
</tr>
<tr>
<td>password:</td>
<td><jothi:text property="password" /></td>
</tr>
<tr>
<td colspan="2" align="center"><jothi:submit /></td>
</tr>
</table>
my form bean is i couldn't find any thing wrong here.....
if you find....... even it may be simple thing.........
public class check extends ActionForm {
private String username = null;
private String password= null;
public String getusername() {
return (username);
}
public void setusername(String username) {
this.username= username;
}
public String getpassword() {
return (password);
}
public void setpassword(String password) {
this.password= password;
}
}
help urgently needed
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
You are not following the JavaBeans convention for getters and setters, which should be like this.



SCJP 1.4, SCWCD 1.3, SCBCD 1.3
jothish chokkalingam
Ranch Hand

Joined: Jan 02, 2006
Posts: 57
yup guys,
i m gettting the same error even i changed them to conventions...
the form in my jsp page is
<jothi:form action="checking" name="che" type="verify.check" >
help urgently needed
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Is your field supposed to be called name or userName.

In the exception it is looking for a getter for an attribute called "name" but in your cod eit looks like you call the attribute "userName".

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
jothish chokkalingam
Ranch Hand

Joined: Jan 02, 2006
Posts: 57
no mark it is showing error in the line jsp(20,0)
<jothi:form action="checking" name="che" type="verify.check" >
i think the attribute it is specifying is for name attrubute in the form tag as above..........
help urgently needed
[ January 23, 2006: Message edited by: jothish chokkalingam ]
Shrinivas Mujumdar
Ranch Hand

Joined: Aug 27, 2004
Posts: 328
no mark it is showing error in the line jsp(20,0)
<jothi:form action="checking" name="che" type="verify.check" >
i think the attribute it is specifying is for name attrubute in the form tag as above..........
help urgently needed


Make action="/checking" otherwise i do not thik any issue is there assuming you have modified your code as guided by experts.

Shrinivas
jothish chokkalingam
Ranch Hand

Joined: Jan 02, 2006
Posts: 57
yes srinivas...
it works thanks ppl
lubna kausar
Ranch Hand

Joined: May 06, 2006
Posts: 51
hi there m also getting the same error for same line and my code is also correct..
it is as follows...
<html:form action="/user" name = "userForm" type = "com.patni.peass.form.user.UserForm" >

and it gives me
Unable to find setter method for attribute: name

thanx in advance...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts framework
 
Similar Threads
Do Not Understand "/tags/struts-logic" Not Found
JasperException: Cannot retrieve mapping for action /
Exception creating bean of class
Problem with simple bean that fails only at deployment location
Stuts forwarding does not work