Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying a .jsp page using Tomcat Server

 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • 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.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where you put that Hello.jsp ? , From the URL it seems that you stored it into webapps/ROOT directory .
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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?
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • 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: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
 
Soniya Ahuja
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic