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 11th, 2007, 05:30 AM
Registered User
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot retrieve mapping for action /next(STRTUS)

hello friends,
               i am trying to do one applicatoin in struts but i am not able to do mapping for my application can any bady tel me where i am doing mistake. Hre is the code below

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <global-exceptions>
    </global-exceptions>

    <global-forwards>
        <forward
            name="welcome"
            path="/Welcome.do"/>
    </global-forwards>

    <action-mappings>
        <action
            path="/Welcome"
            forward="/pages/Welcome.jsp"/>
    <action path  = "/next"
            type  = "indexAction"
            input = "/pages/Welcome.jsp">
            <forward name="success" path="/goodDays.jsp"/>
    </action>
    </action-mappings>

    <controller
       processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

    <message-resources parameter="MessageResources" />
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >

      <set-property property="definitions-config"
                       value="/WEB-INF/tiles-defs.xml" />

      <set-property property="moduleAware" value="true" />
    </plug-in>

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property
        property="pathnames"
        value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>
</struts-config>
Jsp :
------
Code:
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<html:html locale="true">
<head>
<title><bean:message key="welcome.title"/></title>
<html:base/>
</head>
<body bgcolor="white">
<html:form action="/next.do">

<logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">

    ERROR:  Application resources not loaded -- check servlet container
    logs for error messages.

</logic:notPresent>

<h3><bean:message key="welcome.heading"/></h3>
<p><bean:message key="welcome.message"/></p>
<html:submit property="submit" value="submit"/>
</html:form>
</body>
</html:html>
Thx & rgds,
Ajay,
KL







 
Old July 19th, 2007, 01:36 AM
Authorized User
 
Join Date: Jul 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is no need of "/" in path. Generally it will take from root folder.

Change like this

<action path = "/next"
            type = "indexAction"
            input = "/pages/Welcome.jsp">
            <forward name="success" path="/goodDays.jsp"/>

to

<action path = "/next"
            type = "indexAction"
            input = "pages/Welcome.jsp">
            <forward name="success" path="/goodDays.jsp"/>
and

<forward
            name="welcome"
            path="/Welcome.do"/>

to

<forward
            name="welcome"
            path="Welcome.do"/>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Request action on change and get no action. Help crussell Ajax 0 September 12th, 2007 11:11 AM
exception""Cannot retrieve mapping for actio david_marsetty Struts 6 August 5th, 2007 06:04 AM
Problems with mapping mauriciom Biztalk 2 August 16th, 2006 06:47 AM
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.