my dog learned polymorphism*
The moose likes Servlets and the fly likes Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat" Watch "Tomcat" New topic
Author

Tomcat

S Varana
Greenhorn

Joined: Feb 04, 2004
Posts: 18
Hi,
I am new to JSP. Just wanting to get started. I have installed Tomcat 3.1 on my win98 machine. I am able to run the startup and shutdown scripts sucessfully. When I type in http:/localhost:8080, it displays me a tomcat homepage. So far so good. But when I try to execute any of the examples given,I get and error.
I have also created a hello.JSP file and put that into tomcat/webapps/ROOT directory. when I load it using the command http:/localhost:8080/hello.jsp, it shows me the source code along with some extra tags and indentations. I am unable to understand it. I was expecting that when I load this hello.jsp file, 'HELLO WORLD' shows up. Can anyone help me with this, where I am going wrong? I know this is a basic question but I am going nowhere.
I tried going thru previous postings and some of the psotings did help me get this far especially by bill brodgen and others.
Please help.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I would say that the first thing to do is to get all of the examples running, and the first step is to examine this error you are getting.
Tomcat writes System.out stuff to the MSDOS window - are you seeing any exceptions reported there? How about error reports to the log files?
I found out the other day that the MSIE browser has this "Friendly HTTP error" mode that substitutes a MS page for error reports from Tomcat. You can get rid of that from the advanced Internet tools menu.
Bill

S Varana
Greenhorn

Joined: Feb 04, 2004
Posts: 18
Bill, I did the change in settings for disabling friendly HTTP error messages. To explain again:
The error message I get is java.lang.Thread.run(unknown Source) in server window.
I tried with different examples and the latest example which I was running is of creating a hello.jsp file and having the following code in it.
<html>
<body>
<% String visitor = request.getParameter("name");
if (visitor == null) visitor = "World"; %>
Hello, <%= visitor %>!
</body>
</html>
I saved this JSP file in c:\tomcat\webapps\ROOT directory and restarted TOMCAT. When I type http://localhost:8080/hello.jsp I get the following displayed in browser. Note that The line above the tag </BODY> is missing.
<HTML>
<BODY>
<% String visitor = request.getParameter("name");
if (visitor == null) visitor = "World"; %>
</BODY>
</HTML>
Like I said earlier, I fail to undertand why the source is getting displayed. Am I going wrong somewhere? Please help...
S Varana
Greenhorn

Joined: Feb 04, 2004
Posts: 18
Just want to add that Netscape displays back the above code while MSIE does not display anything. When I do a right click and view source I get the above. Thanks.
S Varana
Greenhorn

Joined: Feb 04, 2004
Posts: 18
hello all,
when i try to run a JSP page from the browser, the contents inside <% and %> are not getting displayed. It seems the JSP tags are ignored while all other plain HTML output gets displayed in the page. Can someone help me with this.
Thanks.
 
wood burning stoves
 
subject: Tomcat
 
Similar Threads
Testing of html and jsp using tomcat 5.0.16
Tomcat Installation
Tomcat 3.2.3 and JSP -- Please help
Directory Structure for JSP
to display perticular file