By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

Deploying JSP/Servlets to Tomcat, page unavailable.....

P: n/a
Hi,
I'm using Tomcat 7.2 and I'm trying to deploy an aplication that uses
JSP and servlets. I'm actually trying to duplicate a production
server but can't get it right.
In the directory /whatever/java/tomcat4/webapps I have two other
directories called ROOT and test. Under both ROOT and test there is a
WEB-INF directory where web.xml file resides. Also, both ROOT and
test have login.jsp files.
When I type the URL localhost:8080/login.jsp it takes me to the
login.jsp that is located in ROOT. That I think is fine. But when I
type the URL localhost:8080/test/login.jsp I get a message that it's
unavailable. I'm also supposed to go to localhost:8080/test/ and see a
web page with all the contents of the directory, but instead I get the
unavailable message. What's wrong here? Going through the Tomcat
book I figured I have to change tomcat4/conf/server.conf file and
specify /test dir there. The problem is that when I look at the
production server, I'm trying to duplicate, and even at another
development server where the app works I see no changes done to
server.conf and if there are any they are commented out. So there
must be some other file? Or my setup is incorrect in some other way?
I checked the permissions and they seem fine, files are owned by
tomcat4, where else should I look? I'm sure it's some little thing I
overlooked, but I can't find it.
Please, let me know what you think.
Thanks in advance.
N.K.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Check the log file, you might find the cause of the problem there.

na****@parkerglobal.com (N.K.) wrote in message news:<2d**************************@posting.google. com>...
Hi,
I'm using Tomcat 7.2 and I'm trying to deploy an aplication that uses
JSP and servlets. I'm actually trying to duplicate a production
server but can't get it right.
In the directory /whatever/java/tomcat4/webapps I have two other
directories called ROOT and test. Under both ROOT and test there is a
WEB-INF directory where web.xml file resides. Also, both ROOT and
test have login.jsp files.
When I type the URL localhost:8080/login.jsp it takes me to the
login.jsp that is located in ROOT. That I think is fine. But when I
type the URL localhost:8080/test/login.jsp I get a message that it's
unavailable. I'm also supposed to go to localhost:8080/test/ and see a
web page with all the contents of the directory, but instead I get the
unavailable message. What's wrong here? Going through the Tomcat
book I figured I have to change tomcat4/conf/server.conf file and
specify /test dir there. The problem is that when I look at the
production server, I'm trying to duplicate, and even at another
development server where the app works I see no changes done to
server.conf and if there are any they are commented out. So there
must be some other file? Or my setup is incorrect in some other way?
I checked the permissions and they seem fine, files are owned by
tomcat4, where else should I look? I'm sure it's some little thing I
overlooked, but I can't find it.
Please, let me know what you think.
Thanks in advance.
N.K.

Jul 17 '05 #2

P: n/a
Hello,

If your web apps are following the Sun Servlet specification (which,
by the way is a good read), there should be a web.xml file in the
WEB-INF directory of your web app. This file controls how your servlet
is addressed by Tomcat. I imagine you need something like:

....
<servlet>
<servlet-name>MyWebApp</servlet-name>
<servlet-class>MyWebApp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>MyWebApp</servlet-name>
<url-pattern>/MyWebApp</url-pattern>
</servlet-mapping>
....

Depending on your app's needs you may need some more complicated
magic, but I think this will get you going for simpler servlets and
jsp's. Sorry, I can't provide more info, but I am somewhat new to
servlets and have been going through a lot of problems similar to
this. I do recommend checking out the specifications for servlets and
JSPs.

Regards and good luck,
Jay Bromley
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.