Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a web instance

Status
Not open for further replies.

md1750

MIS
Apr 18, 2001
80
US
How do I create a web instance.
 
I'm not sure what a web instance is. Do you mean a web application??

If so then in Tomcat's webapps/ directory, create a new directory which be your web application. Under this app directory you also need a /WEB-INF/web.xml. Just use a copy of web.xml file from another web application.

So you have:
/myapp/
/myapp/WEB-INF/web.xml

your jsp files go in /myapp

Best Regards, pfist
 
Hi !!
You have to create a subdir of webapps.
In that subdir you must create a new subdir called WEB-INF in which you put a web.xml file (you can copy it giving a look from the one that is in other contexts like examples) and 2 dubdirs: lib and classes. In lib you will put your .jar files, in classes all your classes that are unpackaged.

Hi and bye [thumbsup2]
 
What if you want this tomcat to contain one-and-only-one web appllication. If you want that application to be right under webapps directory can you simply have
webapps/index.jsp
webaps/WEB-INF folder
Can you put your web application classes (compiled servlets and other classes) in the TOMCATHOME lib directory?

Can anyone tell me if and why this is a BAD organization?

Thank.AA
 
You don't want to put content in the webapps/ directory. I looked at my setup using 4.1.12 and I can't see any reason why you couldn't just put your application in /ROOT web application. Then your application would show up as just as you want.

For my application using the default Tomcat distribution, I got rid of all the directories under webapps/ except ROOT/ and myApp/

( Note: you need to change the conf/server.xml to get rid of references to the examples/ application; or rename server-noexamples.xml.config file to server.xml )

To get to myApp/index.jsp when someone enters I changed the /ROOT/index.jsp as follows:

-------------
<%
response.sendRedirect( &quot;myApp/index.html&quot; );
%>
--------------
This tells the browser to redirect to my application. For my setup, user then sees
Putting the application in /ROOT would get rid of the myApp subdirectory. I don't know if there would be a problem with putting your application as ROOT. I can't see reason why it would be problem.

You could always try it and see what happens. Let me know how it goes.

Regards, pfist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top