IntelliJ Java IDE
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes where to put war Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "where to put war" Watch "where to put war" New topic
Author

where to put war

Michelle Lee
Ranch Hand

Joined: Jan 23, 2002
Posts: 42
Hi:
Is any body know where shall I put war files? in
webapps? In my war file jsdg-webapps there is a file:
WEB-INF\classes\com\omh\webapps\WebAppProperties. I put jsdg-webapps.war in \tomcat-home\webapps, and then call:
http://localhost:8080/jsdg-webapps/servlet/com.ohm.webapps.WebAppProperties, but a 404 error showed. I try a few other place, it doesn't work too. Even I unzip the war file to fold jsdg-webapps, it is same result too.

Thank you for your help!


Michelle
Sita Kodali
Ranch Hand

Joined: Dec 02, 2001
Posts: 72
A war (Web archive) file normally is to be placed in <serverroot>/webapps folder. If your server root is /var/www/tomcat, then webapps should be placed in /var/www/tomcat/webapps.
Upon restarting, server will extract war file and creates a dynamic context associated with the war.
You may access newly created context as http://yourservername:yourport/your_war_file
HTH
--
Venkat
Michelle Lee
Ranch Hand

Joined: Jan 23, 2002
Posts: 42
Thank you sita for you answer.
I just did like you say, and put the war in tomcat\webapps\war_file.war.
and access http://localhost:8080/war_file
it just gave me a list of links for html file in the root of war_file.
when I ry to access one of the servlet by:
http://localhost:8080/war_file/servlet/SpecialServlet. It was writing: 404 Not Found.
Any body can give me some advice?
Thank you.
Sita Kodali
Ranch Hand

Joined: Dec 02, 2001
Posts: 72
I guess your url should be http://localhost:8080/servlet/ServletName instead of http://localhost:8080/war_file/servlet/ServletName, coz all the servlets are mapped as /servlet URLs.
Also check web.xml in webapps/war_file_folder/WEB-INF.
HTH
--
Venkat
 
IntelliJ Java IDE
 
subject: where to put war
 
Threads others viewed
How to package a project and install in tomcat webapps?
newbie at JSTL
Problem in placing JSPs in webapps folder
how to use the servlet in tomcat??
WAR file
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com