struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Satyam" <ashutosh.sat...@alopa.com>
Subject RE: Forward to original page
Date Wed, 05 May 2004 10:09:55 GMT
What I could infer you want to come back to the 
original page from whereever you posted the request.

In your struts configuration file you need to provide
action-mapping to appropriate tiles definition.

For instance,
 snippet of struts config file

 <action 
    path="/UserConfig"
    type="org.apache.user.UserConfAction"
    scope="request"
    parameter="method" >  
    <forward name="success" path="UserConf"/>
 </action>

 tiles definition file

 <definition name="UserConf" path="/WEB-INF/layout.jsp">
    <put name="header" value="/WEB-INF/top.jsp"/>
    <put name="leftside" value="/WEB-INF/left.jsp"/>
    <put name="body" value="/WEB-INF/pages/details.jsp"/>
    <put name="footer" value="/WEB-INF/bottom.jsp"/>
 </definition>

Remember in your Action class, you will have to redirect to
the same forward path which leads to the same tiles-definition.

Say, first time when this page gets loaded the action class does 
a forward like this - return mapping.findForward("success");

And also after this page is submitted the action class should again
do a forward as mentioned above - return mapping.findForward("success");


Hope it helps.

- Ashutosh Satyam



-----Original Message-----
From: Christian Grobmeier [mailto:christian.grobmeier@aman.de]
Sent: Wednesday, May 05, 2004 3:23 PM
To: user@struts.apache.org
Subject: Forward to original page


Hello all,

i have written an small application with struts. Now i have a problem,
which is easily to solve with such languages as PHP.
But with Struts it seems not to be such easy. I have read all the 
documentation and what i could find in the archives nor in google.

I have this pages (Tiles):

frontend.overview
frontend.details
frontend.results

there is a form, which is included in all three templates. It sets the 
sort-order for my results. The Problem is, when i change this order i 
would like to be forwarded to the page where the form has been submitted.

for example:

frontend.details -> submit the form -> action -> business -> action -> 
forward to frontend.details

The same with all templates.

Do you have any suggestions?
I tried allready such things:
return(mapping.findForward(request.getServletPath()));
altought request.getServletPath isn't giving me a logical name.

Thanks in advance,
Christian
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
take a look --> www.pfister.de
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christian Grobmeier
-->> mailto:christian.grobmeier@aman.de
AMAN Media GmbH
network & media
Dorfstrasse 1-4
85235 Unterumbach @ Munich
Germany
fon:   ++49-(0)8134-9100
fax:   ++49-(0)8134-9110
technical support:
mailto:admin@aman.de
http://www.aman.de

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diese eMail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe/Weiterleitung dieser Mail ist nicht gestattet. Wenn Sie nicht
der richtige Adressat sind oder diese eMail irrtümlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail

This e-mail may contain confidential and/or privileged information. Any
unauthorized copying, disclosure or distribution/forwarding of the
material in this email is strictly forbidden. If you are not the
intended recipient (or have received this e-mail in error) please notify
the sender immediately and destroy this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message