This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Linking one jsp page to another  RSS feed

 
Nayanish Patil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I am new to JSP. I m getting HTTP Status 404 error whenever I try to link one jsp page to another using anchor tag.
I double checked respective linking path, but still getting error.
Actually, one jsp page is in context root and the other one is in the WEB-INF/View directory.
I m using NetBeans IDE 5.5 with bundled tomcat.
I want to know where I am getting wrong. What should be done to link jsp pages to each other residing in different directories.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP pages under the WEB-INF folder can never be directly linked to. That's the whole reason for putting them there.

JSP pages should never be linked directly to. Rather, all URLs should invoke their page controllers, which will forward to the JSP to render the view. Read this article for more information.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and Welcome to JavaRanch nayanish patil
 
Nayanish Patil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying guys.
Will you show the implementation of controller to forward to the JSP view. Also where & how the <jsp:forward> tag is used.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the article?

And <jsp:forward> is rarely, if ever, used in modern web applications. It's a hold-over from olden days when it was deemed appropriate to perform processing in a JSP then forward to another. That is no longer appropriate. Processing occurs in a controller that then forwards to a JSP to render the view.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!