wood burning stoves 2.0*
The moose likes Struts and the fly likes I am getting the follwing Exception in struts 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 » Frameworks » Struts
Bookmark "I am getting the follwing Exception in struts" Watch "I am getting the follwing Exception in struts" New topic
Author

I am getting the follwing Exception in struts

yerra reddy gatla
Greenhorn

Joined: Apr 25, 2006
Posts: 25
exception

javax.servlet.ServletException: Must specify type attribute if name is specified
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.Vendor_jsp._jspService(Vendor_jsp.java:514)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.jsp.JspException: Must specify type attribute if name is specified
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
org.apache.jsp.Vendor_jsp._jspService(Vendor_jsp.java:194)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



Actually I wrote type attribute in struts-config.xml. Still I am getting the exception...

Anybody plzz let me know the reason for this exception..

Regards,
Yerra Reddy
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What this message is telling you is that in your Vendor.jsp file, you have entered an <html:form> tag for which you have specified a name attribute, but not a type attribute. If you enter one, you have to enter both.

I'd suggest you remove the name attribute, as all that is really necessary for this tag is that action attrubute. Given this, Struts can look up the rest. In fact, in the latest version of Struts, both the name and type attribute are deprecated, so you can't use them at all.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I am getting the follwing Exception in struts
 
Similar Threads
Action mapping error !!
Getting an Exception
Error while jsp connecting to database
Error in deploying struts: Attribute name invalid according to the specified TLD
HTTP Status 500 -