• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bookmarked page issue

 
Tome Wagese
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I am sure you have run across this issue.
How can I prevent page from being forwarded to bookmarked page and force users to Be in default welcome page after first logon.

I do have the <welcome-file-list> set up correctly in DD but if the users use their bookmarked link, it is ignored.


Thanks.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by that ? You want the user to see the welcome page even if he requests for some other page on the first try (through a bookmark) ?
 
Doyle Matt
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i understand you question correctly.. here's an answer.

Use a filter to force to check if a session is existing on the client side. If the session is just new or non existant then redirect to your desired page. However this might be a problem if you have login and logout.

Another solution would be to check for the "referrer" header.
 
Tome Wagese
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,
Thank you so much for the reply.
Here is what my problem.
Normally users come to login.jsp and with proper authentication user is forward to default.jsp
But some users have the protected pages bookmarked in their browser so when they login, request is forwarded to the bookmarked page instead of default.jsp.
 
Tome Wagese
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Doyle
I'll try that.
 
Tome Wagese
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried several methods to get around this issue and nothing seem to be working perfectly.
If anyone has and example of working (tested) piece of code, that would be very helpful.
I am using form authentication provided by Tomcat 6.x container.

I am not planning on putting little piece of code in every pages to check for authentication session either.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't sound like you tried a filter. If you did, post it here and we'll kindly let you know why it isn't working.
 
Tome Wagese
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did try using filter Marc.
But here is the scenario.
Since Tomcat 6.x did not kick off filter for j_security_check,
I made my own servlet (AppGroupInit) that adds additional session variable to the successful logins and forwards it to the defaut.jsp
<filter>
<filter-name>AppGroupSwitch</filter-name>
<filter-class>AppGroupSwitch </filter-class>
</filter>
<filter-mapping>
<filter-name>AppGroupSwitch </filter-name>
<url-pattern>/AppGroupInit</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>AppGroupInit</welcome-file>
</welcome-file-list>
Since I have only one file referenced in welcome-file-list, everything is smooth when uses do not use bookmarked link.
But my problem is if uses has bookmarked other pages then AppGroupInit servlet never runs and uses is directly forwarded to whatever page they had bookmarked.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic