aspose file tools*
The moose likes Tomcat and the fly likes Facing problem while tomcat 5.5 serves css, and jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Facing problem while tomcat 5.5 serves css, and jsp" Watch "Facing problem while tomcat 5.5 serves css, and jsp" New topic
Author

Facing problem while tomcat 5.5 serves css, and jsp

Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

Dear all members

Currently I have purchase one domain name and virtual dedicated server(Linux - Red hat fedora). I am using java and tomcat 5.5 on that server.
The problem I am facing is tomcat shows 404 error (description: The requested resource (/mytestpage.jsp) is not available.).
Is there any settings I require to view css and all jsp and html pages, Because when I installed tomcat it shows prper installetion and display tomcat default page properly.





Souvik Dasgupta
Ranch Hand

Joined: Sep 24, 2009
Posts: 77


Are you putting your JSP files inside WEB-INF folder or sub-directory inside it?


Thanks and Regards, Souvik
SCJP, SCWCD, OCEJWSD
Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

My directory structure is like

Tomcat-5.5/webapps/ROOT/WEB-INF
Tomcat-5.5/webapps/ROOT/extra/css
Tomcat-5.5/webapps/ROOT/extra/images
Tomcat-5.5/webapps/ROOT/extra/js


My all JSP and html pages are inside ROOT directory
My css, images, js are inside extra/css, extra/images and extra/js directory resp.

my web.xml file is inside WEB-INF directory.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

So why isn't the extra folder named in your URL?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

Actually extra is a one of the directory where I put my all files which I am using in JSP and html pages.
e.g.


Also here I try both href="/extra/css/style.css" and href="extra/css/style.css"

And about other jsp pages like mytestpage.jsp, which I put inside ROOT directory directly.

Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

I have also tried to change default 8080 port to 8081, but same problem is happen with 8081.
Please some one help me... It's urgent...
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

so there is a file called Tomcat-5.5/webapps/ROOT/mytestpage.jsp and when you enter http://localhost:8080/mytestpage.jsp into a browser, you get a 404 page?
Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

Yes Exactly happend same.
Even though for any jsp or html file other than index/default.jsp/html inside my ROOT directory, is showing error 404.
Also it will not link up with css file, images, or javascript files.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1400
    
    6

Instead of keeping under ROOT, does it work if you put the files under some other directory, and access it through that?

for e.g. localhost:8080/mysite/mypage.jsp?


Swastik
Eswar Nec
Ranch Hand

Joined: May 02, 2010
Posts: 105
Hi Bhagyashri,

Try this,

webapps/myjsp/mytestpage.jsp

webapps/myjsp/extra/images/sampleImage.jpg

webapps/myjsp/extra/css/sample.css

webapps/myjsp/extra/js/sample.js

mytestpage.jsp


And http://localhost:8080/myjsp/mytestpage.jsp


Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

Thanks Eswar Nec and Swastik Dey. Using another directory resolve my problem. But let me know why this happening? I mean what is the reason behind this?

Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

it was working properly for two days.
but now it shows same error for "myjsp" directory...
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1400
    
    6

Try on an updated version of tomcat.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15665
    
  15

There are 2 reasons why I don't like to put webapps under ROOT.

1. There can be only 1 root webapp per host, and Tomcat is designed to contain multiple webapps. And my servers generally do so.

2. Tomcat is already shipped with its own root app. It does take a little bit of tweaking to replace it with another app.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bhagyashri Ajagare Pawar
Greenhorn

Joined: Apr 08, 2011
Posts: 8

is there any possibility, that due to tomcat server runs out of memory? if it is what would be the solution?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
It is highly unlikely that this is a memory problem, but if it is, then you should at the least see some error messages in the log files. You should the log files regardless - there may be other problems.

It is also highly unlikely that Tomcat needs to be upgraded to a newer version (as was suggested earlier in this thread); Tomcat 5.5 works fine.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Facing problem while tomcat 5.5 serves css, and jsp
 
Similar Threads
Not able to execute a sample jsp file
Spring / Tiles 2 example
use JNDI of WAS 6.1 in standalone application
Tomcat restarting again and again automatically
Exploded War in the webapps folder is missing