Must i place all my class files in the WEB-INF folder and all JSP's outside?

Please answer this

Showing Answers 1 - 7 of 7 Answers

Mohammed Fazuluddin

  • Sep 14th, 2005

The class files should place into WEB-INF/classes folder and the JSP filese should place within a separate folder.

  Was this answer useful?  Yes


  • Sep 30th, 2005

Yes! Otherwise the web server/ application server cannot access the .jsp files and classes.

 The java class files can be placed either in WEB-INF/lib or WEB-INF/classes. But it is recommended to put the source in WEB-INF/classes. The server will load the files from the classpath so it just will not matter where the class is.

  Was this answer useful?  Yes


  • Oct 8th, 2005

yes, class files is private resources, so u must store class in WEB-INF/classes folder.

  jsp and HTml files u placed in your current folder ie outside.



  • Oct 8th, 2005

Class file inside web-inf cannot be access by browsers,while the jsp files are meant for accessible by browsers so,it may be strictly place outside the web-inf only

  Was this answer useful?  Yes


  • Oct 11th, 2005

Here is structure of web app.

web (this folder is Assecible from www)

  store all your jsp html here

   WEB-INF (this folder is not Accecible )

         classes (store your classes here, clases you are using in jsp

         lib   (store 3rd party jars)

  Was this answer useful?  Yes


  • Oct 14th, 2005


  Was this answer useful?  Yes

Navjot Singh Sohanpal

  • Mar 16th, 2006

1. class files - Either they must be in WEB-INF\classes directory OR you can package them as JAR and put in WEB-INF\lib

2. JSP files - Depends how do you design your arch. If you have controller/delegator that can forward requests to JSPs, you can keep them under WEb-INF directory also. If not, you have to keep them outside WEB-INF.


Navjot Singh

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions