Confused about JSP-only WAR file

O

ohaya

Hi,

I am trying to create a JSP-only WAR file "manually", and have some
questions.

I am first creating a directory structure as follows:

e:\work

e:\work\myjspapp
- foo1.jsp
- foo2.jsp

e:\work\myjspapp\images
- a bunch of image files used by JSPs

e:\work\myjspapp\WEB-INF
- web.xml



The web.xml file contains:

<?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>
<servlet>
<servlet-name>foo1</servlet-name>
<jsp-file>foo1.jsp</jsp-file>
<servlet-name>foo2</servlet-name>
<jsp-file>foo2.jsp</jsp-file>
</servlet>
<display-name>MyJSPApp</display-name>
<description>This is my JSP Appplication</description>
<welcome-file-list>
<welcome-file>foo1.jsp</welcome-file>
</welcome-file-list>
</web-app>


I guess that my first question is: Does the above structure and does
the web.xml look all right?


Assuming that it is, do I:

1) cd e:\work, then
jar cvf myjspapp.war myjspapp

OR

2) cd e:\work\myjspapp, then
jar cvf myjspapp.war *

OR

Something else?

Sorry if this might be a silly question, and thanks for your patience,
but I'm in a situation that I'm having to build the WAR "by hand"...

Thanks,
Jim
 
A

alchemist

whatever you are trying to do seems right.
just one thing, zip the files and rename it as .jar. it will do.
 
O

ohaya

alchemist said:
whatever you are trying to do seems right.
just one thing, zip the files and rename it as .jar. it will do.


alchemist,

You didn't quite answer my question, but FYI, I was able to get it
working today using #2...

Thanks,
Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top