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 Servlets and the fly likes sendRedirect() to ROOT in tomcat 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 » Servlets
Bookmark "sendRedirect() to ROOT in tomcat" Watch "sendRedirect() to ROOT in tomcat" New topic

sendRedirect() to ROOT in tomcat

Kevin Wright
Ranch Hand

Joined: Jul 10, 2001
Posts: 38
I am running tomcat 3.2.2
I want to use the HttpServletResponse.sendRedirect method to send somebody from a servlet to a (jsp)file in my ROOT directory. If I fully qualify the path name, I get an error because the servlet looks in the "\servlet" directory first. This is what I get ("/servlet/C:/jakarta-tomcat-3.2.2/...".) How would I fix this?
Tony Alicea

Joined: Jan 30, 2000
Posts: 3222
sendRedirect() is executed by the browser so the URL given has to be one in a format that is reachable from the public Internet. The browser doesn't know about your C dive.
You would have to map your C:\ drive to some URL in the app (or HTTP) server. Or something like that

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Don't get me started about those stupid light bulbs.
subject: sendRedirect() to ROOT in tomcat
Similar Threads
Tomcat Locale Problem
Running an Applet in Tomcat 4.0
why ???
How to map Ms Sql Server datatabse to ejb in JBoss
Tomcat aliasing headache