Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem working with struts!  RSS feed

 
Kather Basha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

i'm very new to struts framework. i was trying one sample from 'mastering jakarta struts' book. everything i coded(copied) fine as the author says. but still i'm getting an error(not expected). can anyone help me.

this is the error.
------------------
HTTP Status 500 -

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

type Exception report

message

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

exception

javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)


root cause

javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:712)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:500)
org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:144)
org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:119)
org.apache.jsp.index_jsp._jspService(index_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)

Regards

Kather Basha :roll:
 
sawan parihar
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you paste your struts-config.xml mappings. That will be helpful
 
amit mawkin
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this error will usually come when you have wrong mappings done in struts-config.xml, what basically happens is you try to submit your form to a url pattern like /submit.do but it does not find any entry in struts-config.xml

u should remember that in your jsp you have to write /url.do
and your struts-config.xml will have path like /url.

in your struts config.cml you should have some entry like

<action-mappings>
<action path="/submit"
type="example.stock.StockAction"
name="stockForm"
scope="request">
<forward name="success"
path="/result.jsp"/>
</action>
</action-mappings>

hth
[ September 08, 2004: Message edited by: amit mawkin ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!