This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Master Page in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Master Page in JSP" Watch "Master Page in JSP" New topic
Author

Master Page in JSP

Harish Moolchandani
Greenhorn

Joined: Mar 12, 2010
Posts: 23
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

Joined: Jan 10, 2002
Posts: 60817
    
  65

Why? What is the benefit and purpose of creating this unnecessary complexity?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Harish Moolchandani
Greenhorn

Joined: Mar 12, 2010
Posts: 23
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

Joined: Jan 10, 2002
Posts: 60817
    
  65

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>
 
 
subject: Master Page in JSP
 
Similar Threads
communication between two webapps which are in the same server
forward page- Tag Throwing Exception.Pl... help
Error message for JSP&Bean deployment
Standard actions in a JSP document?
Securing an application