Discussions

Web tier: servlets, JSP, Web frameworks: Blank JSP pages when clicking a hyperlink

  1. Blank JSP pages when clicking a hyperlink (3 messages)

    This might sound crazy! I cannot seem to get hyperlinks which link jsp's together to work. If I click a hyperlink in a jsp page it will display a blank page. The coding in the jsp page must be good because if I load the jsp page individually, it works. What is also weird is that it worked just yesterday, now always get blank pages.

    The relative urls are ok because all of my jsp files are in the same folder (JSP). By the way, I am using Tomcat 3.2.1. I changed my JSP file into a html file (put all the java code in comments) and the link worked. It is weird because I have almost no java code in the JSP, only this

    <%
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
    %>

    to fix the caching problem. I believe the JSP files are ok because if I enter the complete URL code in the browser I see the JSP page. Please help before I go mad!

    Thanks again
  2. Weird.
    Just to be sure the no-cache stuff is working (there are browser-specific problems with this sometimes),
    have you tried clearing out your browser cache?
    Maybe:

    1) Typing the URL in the location bar doesn't use the cache
    and
    2) Your link is relative or otherwise slightly different than typing it in the location bar,
    and
    3) Sometime went wrong one time when you clicked,
    and
    4) The black document has been cached by the browser and
    is shown whenever you click your link.

    Just a thought?
  3. In English this time[ Go to top ]

    1) Typing the URL in the location bar gives you one document
    2) Your hyperlink is relative or otherwise slightly different from typing it in the location bar, and for caching purposes, is treated as a different document.
    3) SomeTHING went wrong one time when you clicked the hyperlink,
    4) The blank document from that problematic execution has been cached by the browser and is now shown whenever you click your link.

    Sorry about the sloppy typing.
    Clear the browser cache and see if it goes away.
  4. Boss,

    see to that you have included

    response.setContentType( text/html);

    in your code . It will display the JSP definitely. I had the same problem and it was displaying in the view source code format.

    Prasath


    bp8475@sb.com