Solved

JSP not refreshing in Tomcat 5.5

Posted on 2004-10-31
492 Views
Last Modified: 2008-02-01
I am using Tomcat 5.5. I am putinng my JSPs on that server. Whenever I am changing my old JSP with new ones, its not (infact most of the time) always guaranteed, that my browser will show the content of new jsp(though I am cleaning my browser cache). I have to manually clean servlet classes generated by tomcat for jsp. Is there any workaround ? or any setting I nead to change, so that it autorefresh the content of my new JSP.

0
Question by:hwssoft
    5 Comments
     
    LVL 19

    Accepted Solution

    by:
    check  your conf/web.xml file. In that file find JspServlet definition:
        <servlet>
            <servlet-name>jsp</servlet-name>
            <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
            <init-param>
                <param-name>fork</param-name>
                <param-value>false</param-value>
            </init-param>
            <init-param>
                <param-name>xpoweredBy</param-name>
                <param-value>false</param-value>
            </init-param>
            <load-on-startup>3</load-on-startup>
        </servlet>

    check that there is no
            <init-param>
                <param-name>reloading</param-name>
                <param-value>false</param-value>
            </init-param>
    defined.
    Put that parameter to true.
    0
     

    Author Comment

    by:hwssoft
    I checked, following lines were not there in conf/web.xml under <servlet-name>jsp</servlet-name> dection
    <init-param>
                <param-name>reloading</param-name>
                <param-value>false</param-value>
    </init-param>

    But I am still facing the same problem.
    0
     
    LVL 23

    Expert Comment

    by:rama_krishna580
    HI,

    Tomcat sucks when it comes to include files. The problem is that Tomcat doesnt keep track of include file dependencies. However, a good alternative to this is to use the <jsp:include /> tag that is standard in all Java Web Servers.  This will only work if you have to include STATIC Files. It doesnt work like "<%@ include"does for Dynamic includes.

    <%@ tags are by definition, compiler directives... So they get included at compile time. So if you had any jsp code in the included file, that gets compiled too.

    However, <jsp:include> is a runtime include tag, which just attaches the file to the ouput. And this should be perffffect for your HTML include.

    Hope this helps.

    R.K
    0
     

    Author Comment

    by:hwssoft
    But I am not changing anything in include file, I just want to reflect changes, what I have done in my main jsp page. Currenlty I have to remove the classes generated for that page manually.
    0
     

    Author Comment

    by:hwssoft
    Probably, these points should be rewarded to me itself :)  I have got the problem. My server is in remote location, acoording to time zone difference though it should be around 10 hours back, it time is few hours ahead of my computer.  When ever I am using "SSH (Secured shell transfer client) in windows env." client to copy my jsp on this server,  modified time remains same as of my computer. The compile time of previously generated class file is most of the time ahead of the new copied jsp. Due to which server doesn't compile the new jsp again.

      I will reward these points to anybody, who can help me in using "SSH (Secured shell transfer client)" client, such that modified time of newly copied jsp should be that of server, whenever it is copied to remote server. Version of  "SSH (Secured shell transfer client)" is 3.2.0.  May be any setting in the client should do. This should happen without disturbing time of either my p.c. or remote server.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
    Easy CSR creation in Exchange 2007,2010 and 2013
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now