I have to implement a system where I have to do almost same processing on a jsp page. The slight differences on the present page is based on whether the current page came from page 1 or page 2. So how can I do this?
What does "came from" mean? I ask because I can imagine at least two different meanings for that term, so could you explain what that means to you? Perhaps an example would help.
That's not a good way to approach the problem. Knowing "where it came from" would be an example of strong binding and is a poor practice.
Think about it this way for a minute: if you had a Java method that needed to perform slightly different processing in various situations, would you try to find out who called it in order to accomplish that? Of course not. So how would you do it? You'd pass parameters to the method, right? Well, the same approach can be used for a JSP.
From this, though, I predict that you are calling JSPs directly without controllers?
William Brogden
,
Author and all-around good cowpoke
I would use the HttpSession to store a "state" parameter when writing a page. That is always under your control. Easily expanded to store an entire "state" history if you like.
If you can't because the user has cookies turned off, use a hidden variable in a FORM.
Bill
Post by:autobot
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, that will fit in a stocking