• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

browser history problem

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi
this is my problem.
i have a link on my webpage which points to a particular servlet, now if i click on the link i call a javascript function which closes the current window and opens the servlet in a new window. the problem is it gets me the required page from the browser history instead of running the servlet. i want to make sure that everytime that link is clicked the page is fetched from the server instead of the browser history. for some reason i dont want to set the headers cache-control,expires etc.. so is there any other way i can achieve it. plz it is urgent.
Thanx
Padmanabh
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai!
Can u pls send the code u used bcos i tried what u told and servlet in invoking each time...
Rgds
Manohar
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im too having the same problem of clearing the cache all the meta http stuff does not seem to work !!!im too struck , it will be helpful if u guys share the problem with me !!!
 
padmanabh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi
i am using an html to accept some data, then a jsp which puts that data in the session and calls a servlet which displays that data. now unless u clear the "offline contents" from IE, the servlet will not run, and it will show the page from the browser history the code which i have used is as follows.

tmp1.html----------------------
<html>
<body>
<form action="http://localhost:7001/Cyberdrawer/jsp/tmp2.jsp" method="post">
<input type="text" name="data" size="15">
<br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

tmp2.jsp-----------------------
<%@ page language="java"%>
<html>
<body>
<%
String d = request.getParameter("data");
session.putValue("data",d);
%>
<A HREF="#" onClick="window.open('http://localhost:7001/tmp3');" >click here</A>

</body>
</html>
tmp3.java (servlet)----------------------
public class tmp3 extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException
{
System.out.println("tmp3 started");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession(false);
String d = (String) session.getValue("data");
out.println("The value received is : " + d);
System.out.println("tmp3 over");

}
}

i have to use window.open in tmp2.jsp as i want the servlet to start in a new window and i dont want to use set Headers like cache-control etc. in the servlet.
is there any other solution?

Thanx,
Padmanabh

 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

"padmanabh"
your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing
the guidelines at http://www.javaranch.com/name.jsp
thanks for your cooperation.
- satya
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai Padmanabh!
I am unable to understand why ur getting such a problem. Beccause i tries samething(with the code given by u) and evrything is working fine. May be it has something to do with settings...
Rgds
Manohar
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am still getting the same problem. if it has got something to do with the browser's setting, then i still have to find a solution for that. i am using weblogic 5.1.0, which webserver have u used ? is there anything in the server settings which could control this?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic