Struts mapping action to action???

Discussion in 'Java' started by runescience, Feb 6, 2006.

  1. runescience

    runescience Guest

    greetings. I want to go from a logon page to an action page that
    decides whether the user gets an edit page, or a new page with blank
    fields.


    ..jsp
    form action="/ResponseInit" method="get"

    struts-config.xml
    =======
    <action path="/ResponseInit"
    type="com.mycompany.struts.action.ResponseInitAction"
    name="LogonFormBean"
    scope="request">
    <forward name="SortRetrieve" path="/NewRegister.jsp"/>
    <forward name="SortRetrieve" path="/EditRegister.jsp"/>
    </action>


    In the action execute i will check the DB for logon and password, and
    then foward to an Edit register page.

    But, i seem to get fowarded to my page with nothing in the fields.

    What do I do?
    How do I do it?

    Is there a good example of this. The one built into the struts
    downloade example 1.2.7 was a bit confusing.
    runescience, Feb 6, 2006
    #1
    1. Advertising

  2. runescience

    Guest

    I see a couple of issues with your struts-config entry. First, and I'm
    sure this is just a typo in your posting, is the fact that you have
    named your forwards the same ("SortRetrieve"). You probably want to
    name them differently. Secondly, the forward path should point to a
    *.do reference (if *.do is what you have mapped to the Struts servlet)
    instead of a *.jsp reference. Doing so will allow you to pre-populate
    your ActionForm bean with the necessary information prior to loading
    the page.
    , Feb 7, 2006
    #2
    1. Advertising

  3. runescience

    runescience Guest

    thank you very much for your help. And yes it was a typo.

    I want to research what you described on the internet and my book.

    I have the husted: struts in action book. Ive been looking for it, but
    I probably keep missing it.

    What do you call this: fowarding to an action? <something i can look up
    and research on the internet?

    Thank you for your help again.
    runescience, Feb 7, 2006
    #3
  4. runescience

    runescience Guest

    thank you very much for your help. And yes it was a typo.

    I want to research what you described on the internet and my book.

    I have the husted: struts in action book. Ive been looking for it, but
    I probably keep missing it.

    What do you call this: fowarding to an action? <something i can look up
    and research on the internet?

    Thank you for your help again.
    runescience, Feb 7, 2006
    #4
    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. Pavel
    Replies:
    2
    Views:
    14,215
    Pavel
    Oct 20, 2003
  2. Pavel
    Replies:
    1
    Views:
    5,966
    Pavel
    Nov 14, 2003
  3. Hgjhghjgjhg Hgjhghjg

    Struts - get action mapping name

    Hgjhghjgjhg Hgjhghjg, Jul 19, 2004, in forum: Java
    Replies:
    1
    Views:
    4,966
    Murray
    Jul 19, 2004
  4. Replies:
    1
    Views:
    809
  5. ros
    Replies:
    0
    Views:
    602
Loading...

Share This Page