Help coderanch get a
new server
by contributing to the fundraiser

Anil k Agrawal

Greenhorn
+ Follow
since Sep 20, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anil k Agrawal

Viv Singh wrote:Hi,

I have a problem with the RequestDispatcher:

I have a page: http://localhost:8080/tool/portal/page1.jsp

In this page I have a form which gets posted to a servlet called serv1

This serv1 does some operations and executes the following code:



The problem now is that I get redirected to

http://localhost:8080/supporttool/serv1

rather then to:

http://localhost:8080/supporttool/portal/serv1

What am I doing wrong here?



Just try to forward your request to path "/"

It will give you idea how RequestDispatcher expecting path. Then provide URI of your jsp

For example on forwarding request on "/", you will be taken to root of webapp, if your jsp is inside WEB-INF directory, you have to specify your path like this

"/WEB-INF/pages/page.jsp"
4 years ago
If you are using IMAP protocol, this works well

6 years ago