wood burning stoves 2.0*
The moose likes Servlets and the fly likes Including pages based on condition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Including pages based on condition" Watch "Including pages based on condition" New topic
Author

Including pages based on condition

Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
I have a JSP that needs to include different set of HTML based on the user permissions.
RIght now I just redirect the page to a different page but I would rather jast have a common html and then include the appropriate parts if the user have persmissions for them.
Any ideas ?
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
You can use <jsp:include page="page to include" flush="true"/>
try it.
Sunetra Saha
Ranch Hand

Joined: Feb 25, 2001
Posts: 77
Wouldn't a simple if condition enclosing the offending portion in {} work for you? i.e
<% if (user role = x ) {%>
.....html...
<% } %>
 
 
subject: Including pages based on condition
 
Similar Threads
Date() object when using javascript
How to include just created files.
is there any way to include or show html files inside JSF files in runtime?
Combining static and dynamic content
include file in jsp