[jboss-user] [JBoss Portal] - Redirect in a PageInterceptor renders the page in background

staale do-not-reply at jboss.com
Mon Aug 6 04:38:49 EDT 2007


Hi

Im using jboss portal 2.2.2 with jboss as 4.0.4 GA on a debian linux server. 
We are using a PageInterceptor to switch pages from http to https, so we dont have to rewrite all urls. 
The property to make a page https is written in a page attribute.

When the request hits the PageInterceptor we check if the request should be secure or not - and do a redirect to a secure or no-secure url if it is of the wrong type.

All this is good, and it seems to work perfectly. But i see from the logs - that when i do a redirect in the PageInterceptor - the request is being ran anyway.

Here is a snip of code that runs in the PageInterceptor.


  | final String hostName = getRedirectHost(viaHeaderField, httpRequest.getServerName(), false);
  | final String redirectURL = createRedirectURL(httpRequest, PROTOCOL_HTTP, hostName);
  | sendRedirect(pageInvocation, redirectURL);
  | pageInvocation.invokeNext();
  | 

What I could use is a command to stop rendering the page in the pageInterceptor, but if i dont call pageInvocation.invokeNext(); the portal fails.

Can anyone help me ?

Regards,
Ståle

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071061#4071061

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071061




More information about the jboss-user mailing list