Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 23rd, 2007, 02:13 PM
Authorized User
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to david_marsetty
Default exception""Cannot retrieve mapping for actio

this is my struts-config.xml file

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">


<struts-config>

<form-beans>
<form-bean name="nameForm" type="example.NameForm"/>
</form-beans>

<action-mapping>
<action path="/Name" type="example.NameAction" name="nameForm" input="/strutsapp/index.jsp">
      <forward name="success" path="/strutsapp/displayname.jsp"/>
<forward name="failure" path="/strutsapp/index.jsp"/>
</action>
</action-mapping>

<message-resources parameter="example/ApplicationResources"/>
</struts-config>


and i am getting error



type Exception report

message

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

exception

javax.servlet.ServletException: Cannot retrieve mapping for action /Name
    org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:825)
    org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:758)
    org.apache.jsp.index_jsp._jspService(index_jsp.jav a:86)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

root cause

javax.servlet.jsp.JspException: Cannot retrieve mapping for action /Name
    org.apache.struts.taglib.html.FormTag.lookup(FormT ag.java:871)
    org.apache.struts.taglib.html.FormTag.doStartTag(F ormTag.java:543)
    org.apache.jsp.index_jsp._jspx_meth_html_form_0(in dex_jsp.java:104)
    org.apache.jsp.index_jsp._jspService(index_jsp.jav a:76)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

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



plz help me

M.david
__________________
M.david
 
Old July 24th, 2007, 01:26 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe your form bean type example.NameForm is proper. Please do check that first.

Second thing is in message-resources tag, you mentioned example/ApplicationResources. Change it to example.ApplicationResources. It may work.
 
Old July 24th, 2007, 06:52 AM
Authorized User
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to david_marsetty
Default

Quote:
quote:Originally posted by meetravig
 I believe your form bean type example.NameForm is proper. Please do check that first.

Second thing is in message-resources tag, you mentioned example/ApplicationResources. Change it to example.ApplicationResources. It may work.

even now also it given same error


M.david
 
Old July 24th, 2007, 07:01 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One more thing which I didn't observed earlier was :

you used one tag called <action-mapping> and </action-mapping> which is not there in struts-config.

Change that to <action-mappings> and </action-mappings>

Check it now. All the best
 
Old July 24th, 2007, 12:54 PM
Authorized User
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to david_marsetty
Default

Quote:
quote:Originally posted by meetravig
 One more thing which I didn't observed earlier was :

you used one tag called <action-mapping> and </action-mapping> which is not there in struts-config.

Change that to <action-mappings> and </action-mappings>

Check it now. All the best




but it shows this message


type Status report

message /strutsapp/

description The requested resource (/strutsapp/) is not available.
this is my index.jsp

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
<head>
<title>Sample Struts Application</title>
</head>
<body>
  <html:form action="Name" name="nameForm" type="example.NameForm">
    <table width="80%" border="0">
      <tr>
        <td>Name:</td>
        <td><html:text property="name" /></td>
      </tr>
      <tr>
        <td><html:submit /></td>
      </tr>
    </table>
  </html:form>
</body>
</html>

struts-config.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD StrutsConfiguration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>

<form-beans>
<form-bean name="nameForm" type="example.NameForm"/>
</form-beans>

<action-mappings>
<action path="/Name" type="strutsapp.*.*.example.NameAction" name="nameForm">
<forward name="success" path="/displayname.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
</action-mappings>

</struts-config>

M.david
 
Old July 24th, 2007, 10:52 PM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In struts-config, Change the line

<action path="/Name" type="strutsapp.*.*.example.NameAction" name="nameForm">

to

<action path="/Name" type="example.NameAction" name="nameForm">

In jsp, change the line

<html:form action="Name" name="nameForm" type="example.NameForm">

to

<html:form action="Name.do" name="nameForm" type="example.NameForm">

and try.
 
Old August 5th, 2007, 06:04 AM
Registered User
 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zjrzxy83
Default

In jsp, change the line
<html:form action="Name" name="nameForm" type="example.NameForm">
to
<html:form action="/Name" name="nameForm" type="example.NameForm">







Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot retrieve mapping for action /next(STRTUS) msg2ajay Struts 1 July 19th, 2007 01:36 AM
Many-to-Many Relationships in O/R Mapping sarosh Classic ASP Databases 0 December 8th, 2006 05:45 AM
O/R mapping many to many relationship popoxinhxan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 August 17th, 2006 11:18 PM
O/R mapping s_sana General .NET 0 April 12th, 2005 06:34 AM
mapping error erisa Biztalk 0 October 30th, 2003 05:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.