You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alan Zaitchik <al...@convergentlearning.com> on 2001/08/06 22:47:56 UTC

Deploying .war file

I know this should be trivial but it is just not working for me... I have a
(Tomcat 3.2.3) application consisting of various html and jsp and tld files
currently under \webapps\alan\app1. The tags refer to handlers and tei files
in \webapps\WEB-INF\classes\alan\app1. The web.xml file in \webapps\WEB-INF
does not refer to any of these elements at the moment. Everything works just
fine.

I want to create an app1.war file for all the above which can be deployed
somewhere else entirely, say c:\bob. According to what I read in various
places, all I need to do is create a web.xml file that adds a <servlet> tag
for the jsp files (using <jsp-file> rather than <servlet-class>), create an
app1.war file using the jar utility, and add a <context> block to server.xml
to define a virtual path to c:\bob\app1.war. I did all these but Tomcat
(after restart) cannot find my jsp files.

I believe I must be specifying something incorrectly. Would the context
block be something like:
<context path="/whatever" docBase="c:\bob\app1.war" crossContext="false"
debug="0" reloadable="true" trusted="false">
Also, in the original location I pointed my browser at alan1/app1/fu.jsp and
Tomcat found the files easily (since they were under webapps). Is it enough
to just add to the web.xml file blocks like
<servlet><servlet-name>fu</servlet-name><jsp-file>fu.jsp</jsp-file>
or must I add something else to web.xml?
Perhaps the problem is in the URL I type into the browser address?? Should
it be http://host/whatever/fu or http://host/whatever/fu.jsp or
http://host/whatever/alan/app1/fu.jsp
where "/whatever" is the virtual path to c:\bob\app1.war defined in
server.xml? Actually I tried all these (and other combinations) but without
luck...
Please excuse the simplicity of this question but I just cannot seem to get
the war file working.

Alan