You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan <da...@adw.es> on 2008/11/25 14:07:34 UTC
How to get last requested page?
I know this question is more related to java by itself more than to
struts, but need some help :)
I have to re-use a method in a class, and then depending on from which
jsp page comes, forward to one jsp or another:
Page1.jsp (globalForward to method.do) endpage1.jsp
\ /
> INPUT Method.do (if request comes from page1) OUTPUT >
/ ( if request comes from page2)
Page2.jsp (globalforward to method.do) \endpage2.jsp
Is any method that tells me the last request jsp? Or how could i manage
this situation?
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to get last requested page?
Posted by Dan <da...@adw.es>.
Jim Kiley escribió:
> Dan,
> I would include some kind of parameter with the request that gives your
> application a clue as to what path it should follow. Then use the value of
> that parameter to determine which route to respond with. I think this is
> superior to just relying on the name of the JSP or something like that,
> because it better decouples your Java code from your presentation layer.
>
> jk
>
> On Tue, Nov 25, 2008 at 8:07 AM, Dan <da...@adw.es> wrote:
>
>
>> I know this question is more related to java by itself more than to struts,
>> but need some help :)
>>
>> I have to re-use a method in a class, and then depending on from which jsp
>> page comes, forward to one jsp or another:
>> Page1.jsp (globalForward to method.do) endpage1.jsp
>> \
>> /
>>
>>> INPUT Method.do (if request comes from page1) OUTPUT >
>>>
>> / ( if request comes from page2)
>> Page2.jsp (globalforward to method.do) \endpage2.jsp
>>
>>
>> Is any method that tells me the last request jsp? Or how could i manage
>> this situation?
>>
>> Thanks in advance.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>
>
Thanks for your answer. In fact that´s the approach, i would like to
know if there was another method that would return the last requested
jsp or so, anyway I would implement as you said saving a parameter in
session bean.
Have a good day !
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to get last requested page?
Posted by Jim Kiley <jh...@summa-tech.com>.
Dan,
I would include some kind of parameter with the request that gives your
application a clue as to what path it should follow. Then use the value of
that parameter to determine which route to respond with. I think this is
superior to just relying on the name of the JSP or something like that,
because it better decouples your Java code from your presentation layer.
jk
On Tue, Nov 25, 2008 at 8:07 AM, Dan <da...@adw.es> wrote:
> I know this question is more related to java by itself more than to struts,
> but need some help :)
>
> I have to re-use a method in a class, and then depending on from which jsp
> page comes, forward to one jsp or another:
> Page1.jsp (globalForward to method.do) endpage1.jsp
> \
> /
> > INPUT Method.do (if request comes from page1) OUTPUT >
> / ( if request comes from page2)
> Page2.jsp (globalforward to method.do) \endpage2.jsp
>
>
> Is any method that tells me the last request jsp? Or how could i manage
> this situation?
>
> Thanks in advance.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com