File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "error" Watch "error" New topic
Author

error

gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
i have made out a folder under root of tomcat HelloClientServlet
under that
1-META-INF
2-WEB-INF
i have do in web.xml as follows..............

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<!-- Your servlet definitions go here -->


<servlet>
<servlet-name>HelloClientServlet</servlet-name>
<servlet-class>HelloClientServlet</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>HelloClientServlet</servlet-name>
<url-pattern>jaishriram</url-pattern>
</servlet-mapping>


</web-app>

i have saved it simply (without any package) but not in package and i have made a WAR file and stored it in root\HelloClientServlet\ram.war.

now what to write in url to excess it........

i m writing http:\\localhost:8080\jaishriram (i give jaishriram in servlet-url)
it is giving error

thank you
gaurav
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi Gaurav,
I try to help you.
- Place your war file in <tomcat-webapp>\ram.war
- Access that with http:\\localhost:<port-number>\ram\<your-servlet>

Hope this helps
daniel
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

A typical URL for a web app will look something like this:

I don't see a <context path> value in your URL. The context path is basically the name of your web app. It is one of the few properties of a web app not defined in web.xml. Tomcat uses the subdirectory you deploy an app in as the context path. For example if you deploy the app in $CATALINA_HOME/webapps/testApp your URL would be:


Another point to note is the META-INF folder is not required in a web app.

Please too try to give your posts a meaningful subject. The title "error" is not ver descriptive of your problem.
[ January 25, 2005: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
thanks for reply
i have created a WAR file,known as ram.war an save it in HelloClientServlet\ram.war.

i have given the url as-------

http:\\localhost:8080\ram\jaishriram
it i sgiving the error

and you were saying me that first i should read some book so please tell me that for which book i should go.

thank you
gaurav
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error