• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set up new WEBAPPS  RSS feed

 
Nick Delauney
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
May be a very foolish question, but currently I do all my work out of the examples folder of tomcat jsp (http://localhost:8080/examples/jsp/). Does anyone know how to set up a new webapp. If its to much to explain. Does anyone know of websites that can explain Administrative steps like this one and what certain folders and files are used for (ie, WEB-INF, etc...).
Thanks,
 
Joe Broderick
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to have the correct file structure in order for tomcat to display your webapps. The easiest way to do this is just make a new folder under webaps, and copy the web-inf folder to it. The web.xml document tells tomcat lots of information it needs in order to display your webpages. For example, if you wanted to restrict your website with a password, the web.xml file would be responsible for that. So if tomcat can not find the web.xml file in your directory, it will not allow that directory to be published to the web. The directory structure is important, so make sure you follow how the root directory is structured, paying attention to the placement of the web-inf folder, the classes folder, and the web.xml document.
I hope that anwsers your question.
[ April 26, 2003: Message edited by: Joe Broderick ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Often you also need to add some entry to some configuration file of the web container in order to inform it about the existence of the new webapp you're creating. The best way is DIBE (do-it-by-example).
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Download the servlet API document (in .PDF) from java.sun.com for a really detailed explanation of what it takes to set up a new web application.
Bill
 
Scott Hutchings
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought a reference from a popular JSP book might help. The following discusses the structure that is found in the webapps folder.
From JSP 2nd Edition, 2001 Wrox Press, pg 29:
"Fortunately, the Servlet speciifcation dictates a configuration standard that all Servlet containers must support. This standard includes the following structure:
Path: /
Explanation: The root directory of the web application. All static resources and JSP's are placed here. These public resources are typically directly available to web clients. (However, I've seen lots of examples where JSP's are in the path: /jsp/example.jsp)
Path: /WEB-INF/web.xml
Explanation: This is known as the deployment descriptor, which contains various configuration options for the web application. all files contained in /WEB-INF/ and its subdirectories are not directly accessible by web clients.
Path: /WEB-INF/classes
Explanation: All class files, such as Servlets or JavaBeans, are placed in this directory
Path: /WEB-INF/lib/
Explanation: JAR files can be placed here, and they will be automatically included in the web application's CLASSPATH.
A sample web application might consist of the following files
/index.html
/contactus.html
/status.jsp
/images/us.jpg
/WEB-INF/web.xml
/WEB-INF/lib/framework.jar
/WEB-INF/classes/com/ourcompany/MainServlet.class
/WEB_INF/classes/com/ourcompany/util/Util.class"
Adios
Scott

Path:Path:Path:Path:Path:
[ April 27, 2003: Message edited by: Scott Hutchings ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!