• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to control static pages and dynamic pages

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In my application i have 200 static pages(html) and 50 dynamic pages(jsp). The problem is i want to display logout/login buttons in all jsp pages&html pages according per user status. How to know the user is logged in or not while displaying html pages.
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use servlet filter, which will verify weather user has logged in or not before serving any static pages
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My suggestion pplies only if you are using basic, digest or form based athentication.
The getUserPrincipal() method of HttpServletRequest returns a java.security.Principal object containing the name of the current authenticated user which can be in turn used to determine if user is really logged on.


-Lave

Originally posted by surender reddy:
Hi all,
How to know the user is logged in or not while displaying html pages.

 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Surender Reddy,

Welcome to JavaRanch

You can use a template rather. Template is something like a common file (similar to header or footer) gets included in each page so that you will go with "single point of change".
reply
    Bookmark Topic Watch Topic
  • New Topic