Win a copy of Terraform in Action this week in the Cloud 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Displaying a .jsp page using Tomcat Server

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I made a "Hello.html" page, and displayed it using the "Tomcat"server using the following URL:

http://localhost:8080/Hello.html

But,when I tried to display the other page (JSP page) that I created which is the "Hello.jsp" page using the following URL:

htt://localhost:8080/Hello.jsp

I got the following error:

HTTP Status 404 - /Hello.jsp

Why am I having this?

Thanks.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where you put that Hello.jsp ? , From the URL it seems that you stored it into webapps/ROOT directory .
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are both Hello.html and Hello.jsp placed in the same directory?
If yes then there should be no problem in accessing the JSP.

Hope this helps
 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is placed in: C:\apache-tomcat-6.0.16\webapps\ROOT
 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed the problem.The "Hello.jsp" file was still in "Notepad" format.

I wrote the script inside "Notepad" and then saved the file as "Hello.jsp",but it remained in "Notepad" format.

How can I obtain the ".jsp" file?
 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Abder-Rahman Ali:
I noticed the problem.The "Hello.jsp" file was still in "Notepad" format.

I wrote the script inside "Notepad" and then saved the file as "Hello.jsp",but it remained in "Notepad" format.

How can I obtain the ".jsp" file?



Notepad format means.. It appears in Notepad icon.. That doesn't mean its in Notepad format(.txt). If you still have doubt then open the file and copy/paste to a new notepad and save it as "Hello.jsp" .. Look at the quotations i used for filename.. You save it with the quotations in the filename..
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I noticed the problem.The "Hello.jsp" file was still in "Notepad" format.


As said by Sagar, merely having a notepad icon does not mean that the file is in notepad(.txt) format.

Check the extension of your file, if it is Hello.jsp.txt, then simply rename it to Hello.jsp.


Hope this helps
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check the extension such:

Click on TOOLS (FILE-EDIT-...-VIEW-TOOLS)
Go to folder options.
Uncheck the option "hide extensions...."

And click on OK.
You'll see the extension of the file, you can rename it.

In future if your jsp pages are being saved as txt,
then,
when you save the file, instead of mentioning the format as .txt, mention it as ALL files.
 
reply
    Bookmark Topic Watch Topic
  • New Topic