This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

unable to forward using jsp : forward  RSS feed

 
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

in my application i have got 2 .jsp file (view.jsp and view1.jsp)

Code in my view.jsp ()



Code of my view1.jsp



but when i run view.jsp it gives me following error 404



error is 404 for view1.jsp but in my browser its still shows the following url

http://localhost:8080/Jigar/jsp/view.jsp

which should be
view1.jsp[/b]]http://localhost:8080/Jigar/jsp/view1.jsp

can anybody help me out ???

how jsp:forward works ???
[ March 13, 2007: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Change <jsp:forward page="/Jigar/jsp/view1.jsp" > to <jsp:forward page="/jsp/view1.jsp" >

2. The browser will still display http://localhost:8080/Jigar/jsp/view.jsp
Forward is transparent to the browser. Server handles forwarding the request to view1.jsp and hence the URL will not change.

Please read through JSP section in J2EE tutorial from Sun. It would provide details on how forward works.
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL can be absolute or relative to the current JSP file. If it is absolute (beginning with a /), the path is resolved by your Web or application server. Reference..
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!