Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WAR file structure

 
surya sudhakar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to JSP, I have read that usually the web applications will be deployed using WAR(Web Archive file). As I know the directory structure is as follows.
exampleapp/
/WEB-INF
/Classes
/Lib
/tlds
The structure doesn't tell where to put the resources like .gif, .jpg etc,.
If this is right,
each container vendor follows his own way of understanding the WAR then how the resources will be read and put in jsps. I mean if I put the resources (Tomcat is putting resources in directory called "images")in some directory called "resources" in the application root directory how to tell the container to get the resources from that directory. In such cases how to make sure that(as a web application developer) my appllication(WAR) run on every container in world.
Thanx in advance
Sudhakar
 
Irene Loos
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP is compiled on server side and not on the client. All you need to worry about that the pass to your resources is correctly specified in your jsp, since you will deploy your resources with your jsp and java code.
[ June 12, 2002: Message edited by: Irene Loos ]
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put all the public resource i.e. html,images,jsp etc at the top level of the web app directory structure. By convention we create a directory called as images under this top level directory structure and put all .gif there.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Put all the public resource i.e. html,images,jsp etc at the top level of the web app directory structure. By convention we create a directory called as images under this top level directory structure and put all .gif there.

Yup -- it doesn't matter where you put the images -- as long as you don't put them in the /WEB-INF directory. 'cause anything in that directory will not be served up by your application server.
 
surya sudhakar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys, got clarified.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic