aspose file tools*
The moose likes Servlets and the fly likes browser history problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "browser history problem" Watch "browser history problem" New topic
Author

browser history problem

padmanabh
Greenhorn

Joined: Jul 30, 2001
Posts: 6

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
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hai!
Can u pls send the code u used bcos i tried what u told and servlet in invoking each time...
Rgds
Manohar
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
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 !!!


SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
padmanabh
Greenhorn

Joined: Jul 30, 2001
Posts: 6

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

Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

"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

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
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
padmanabh dongre
Greenhorn

Joined: Aug 13, 2001
Posts: 24

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?
 
 
subject: browser history problem