Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Bookmarked page issue

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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) ?
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Doyle
I'll try that.
 
Tome Wagese
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic