• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

context path

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
iam having problems with context path in server.xml file.i dont know where to change the context path(either in context root or context examples one).can somebody send me the details and full server.xml file.
i wrote a servlet called GreetingServlet and placed it in folder greeting ,placed it in c:/program files/java/tomcat 4.1/webapps folder.
thanks for your help in advance
tagore
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ravindranath konduru:
Hello
iam having problems with context path in server.xml file.i dont know where to change the context path(either in context root or context examples one).can somebody send me the details and full server.xml file.
i wrote a servlet called GreetingServlet and placed it in folder greeting ,placed it in c:/program files/java/tomcat 4.1/webapps folder.
thanks for your help in advance
tagore


-----------------------------------------
there are a number of conditions that you have to follow to build a new web application.
to create a new web application follow the following steps:
1. create a new folder under the webapps folder for the tomcat (e.g., greeting folder)
2. create a subfolder in greeting folder called WEB-INF(required).
3. create a subfolder in WEB-INF directory called classes(required) and set any classes that you have created in this folder or any subfolder(for example com/GreetingServlet.class).
4. under the WEB-INF folder create a new file called web.xml(required).
5. in the web.xml file add the following text.
<web-app>
<servlet>
<servlet-name>greetingSer</servlet-name>
<servlet-class>com.GreetingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetingSer</servlet-name>
<url-pattern>*.greet</url-pattern>
</servlet-mapping>
</web-app>

6. restart the tomcat.
7. open the internet browser and print the following URL: http://localhost:8080/greeting/hello.greet and click Enter

now the output of your servlet will be displayed on your browser.
 
There is no "i" in denial. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic