• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts framework

 
jothish chokkalingam
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Betsy Camel
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not following the JavaBeans convention for getters and setters, which should be like this.

 
jothish chokkalingam
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
jothish chokkalingam
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes srinivas...
it works thanks ppl
 
lubna kausar
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic