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

tomcat problem.

Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
I donot know what is the wrong with that Tomact.I have executred my struts example successfully yesterday.Now I am executing it.it is not genrating the class file for jsp in work directory.
I am really fedup with that stupid behaviour of this tomact. I had spend omy 4 hour wht still I am at same level.

I have a two classes 1) example.NameForm 2) example.NameAction

And jsp is this



strutsconfig file
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<form-beans>
<form-bean name="nameForm" type="example.NameForm"/>
</form-beans>
<action-mappings>
<action path="/Name" type="example.NameAction" name="nameForm" input="/index.jsp">
<forward name="success" path="/displayname.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</action-mappings>
</struts-config>


please help me out......

RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi Vijay,
Im not very sure but I can see that <html:form action="Name"..> and struts-config.xml has <action path="/Name"... Please check that out.

Secondly is there any exception on the server console??? Please post that (if any).
Rest from all what was on the post i could comment only the above..

Regards,
Roshani


Regards,<br />Roshani
Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
thanks RoshaniG Gopal
there is no exception in server console.
I remove "/" frmo <action path="/Name"..
but getting the samne error....... I am really frustrated with the tomcat...
Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
I am getting the error at browser it this.

HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /index.jsp(12,0) Unable to find setter method for attribute: name
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: /index.jsp(12,0) Unable to find setter method for attribute: name
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2710)
org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2858)
org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2176)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1685)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3305)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.17


I do not know why it is dipalying this stupid error although I have bean having the setter method for name property. why it can't see this bean.

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Both the path attribute in your struts-config.xml file and the action attribute in your <html:form> tag should be "/Action" (with the slash). Also, remove the name and type attributes from your <html:form> tag. They aren't necessary and they are deprecated in later versions.

Show us the code for your NameForm class. It must have a getName() method.


Merrill
Consultant, Sima Solutions
Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
I thanks its woking fine now I removed name and type attribute from <html:form > and new tag is like <html:form action="/Name"> and it is working...
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tomcat problem.