File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes unable to forward using jsp : forward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "unable to forward using jsp : forward" Watch "unable to forward using jsp : forward" New topic

unable to forward using jsp : forward

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 761

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


which should be

can anybody help me out ???

how jsp:forward works ???
[ March 13, 2007: Message edited by: Bear Bibeault ]

Jigar Naik

Sunil Vasudevan
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
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.

Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

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..

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
I agree. Here's the link:
subject: unable to forward using jsp : forward
jQuery in Action, 3rd edition