Shyam Goud

Greenhorn
+ Follow
since May 29, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shyam Goud

I found out the solution guys, create a submit button and write a javascript on load function which would automatically submit the form. when you have a submit form in jsp, struts will automatically generate token
15 years ago
Hi Friends,

How do I generate a token manually and add it to the request.
My index.jsp looks something like this.
--------------------------------------------------------------
<html>
<BODY>
<jsp:forward page="gotoLogin.do" />
</BODY>
</html>
--------------------------------------------------------------
The index.jsp is the entry point of my application and we are automatically forwarding it to the action. I use a filter to generate tokens for Jsp's. But the problem is my filter doesn't generate token for the index.jsp because it does not have a submit button.

Can you guys help me out to work around this situation.
15 years ago
Thanks very much Merill. I will the suggested approach.
15 years ago
Hi sagar,

I assume that eventhough the session is timedout, it would still be there unless we cleanup the request parameters.

When I relogin after session time out....In the RetrieveRequestParameters()...I would just say
HttpSession session = httpRequest.getSession(true);
if(session != null){
Map savedParams = (Map) session.getAttribute(REQUEST_PARAMS);

if (savedParams == null)
return httpRequest;
return new SessionStateDecorator(httpRequest, savedParams);
}
return httpRequest;

And this is actually working....and i can see these parameters while in debug mode..I used the following example since it matches my requirement exactly...plzz go through the link

http://today.java.net/pub/a/today/2007/01/04/transparent-state-management-using-decorator-pattern.html
15 years ago
Hi Ranchers,

I am working on an application where i need to implement session management. My application has got 20 Jsp's and the session timeout is set to 15 mins. Now...when i am in 8th page and the session times out....and when i click to goto 9th page....my application redirects me back to the login page. This is absolutely fine.

But..here's the thing....when I login back it goes to the first page of the application instead of 9th page...

I had 2 possible solutions for this....
1. We can store the pageid's in a database and retrieve then when we log back in...(I dont like the idea of making any database changes)

2. when session timesout...b4 i go to the login page...i save the forwardURI and the request parameters in a map...and retrieve these parameters when i login and I decorate the latest request parameters with the old ones that were stored in the map...coz we are still in the session...

When I use the 2nd approach I get an illegal class cast exception when I try to use request.getParameter(paramName);

Can you people suggest me a different approach for this solution or a work around for the exception....Thanks
15 years ago