aspose file tools*
The moose likes JSP and the fly likes Simple JSP problem !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Simple JSP problem !!" Watch "Simple JSP problem !!" New topic
Author

Simple JSP problem !!

Saurabh Agrawal
Ranch Hand

Joined: Oct 07, 2003
Posts: 244
Hi friends ,

I have some simple enough problem which i would like to highlight you guys.

Well i have simple written a simple jsp by the name first.jsp and i am putting this page in webapps in folder JSP in tomcat.Now when i run it it says - resource not available..but if i create a directory in JSP by the name WEB-INF this example runs.So can anyone tell me is it compulsory to have WEB-INF folder in the tomcat ?? I dont think it is necessary to have WEB-INF in case of JSP.

Please comment on that..
Also let me the know some good tutorial link for JSP.
Thanks,
Saurabh


Success is not doing extraordinary things but doing ordinary things extraordinarily well.
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
A web application is deployed using the war file. See the structure of war file a WEB-INF folder is required in that.
Saurabh Agrawal
Ranch Hand

Joined: Oct 07, 2003
Posts: 244
Hello ali,
I could not really get your reply.Well i have tried earlier also without WEB-INF and the application worked as well.So i dont think thyat it is necessary to have WEB-INF folder.
Also tell me which war file to look at .
Thanks for help,
Saurabh
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
To have a webapp you need a WEB-INF folder containing a web.xml file.
I'm not certain whether such is required when using ONLY JSPs but I think it is.

Using a WAR file for deployment is definitely NOT required, it's just a handy mechanism for distribution.

What URI are you using to try to access the JSP?


42
Saurabh Agrawal
Ranch Hand

Joined: Oct 07, 2003
Posts: 244
Originally posted by Jeroen Wenting:
To have a webapp you need a WEB-INF folder containing a web.xml file.
I'm not certain whether such is required when using ONLY JSPs but I think it is.

Using a WAR file for deployment is definitely NOT required, it's just a handy mechanism for distribution.

What URI are you using to try to access the JSP?


Thanks jeroen.Well the URI i am using to access the JSP page is :
http://localhost:8080/JSP/first.jsp

Since my JSP folder is in webapps .
still i am not satisfied whether or not to have WEB-INF incase of JSP .. i know it is must in servlet deployment.
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Just think like that you will need web.xml when you will try to map your servlet with any URL. Suppose you want to access you first.jsp as /my/page then in this case you will have to map your first.jsp page to /my/page.
Saurabh Agrawal
Ranch Hand

Joined: Oct 07, 2003
Posts: 244
Hello ali,
Thanks for ur reply but what you said is the use of web.xml and that too in the scenario when i want to have a mapping for a particular URL but i dont want that .. ten still is it compulsory to have WEB-INF folder hierarchy... i think noone has really given me the answer i am looking for ..

Thanks anyways,
SAurabh
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Well i have tried earlier also without WEB-INF and the application worked as well.So i dont think thyat it is necessary to have WEB-INF folder


If it worked then its alright don't put make that WEB-INF folder. But if you think somewhat practically then i think you will need all those beans and servlets and other things in your web application. In that case WEB-INF is required.
So if its working without WEB-INF in your case then it means you can do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple JSP problem !!