aspose file tools*
The moose likes Tomcat and the fly likes Problem in placing JSPs in webapps folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem in placing JSPs in webapps folder" Watch "Problem in placing JSPs in webapps folder" New topic
Author

Problem in placing JSPs in webapps folder

Balaji
Greenhorn

Joined: Oct 16, 2003
Posts: 5
Hi,

I prepared a project prototype is some jsps. These jsps contains bean tags also. These jsps I prepared using JBuilder and configured Tomcat 4.1 as the server. I need to show these jsps to client. I installed Tomcat 4.1 in client's system and placed the jsps folder in webapps folder of tomcat. After starting the tomcat server, when I browsed for the pages, I am getting page not found exception. Could anyone give me a solution for this problem?

Thanks in advance,
Balaji
Angel Dobbs-Sciortino
Ranch Hand

Joined: Sep 10, 2003
Posts: 101
Try putting the JSPs in webapps/ROOT.
Carl Sampson
Greenhorn

Joined: Apr 09, 2003
Posts: 22
The JSP's need to go in a web application within the webapps folder. webapps/ROOT is where to put them if you want to access them via just hitting the tomcat server like this-

http://localhost:8080/mypage.jsp

Otherwise create a subdirectory under webapps that has your jsp's, taglibs, etc in the standard j2ee webapp structure or create that structure elsewhere, war it up, and put the war file in webapps.
Balaji
Greenhorn

Joined: Oct 16, 2003
Posts: 5
Thanks Sampson and Sciortino,

I created a seperate folder in webapps folder and placed all my jsps. I accessed the page with proper path such as
http://localhost:8080/intranet/LoginPage.jsp where intranet is the folder under webapps folder. But I am getting error as Page not found. This page contains <bean:include> tags, does this tag needs any specific tag library or will it work without tag libraries?

Thanks in advance,
Balaji.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome back to JavaRanch, Balaji!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

We request that display names follow the pattern FIRST_NAME + SPACE + LAST_NAME.

Thanks Pardner! Hope to see you 'round the Ranch!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Balaji:
Thanks Sampson and Sciortino,

I created a seperate folder in webapps folder and placed all my jsps. I accessed the page with proper path such as
http://localhost:8080/intranet/LoginPage.jsp where intranet is the folder under webapps folder. But I am getting error as Page not found. This page contains <bean:include> tags, does this tag needs any specific tag library or will it work without tag libraries?

Thanks in advance,
Balaji.


This tag is member tag of Struts,

So you can see more detail at :::

http://struts.apache.org/doc-1.0.2/struts-bean.html


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Ramesh Shanmugam
Ranch Hand

Joined: Sep 13, 2004
Posts: 132
place all the pages under the Examples folder like

tomcat/webapps/examples/abcd
Here abcd is your folder

And access the page as http://localhost:8080/examples/abcd/sample.jsp
and try this..


Ramesh Shanmugam - SCJP 1.5
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
at the same place where you put your .jsp file, add another file (html, xml, css) or whatever and try to access that. If that works, then you know at least the path is correct.


swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Carl Sampson
Greenhorn

Joined: Apr 09, 2003
Posts: 22
It looks like that problem is not related to using the Struts custom-tag. But for future reference you do need to add the directive to the page to reference the tag as well as a reference to it in web.xml.

As for this problem, try putting another file in there that is static (html, image, etc) and hitting that. Or try just browsing the directory.
lesley evensen
Greenhorn

Joined: Nov 02, 2001
Posts: 14
Perhaps a simplistic question, but did you try compiling your jsp before deploying it? If you did then the issue of including the tag library would be surfaced. You can probably test the path as others suggested, putting just an .html page under /intranet and browsing to it.
You should also deploy the library/ies your page is dependent on (maybe you already know that!)


<A HREF="mailto:zorgalina@minspring.com" rel="nofollow">zorgalina@minspring.com</A>
 
Consider Paul's rocket mass heater.
 
subject: Problem in placing JSPs in webapps folder