Struts mapping action to action???

R

runescience

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.
 
S

spmion

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.
 
R

runescience

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.
 
R

runescience

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top