• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Set up new WEBAPPS

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic