GeeCON Prague 2014*
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


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...
<% } %>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Including pages based on condition