[jboss-dev-forums] [Design of JBoss Portal] - Redirect in a PageInterceptor renders the page in background

staale do-not-reply at jboss.com
Thu Aug 9 05:22:39 EDT 2007


I tries posting this question in the jboss forum - but didnt get any replies. So ill try here as well:

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. 

Code:

  | 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=4072387#4072387

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




More information about the jboss-dev-forums mailing list