Struts link problem

Discussion in 'Java' started by TDOR, Jul 3, 2005.

  1. TDOR

    TDOR Guest

    I have a welcome.jsp and a projectproperties.jsp.
    When i press a html link on welcome.jsp to href="projectproperties.do"
    im sent
    to back welcome.jsp again!? This is from the struts-config:

    ....
    <form-beans>
    <form-bean name="ProjectPropertiesForm"
    type="myself.ProjectPropertiesForm"/>
    </form-beans>
    ....
    <action-mappings>
    <action path="/welcome" forward="/Welcome.jsp"/>
    <action name="ProjectPropertiesForm" path="/projectproperties"
    input="ProjectProperties.jsp" type="myself.ProjectPropertiesAction"
    scope="request" validate="true">
    <forward name="success" path="/welcome.do"/>
    <forward name="failure" path="/ProjectProperties.jsp"/>
    </action>
    ....

    I have built it based on the struts-blank.war sample (struts 1.2.7).
    What am i doing wrong?
     
    TDOR, Jul 3, 2005
    #1
    1. Advertising

  2. TDOR

    Wendy Smoak Guest

    "TDOR" <> wrote:
    >I have a welcome.jsp and a projectproperties.jsp.
    > When i press a html link on welcome.jsp to href="projectproperties.do"
    > im sent to back welcome.jsp again!?


    Let's see something from ProjectPropertiesAction. In particular, I bet
    you're calling
    mapping.findForward( "success" );
    when you mean
    mapping.getInputForward();
    which would send you to the ProjectProperties.jsp

    For some reason you've defined "success" within the ProjectProperties
    ActionMapping to go back to welcome:
    > <forward name="success" path="/welcome.do"/>


    Probably success should go to [something like] ProjectPropertiesSuccess.jsp
    which will have a message saying whatever the user did, worked okay.

    --
    Wendy Smoak
     
    Wendy Smoak, Jul 3, 2005
    #2
    1. Advertising

  3. The "success" of the /projectproperties action is set to welcome.jsp
    page.
    Check your myself.ProjectPropertiesAction:
    If you have code like
    mapping.findForward("success") for the success then you have made a
    mistake in struts-config. Change the struts-config file as,
    <forward name="failure" path="/welcome.do"/>
    <forward name="success" path="/ProjectProperties.jsp"/>

    You will understand the error.

    If not, paste the code in Action class here.
     
    Kamal Chandana, Jul 4, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    882
    Kevin Spencer
    May 17, 2005
  2. Katie Wright
    Replies:
    8
    Views:
    4,272
    Andrea Desole
    Jan 7, 2005
  3. Jason Us
    Replies:
    0
    Views:
    1,000
    Jason Us
    Oct 4, 2003
  4. jc1771
    Replies:
    0
    Views:
    413
    jc1771
    Dec 28, 2003
  5. Aleksandar Matijaca
    Replies:
    2
    Views:
    8,339
    Aleksandar Matijaca
    Sep 19, 2004
Loading...

Share This Page