This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a servlet (content.java) which acts as main page. I have a JSP file (footer.jsp) which acts as footer in that page. I am including the JSP in the server using RequestDispatcher include. It works perfectly fine. if I click the url http://localhost/servlet/content
So you are generating the main page with a servlet and including JSPs for the footer? That's an odd thing to do. Why not use a JSP for the main page as well?
But back to the original issue, placing the footer.jsp under the WEB-INF hierarchy will prevent direct addressing.
Joined: Jun 22, 2001
Thanks. Actually my company has acquired an application which has servlets as main content pages and we are given task to customise it. So we are using JSPs as footer and header. The main content pages can not be changed to JSPs now.