This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes How to control static pages and dynamic pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to control static pages and dynamic pages" Watch "How to control static pages and dynamic pages" New topic
Author

How to control static pages and dynamic pages

surender reddy
Greenhorn

Joined: Jan 10, 2008
Posts: 5
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.
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

You can use servlet filter, which will verify weather user has logged in or not before serving any static pages


[Servlet tutorial] [Servlet 3.0 Cook Book]
Lave Kulshreshtha
Ranch Hand

Joined: Oct 21, 2007
Posts: 106
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.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, ITIL V3 Foundation Certification
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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".


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to control static pages and dynamic pages
 
Similar Threads
Struts, Content Providers (Teamsite) and jsp's ...
JSP EL and Javascript?
Combining static and dynamic content
Include HTML files?
generating dynamix menus, headers, and content using static html and jsp