File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes sendRedirect() not working in IE6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "sendRedirect() not working in IE6.0" Watch "sendRedirect() not working in IE6.0" New topic
Author

sendRedirect() not working in IE6.0

Mayur Joshi
Greenhorn

Joined: Feb 19, 2009
Posts: 6
Hi,

In my application I have a page that builds a query and once executed shows the results. There are 2 buttons "View all records" and "Edit query". I'm using sendRedirect to another url once those buttons are clicked. It works in all browsers except IE6. In IE6 the same page is refreshed and the redirect fails. Can anyone help me figuring out what the problem is with sendRedirect and IE6?

Thanks,

Mayur
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Hi,

Can you post some code please.


Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Mayur Joshi
Greenhorn

Joined: Feb 19, 2009
Posts: 6
Here is the code that is called when you press the "Edit Query" button.

public void editQuery() throws IOException
{
String url = request.getContextPath() + "/search.jsp";
url = response.encodeRedirectURL(url);
//url = response.encodeURL(url);
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "1");
response.sendRedirect(url);

}

I added the setHeader() functions as a solution from some other forum for IE6 but with or without those functions it doesn't work. The same page is refreshed on clicking the button.

Thanks,
Mayur
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mayur Joshi
Greenhorn

Joined: Feb 19, 2009
Posts: 6
Mayur Joshi wrote:Here is the code that is called when you press the "Edit Query" button.


I added the setHeader() functions as a solution from some other forum for IE6 but with or without those functions it doesn't work. The same page is refreshed on clicking the button.

Thanks,
Mayur
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sendRedirect() not working in IE6.0
 
Similar Threads
SendRedirect and session
Browser for internet..
Modal Window showing the dropdown of parent window
http redirect problem with addfavorite
JS Error ACCESS IS DENIED when submitting the form in jsp file through javascript