Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't see web pages or jsp

Status
Not open for further replies.

bthale

Programmer
Oct 31, 2001
108
US
I have Tomcat 5.x installed and it runs fine.I have done a lot of servlet/jsp programming but this one stumps me. Everything is in it's proper path and directories, but when I try to hit the index.html page of my app , I get a blank page. Same thing when I try to hit my servet , just a blank page. Print outs in my code come through to the console, so I know that the servlet is being found, running and not throwing exceptions, etc.
 
How is your servlet writing data back to the browser? Are you printing to the PrintWriter object of the HttpServletResponse?

If you do a view source in your browser, what do you see?
 
I am setting a javabean object in the session, like this
request.getSession().setAttribute("myobject", object);

then I send redirect to jsp page. and retrieve the object from the session.

 
Make sure that after you do the redirect, the doGet()/doPost() method of your servlet does a return. Other wise it will continue to process and could cause problems with the HttpServletResponse object.
 
I added return, but still the same results. I can see the logging output from my servlet inside the tomcat console. I wonder if I am not running 2 instances as Tomcat 5 installs itself as a service. I couldn't find it in the services list.
 
What do you see if you view the source of the blank page? It could be that it did forward to the JSP page, it just that something wrong in the generated HTML code.
 
I checked, and the page seems ok. There must be more than just the jsp because the index.html page doesn't show either, and it just has a hell message. If I send to the servlet from the browser, and use the PrintWriter to output some html code, that works.
 
Can you even view the HTML page without going through the web server, i.e. just open the html file in a browser?
 
Yes, I can view the web page. Believe me. I have checked everything. The servlet is working, as I can reach it, perform business logic and return html using the PrintWriter, but I want to use jsp pages as it is easier to change the html output.

I once had a similar problem with a servlet overriding the service() method, but I am not doing that.
 
Are you doing anything to the response headers within the servlet?

The jsp will take care of setting content type and message length and stuff like that.

If you manually do it in the servlet before forwarding to the jsp, that could cause a problem with the browser presentation.

Do you have a tcp monitor? Using a monitor would let you intercept the response before it gets back to the browser and see the headers and everything else in the message. It might give you a clue as to what's going on.

If you don't have a monitor, there's a simple one in the Apache axis binaries.
I think the axis documentation explains how to use the monitor.
 
Thanks - I'll check into that. The only thing I am doing is putting my Javabean object into the session as an attribute, then forwarding the reponse to the proper jsp page. I know this should work, as I have done it many times before. And I still have the issue of not seeing the index.html page I have in the webapp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top