This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes forward/redirect in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "forward/redirect in jsp" Watch "forward/redirect in jsp" New topic

forward/redirect in jsp

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
I am trying to redirect/forward from jsp file to another jsp file but it ended up in error. Using request dispatcher my code are
RequestDispatcher listpg=getServletContext().getRequestDispatcher("/updlist.jsp");
I also tried
but still cannot.
I put the execution code in an if block. Can someone point out the reason. thanks.

if (rowsaffect >=1)
<h1>Modify Successful</h1>
<script type="text/javascript">
Nadeem Ahmad

Joined: Oct 20, 2003
Posts: 28
Hope this will work
Deepak A
Ranch Hand

Joined: Oct 04, 2001
Posts: 120
Why are u creating trouble for yourself. Totally remove that RequestDispatcher part and use <jsp:forward page="xyz" /> in your if loop.
It will work 100%. If it doesnt means it hasnt entered ur if statement.

Face Off.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60785

Do you not think that it would be useful to actually show the error that you are getting?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
wood burning stoves
subject: forward/redirect in jsp
Similar Threads
More simple doubts....errr
show and insert data from list depending on choice of radio button
i can't understand this sentence ~~please help me,thanks
using target tag in servlet?
Confused with flush() behavior