You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/11/08 03:07:10 UTC

T5: @Injectpage and ajax

Hi,

I have this problem 
http://www.nabble.com/T5%3A-why-this-not-working-in-IE--tf4759162s302.html
why-this-not-working-in-IE , took quite a long time to find a fix to this:

if you inject a page and return as object to a xmlhttprequest, it works in
Safari, Firefox but not in IE, IE works only the first time, succeeding
request will return the old page:(, but if the object is returned to a
regular http request, every  browser works. to make it working in all
browsers, return a Link, passing anything as parameter of onActivate event.
or better avoid @InjectPage totally so all your page will be ready for ajax
call. my test is only limited to jQuery's ajax, maybe I'm wrong.

A.C.
-- 
View this message in context: http://www.nabble.com/T5%3A-%40Injectpage-and-ajax-tf4768575.html#a13640034
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: @Injectpage and ajax

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Lococode,

Looks a good solution, will give it a try.


Lococode wrote:
> 
> Tty this filter:
> 
> import java.io.IOException;
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-%40Injectpage-and-ajax-tf4768575.html#a13647997
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: @Injectpage and ajax

Posted by Lococode <gu...@gmail.com>.
Tty this filter:

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.filter.GenericFilterBean;

/**
 *
 */
public class IENoCacheFilter extends GenericFilterBean implements Filter {

	protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response, FilterChain filterChain) throws IOException,
ServletException {
		if (AgentUtils.isInternetExplorer(request)) {  // is ie ?
			response.setHeader("Pragma", "No-cache");
			response.setHeader("Cache-Control", "no-cache");
			response.addHeader("Cache-Control", "no-store");
		}

		filterChain.doFilter(request, response);
	}

	public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
		doFilterInternal((HttpServletRequest) request, (HttpServletResponse)
response, chain);
	}
}


Angelo Chen wrote:
> 
> Hi,
> 
> I have this problem 
> http://www.nabble.com/T5%3A-why-this-not-working-in-IE--tf4759162s302.html
> why-this-not-working-in-IE , took quite a long time to find a fix to this:
> 
> if you inject a page and return as object to a xmlhttprequest, it works in
> Safari, Firefox but not in IE, IE works only the first time, succeeding
> request will return the old page:(, but if the object is returned to a
> regular http request, every  browser works. to make it working in all
> browsers, return a Link, passing anything as parameter of onActivate
> event. or better avoid @InjectPage totally so all your page will be ready
> for ajax call. my test is only limited to jQuery's ajax, maybe I'm wrong.
> 
> A.C.
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-%40Injectpage-and-ajax-tf4768575.html#a13646309
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org