• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JSP and browser error?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP which uses HTML forms in them. The form's action attribute sends the request to a servlet. This servlet processes the request and sends a response to a DIFFERENT JSP page. I made some changes to my JSP and servlet.
When I reloaded the page, the old versions of the JSP showed up. Why? I saved the jsp, and servlet in the correct directory. I compiled the servlet. But still the old version of the JSP shows up. Why does this happen?
Is it because the cache has versions of the old JSP? How can I correct this? I am using Netscape Navigator v 4.7 as my browser.
Why does it do this? How can I get rid of it?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this would depend on the web server/servlet engine u r using. If it does not support dynamic re-loadng. Are u restarting your webserver ? Which webserver r u using ??
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shuaib,
Are you using the Tomcat container ?
This is a common problem and is indeed because of caching. If you make a minor change to the root of the transaction (which I think would be the form page in this case) then the container should automatically be forced to reload the JSP's as well.
Hope this sorts you. Otherwise - if you are using Tomcat then the cache is somewhere like :
C:\Program Files\jakarta-tomcat-3.2.2\work\localhost_8080<context> where <context> is, strangely - your context.
 
Shuaib Gill
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using Jrun 3.0 on my local machine. I make the changes, complie the .java files, restart the server and hit reload.
Nothing happens. When I changed a servlet to do a simple test, I commented out the RequestDispatcher so it would not forward the response to a JSP.
However I compiled the java program and it still went to the next jsp page upon user request. Why? How can I get rid of caching?
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that this is not a problem with caching. I use Jrun and it works on the same lines as you mentioned without any caching problem. I think the problem might be something like the presence of a duplicate of the .class file in your classpath. Do a check for that.

 
Shuaib Gill
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes I had multiple .class of the same java file, so I got rid of some of the ones I did not need. Well, I keep getting an error on my jsp pages.
When I hit submit from an html form, the servlet does some processing and forwards a response to a 2nd jsp. No prob, so far so good right? Well, when I do the same thing in a new session, the 2nd jsp says error on the browser, why?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Usually this happens because of old JSP classes are not cleared. Changing a JSP should recompile the JSP, but sometimes it helps if you delete the old JSP classes.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic