[JBoss Portal] - Redirect in a PageInterceptor renders the page in background
by staale
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
18Â years, 8Â months
[JBoss Seam] - Classpath location of config files in glassfish projects
by alxs
Hi,
I'm started playing around with Seam 1.2.1.GA and Glassfisch (v2-b57) and I have a question regarding the location of the config files.
I started with a seam-gen generated project and modified it to work with glassfish (added/removed jars, configured web.xml and faces.xml). seam-gen also automatically added drools based security rules and also added the file "security.drl" directly into the EAR.
When I tried to access any page (e.g. /home.seam) I got the following error:
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
| at org.jboss.seam.Component.newInstance(Component.java:1740)
| at org.jboss.seam.Component.getInstance(Component.java:1643)
| at org.jboss.seam.Component.getInstance(Component.java:1610)
| at org.jboss.seam.Namespace.get(Namespace.java:42)
| at javax.el.MapELResolver.getValue(MapELResolver.java:164)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| ...
| Caused by: java.lang.IllegalArgumentException: could not set property value: org.jboss.seam.security.identity.setSecurityRules
| at org.jboss.seam.Component.setPropertyValue(Component.java:1547)
| at org.jboss.seam.Component.initialize(Component.java:1169)
| at org.jboss.seam.Component.instantiateJavaBean(Component.java:1128)
| at org.jboss.seam.Component.instantiate(Component.java:1088)
| at org.jboss.seam.Component.newInstance(Component.java:1736)
| ... 82 more
| Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: RuleBasedIdentity.setSecurityRules(org.drools.RuleBase) with parameters: (org.jboss.seam.drools.RuleBase) on: org.jboss.seam.security.RuleBasedIdentity
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:30)
| at org.jboss.seam.Component.setPropertyValue(Component.java:1543)
| ... 86 more
| Caused by: java.lang.IllegalArgumentException: argument type mismatch
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
| ... 87 more
|
After moving "security.drl" into my ejb-jar file the error disappeard.
So it seems to me as if glassfish won't find any (config)files that are located directly inside the ear since the ear itself is not part of the classpath.
My question here is what the correct behaviour should be? Shold an JEE conform appserver find the file directly inside the EAR (so glassfish has to be fixed) or would it be better to put this and all the other files into an ejb-jar?
And why didn't I get some message like "Could not find /security.drl" but got an java.lang.IllegalArgumentException? Maybe I forgot to (re)configure something else?
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071047#4071047
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071047
18Â years, 8Â months