Results 1 to 7 of 7
  1. #1
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    61
    Rep Power
    0

    Default when i implement forward it shows the error in server

    when i implement forward it shows the error in server.

    with out forward it work fine but when i implemented the forward to another it shows errors in server.


    SEVERE: Parse Error at line 122 column 23: The content of element type "action-mappings" must match
    "(action)*".
    org.xml.sax.SAXParseException: The content of element type "action-mappings" must match "(action)*".

    this is my struts file:

    import org.apache.struts.action.*;
    import javax.servlet.http.*;
    public class NewStruts extends Action{
    public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response){
    ActionForward af=null;
    System.out.println("action form displayed");
    af=mapping.findForward("hello");
    return af;
    }
    }

    this is my action-mappings tab in struts-config.xml:

    <action-mappings>
    <!-- Default "Welcome" action -->
    <!-- Forwards to Welcome.jsp -->
    <action
    path="/Welcome"
    forward="/pages/Welcome.jsp"/>

    <!-- sample input and input submit actions

    <action
    path="/Input"
    type="org.apache.struts.actions.ForwardAction"
    parameter="/pages/Input.jsp"/>

    <action
    path="/InputSubmit"
    type="app.InputAction"
    name="inputForm"
    scope="request"
    validate="true"
    input="/pages/Input.jsp"/>

    <action
    path="/edit*"
    type="app.Edit{1}Action"
    name="inputForm"
    scope="request"
    validate="true"
    input="/pages/Edit{1}.jsp"/>

    end samples -->
    <action type="NewStruts" path="/one"/>
    <forward name="hello" path="/index.jsp"/>
    </action-mappings>


    i hope any one can help me

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    Parse Error at line 122 column 23

    Which line is 122 in the xml?

    ETA: Is "forward" a valid child element of attribute-mappings?
    I think not.

  3. #3
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    61
    Rep Power
    0

    Default

    not attribute-mappings action-mappings.
    it is write the forward is correct child tag.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    No it's not (and sorry, I meant action-mappings).
    The only child element of that is an action.
    <action> has <forward> as a child element.

  5. #5
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    61
    Rep Power
    0

    Wink

    thanks for you help.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default

    Has Struts stopped complaining?

  7. #7
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Location
    bangalore
    Posts
    61
    Rep Power
    0

    Talking

    yes now the program works too fine thanks for your help DDD:D

Similar Threads

  1. Replies: 6
    Last Post: 12-09-2010, 08:44 AM
  2. forward request url from server side
    By ragavendran in forum Java Servlet
    Replies: 1
    Last Post: 11-30-2010, 03:28 PM
  3. Replies: 7
    Last Post: 01-30-2009, 06:40 AM
  4. Replies: 5
    Last Post: 07-29-2008, 02:13 PM
  5. API to Implement Server SSH in JAVA
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 01:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •