This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes tomcat4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

tomcat4

prasad hagargi
Ranch Hand

Joined: Oct 21, 2002
Posts: 36
This is in reference with
"http://www.coderanch.com/t/82167/Tomcat/configuring-servlets-tomcat"

below is the structure of the web.xml of the application,iam trying to deploy

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorldExample</servlet-name>
<servlet-class>test.HelloWorldExample</servlet-class>
</servlet>
</web-app>
while invoking iam using the url
http://localhost:8080/test/servlet/HelloWorldExample
the context tag in server.xml is
<Context path="/test" docBase="test" debug="0"
reloadable="true" crossContext="true"/>
i still am getting
The requested resource (/test/servlet/HelloWorldExample) is not available.
Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
Try with http://localhost:8080/servlet/HelloWorldExample
all the servlets you deploy into tomcat by default doesn't need the <docbase> of your webapp in the url.
You can obviously override this behaviour (see conf/server.xml)
Greetings


Regards,<br />Andrea<br /> <br /><a href="http://www.linkedin.com/in/andreagazzarini" target="_blank" rel="nofollow">Andrea Gazzarini</a><br />Skype ID : gazzax72<br />Google Talk ID : a.gazzarini@gmail.com<br /><a href="http://www.andreagazzarini.blogspot.com" target="_blank" rel="nofollow">My Blog</a>
Sam Wang
Ranch Hand

Joined: Jul 17, 2001
Posts: 95
I try the url like http://localhost:8080/servlet/SomeServlet
or
http://localhost:8080/SomePath/servlet/SomeServlet
,it's also not available.
I only succeed when like
[web.xml]
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
[server.xml]
<Context path="/test" docBase="test" debug="0" />
[url]
http://localhost:8080/test/whateveryoutypehere.do
I also don't know why.
Some experience man can let me know why??


SCJP(2001)
prasad hagargi
Ranch Hand

Joined: Oct 21, 2002
Posts: 36
my problem is solved ,thanks a lot folks,
i have one more query,like what is the configuration procedure ,if i want to enable cross context invocations
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

sigh.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: tomcat4