This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Facing problem while tomcat 5.5 serves css, and jsp

 
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.





 
Ranch Hand
Posts: 113
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Are you putting your JSP files inside WEB-INF folder or sub-directory inside it?
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 67514
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So why isn't the extra folder named in your URL?
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2268
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it was working properly for two days.
but now it shows same error for "myjsp" directory...
 
Swastik Dey
Bartender
Posts: 2268
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try on an updated version of tomcat.
 
Saloon Keeper
Posts: 23429
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bhagyashri Ajagare Pawar
Greenhorn
Posts: 8
Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there any possibility, that due to tomcat server runs out of memory? if it is what would be the solution?
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic