Mohan Radhakrishnan wrote:
Hi,

Flow :
login.jsp -> mainscreen.jsp[ jsp:includes a left panel showing report
parameters]
The parameters are chosen by the user. Forward to the same
mainscreen.jsp which is shown again with the left panel hidden (uses layers)
and the report shown in the center of the screen.

1. Pre-population of the left panel with report parameters.
Action mapping used is.

<action path="/mainscreen"
type="com.hcl.smartmanage.web.action.ReportParameterAction"
--> Doesn't do anything right now.
name="reportParameterForm"
validate="false"
scope="session"
input="/mainscreen.jsp">
</action>
If I understand your setup, this action should forward to the mainscreen page. Do you have a global "success" forward to that page? If not, you should include a local forward in the action definition above. Also, since form validation is turned off, there is no point in including the input attribute.

         Form tag used is <html:form  action="mainscreen.action" ....


   After the parameters are shown the user clicks the 'submit' button inside
the above form tag and the parameters should be processed and a report
fetched. But the 'action' of the form tag should be differentiated so that
this action mapping takes effect. How do you do that?
The action attributes of your html form elements should correspond to path attributes in your action definitions. See the Struts User's Guide and sample apps. If I understand the setup, the form above should post to the /report action defined below -- i.e., the form in mainscreen.jsp that posts the report parameters should have action="/report", not "mainscreen.action" (whatever that means).

In the example that I posted earlier, the "search parameters page", bookSearch.jsp, posts to "/a/listBook".

While you can certainly use the same jsp for all of these things, I would not do this personally. If the reason that you are doing this is to reuse common elements, you should consider using tiles.

If you are having trouble understanding how struts dispatches actions, here is a good reference:

http://www-106.ibm.com/developerworks/library/j-struts/?n-j-2151

To solidify your understanding, if you are comfortable with UML and have tools available, I would recommend documenting your use cases and creating interaction diagrams similar to the ones in the article above. That way you will get a nice design and also a better understanding of the framework :-)

hth,

Phil




<action path="/report"
type="com.hcl.smartmanage.web.action.ReportSelectionAction"
name="reportParameterForm"
validate="false"
scope="session"
input="/mainscreen.jsp">
</action>

bye,
Mohan

-----Original Message-----
From: Phil Steitz [mailto:phil@;steitz.com]
Sent: Monday, October 21, 2002 10:45 AM
To: Struts Users Mailing List
Subject: Re: How to add a pre-action


Mohan Radhakrishnan wrote:

Hi,
   I am doing something similar but I have a doubt.


I show selection parameters with the following action mapping. The
html:form

action for that is mainscreen.action.

<action    path="/mainscreen"
          type="com.hcl.smartmanage.web.action.ReportParameterAction"
          name="reportParameterForm"
          validate="false"
          scope="session"
          input="/mainscreen.jsp">
   </action>

In our case the same jsp (mainscreen.jsp) is shown after getting the
results based on the selected parameters.
But the action should be different to retrieve the results -
report.action.

So initially it should be mainscreen.action and later it should be
report.action. How can this be done if the the same jsp and same html:form
(mainscreen.action) value is used.
Am I clear ?

I don't understand exactly what you are trying to do. Describe the user flow for each of the use cases. Where does the action above forward to? What is "mainscreen.action"? What is "report.action"?


bye,
mohan


------------------------------------------------------------------------

This message and any attachments have been scanned for viruses during transmission from HCL Comnet.



------------------------------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to