Exception in Struts application

Hi everybody, it's 3 month i'm using java2 and 1 month using Struts 1.3 with Tomcat 5.5.I wrote a simple application composed by a jsp called index,that is the start page,with an <html:form>,an ActionClass,an ActionForm and two jsp called success and failure.I've imported the taglib libraries and the struts-html taglib both in index.jsp and in the xml file,but when i try to start application it gives me:

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(9,1) Attribute name invalid for tag form according to TLD

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

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(9,1) Attribute name invalid for tag form according to TLD

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:234)

org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:989)

org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)

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.Validator.validate(Validator.java:1489)

org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)

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:305)

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)

The index.jsp(9,1) is where i put <html:form>:

9<body>

10<html:form action="Forma"

11name="LaForma"

12type="prova1.LaForma" >

13<table width="80" height="60" border="0">

Can anyone help me please?

[3089 byte] By [4_1_nighta] at [2007-11-26 16:05:34]
# 1

The <html:form> tag doesn't have attributes "name" or "type" anymore.

They were removed in struts 1.1 I think.

Instead it gets the name the form and the classname to use from struts-config.xml, using the action of the form to match them up.

So the html:form tag on your jsp page should be just:

<html:form action="Forma">

In your struts-config you should have a form definition:

<form-bean name="LaForma" type="prova1.LaForma"/>

and you should have an action which maps the action specified by your html:form to the required Action class and Formbean:

<action

path="Forma"

type="prova1.LaFormaAction"

name="LaForma">

<forward name="success" path="/index.jsp"/>

<forward name="failure" path="error.jsp"/>

</action>

evnafetsa at 2007-7-8 22:27:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi, i tried to to do this.i canceled atributes name and type and my struts config is like tou write.the only thing is that application's name is "first" and "prova1" is the name of the package where class files are in,so it should be like this:

action-mappings>

<action path="Forma"

type="first.LaAzione"

name="LaFormaAction"

input="index.jsp" >

<forward name="success" path="risult.jsp"/>

<forward name="failure" path="/index.jsp"/>

</action>

However it gives:

type Exception report

message

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

exception

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:9

6: </head>

7:

8: <body>

9: <html:form action="Forma">

10: <table width="80" height="60" border="0">

11: <tr>

12: <td>Simbolo:</td>

Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)

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

java.lang.NullPointerException: Module 'null' not found.

org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)

org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:723)

org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:742)

org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:417)

org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:99)

org.apache.jsp.index_jsp._jspService(index_jsp.java:72)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)

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)

4_1_nighta at 2007-7-8 22:27:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I got the same exception and found out the cause were some bad settings in struts-config.xml . Watch out for the error messages shown on the Tomcat startup console.
ChewRankera at 2007-7-8 22:27:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...