• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Master Page in JSP

 
Harish Moolchandani
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a master page in jsp, similar to ASP.Net.
I'm not using any framework.
I don't seem to find a good solution on internet.

What I have done till now is:
Created a master page called master.jsp
It has an attribute "redirect" which is used in <jsp:include>
So whichever page I put in redirect parameter will be called by include tag.
<jsp:include page="${redirect}></jsp:include>

But the problem is, the calling of pages should be like this
/WebSite/master.jsp?redirect=index.jsp



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? What is the benefit and purpose of creating this unnecessary complexity?
 
Harish Moolchandani
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what is the other way around?
The only other way it seem is to have <jsp:include> on all pages.

But, for admin, there will be different menu options, for consumer there will be different menu options.
So, this solved my problem.
But this is my question, what is the other way around? And how can I display different menu's for different users?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harish Moolchandani wrote:So, what is the other way around?

Around what? You haven't explained what you are trying to accomplish.

And how can I display different menu's for different users?

<c:if>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic