This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes Displaying a .jsp page using Tomcat Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Displaying a .jsp page using Tomcat Server" Watch "Displaying a .jsp page using Tomcat Server" New topic
Author

Displaying a .jsp page using Tomcat Server

Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

Where you put that Hello.jsp ? , From the URL it seems that you stored it into webapps/ROOT directory .


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
It is placed in: C:\apache-tomcat-6.0.16\webapps\ROOT
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
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

Joined: May 29, 2008
Posts: 445

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..


Never try to be a hard-worker. Be a smart-worker.
My Blog
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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

Joined: Jul 20, 2008
Posts: 83
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.


SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
http://soniyaahuja.webs.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying a .jsp page using Tomcat Server