You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Neal Kaiser <ne...@makeastore.com> on 2001/02/09 14:22:02 UTC
JspException: Must specify type attribute if name is specified
I just upgraded to last nights build and get the following error:
javax.servlet.jsp.JspException: Must specify type attribute if name is
specified at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:669)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441) at
/getstarted/regstep1.jsp._jspService(/getstarted/regstep1.jsp.java:84) (JSP
page line 47)
This is the line in the .jsp it is complaining about:
<form:form name="registrationForm" action="regstep1.do" >
And this is what I have in struts-config.xml:
<form-bean name="registrationForm"
type="com.mas.ebiz.asp.register.RegistrationForm"/>
and
<!-- Seller Registration - Selection of plan -->
<action path="/regstep1"
type="com.mas.ebiz.asp.register.SaveRegistrationAction"
name="registrationForm"
scope="session"
validate="true">
<forward name="success" path="/getstarted/regstep2.jsp"/>
<forward name="failure" path="/getstarted/regstep1.jsp"/>
</action>
I do seem to be passing the type, so I'm not sure why I get an error?
Any pointers for places for me to look?
When I upgraded, I updated the struts.jar and copied in the latest .tlds.
Thanks, Neal
Re: JspException: Must specify type attribute if name is specified
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Neal Kaiser wrote:
> I just upgraded to last nights build and get the following error:
>
> javax.servlet.jsp.JspException: Must specify type attribute if name is
> specified at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:669)
> at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441) at
> /getstarted/regstep1.jsp._jspService(/getstarted/regstep1.jsp.java:84) (JSP
> page line 47)
>
> This is the line in the .jsp it is complaining about:
>
> <form:form name="registrationForm" action="regstep1.do" >
>
If you specify name here, you must also specify type.
If you change this to:
<form:form action="regstep1.do">
The tag will be smart enough to figure out what form bean name you want, without
having to specify it both here and in struts-config.xml.
By the way, you should switch to using the "html" library rather than "form". The
old name will still work in Struts 1.0 (and the tags are all the same), but it is
deprecated.
Craig
Re: JspException: Must specify type attribute if name is specified
Posted by Wong Kok Wai <wo...@yahoo.com>.
The type is needed for the <form:form>.
--- Neal Kaiser <ne...@makeastore.com> wrote:
> I just upgraded to last nights build and get the
> following error:
>
> javax.servlet.jsp.JspException: Must specify type
> attribute if name is
> specified at
>
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:669)
> at
>
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:441)
> at
>
/getstarted/regstep1.jsp._jspService(/getstarted/regstep1.jsp.java:84)
> (JSP
> page line 47)
>
> This is the line in the .jsp it is complaining
> about:
>
> <form:form name="registrationForm"
> action="regstep1.do" >
>
> And this is what I have in struts-config.xml:
>
> <form-bean name="registrationForm"
>
> type="com.mas.ebiz.asp.register.RegistrationForm"/>
>
> and
>
>
> <!-- Seller Registration - Selection of plan -->
> <action path="/regstep1"
>
>
type="com.mas.ebiz.asp.register.SaveRegistrationAction"
> name="registrationForm"
> scope="session"
> validate="true">
> <forward name="success"
> path="/getstarted/regstep2.jsp"/>
> <forward name="failure"
> path="/getstarted/regstep1.jsp"/>
> </action>
>
>
> I do seem to be passing the type, so I'm not sure
> why I get an error?
>
> Any pointers for places for me to look?
>
> When I upgraded, I updated the struts.jar and copied
> in the latest .tlds.
>
> Thanks, Neal
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/