集成JSF1.2和;春季安全
我在我的JSF1.2项目中实现了spring安全性。这在JBoss 5.0.1中成功部署,但当我尝试访问我的应用程序的登录页面时,它给了我以下异常集成JSF1.2和;春季安全,jsf,spring-security,Jsf,Spring Security,我在我的JSF1.2项目中实现了spring安全性。这在JBoss 5.0.1中成功部署,但当我尝试访问我的应用程序的登录页面时,它给了我以下异常 Caused by: java.lang.IllegalArgumentException: FacesContext must not be null at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.web.jsf.FacesCon
Caused by: java.lang.IllegalArgumentException: FacesContext must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.web.jsf.FacesContextUtils.getWebApplicationContext(FacesContextUtils.java:50)
at org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(FacesContextUtils.java:81)
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getWebApplicationContext(SpringBeanFacesELResolver.java:91)
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getBeanFactory(SpringBeanFacesELResolver.java:79)
at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:50)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
从这个跟踪中,我猜测一些Springbean如何在初始化之前尝试使用faces上下文
以下是我的项目结构:
MyEar
|-- lib\ (contains all spring security jar files)
|
|
|-- myWar
|-- META-INF/MANIFEST.MF (entries for spring security jars)
|
|-- WEB-INF
|-- applicationContext.xml
|-- lib\ (local jar files jsf,facelets etc)
这里有一件很重要的事情需要提及,我希望我的所有spring securities jar都在ear的lib目录中,当我将我的所有spring securities jar直接放在ear(earcontent)而不是lib目录下时,不会发生这种异常
请告诉我这是否是我的项目结构的问题
更新:以下是我的清单内容:
Manifest-Version: 1.0
Class-Path: lib/aopalliance-1.0.jar
lib/mysql-connector-java-5.1.7-bin.jar
lib/org.springframework.aop-3.0.5.RELEASE.jar
lib/org.springframework.asm-3.0.5.RELEASE.jar
lib/org.springframework.beans-3.0.5.RELEASE.jar
lib/org.springframework.context-3.0.5.RELEASE.jar
lib/org.springframework.core-3.0.5.RELEASE.jar
lib/org.springframework.expression-3.0.5.RELEASE.jar
lib/org.springframework.transaction-3.0.5.RELEASE.jar
lib/org.springframework.web-3.0.5.RELEASE.jar
lib/spring-security-config-3.0.5.RELEASE.jar
lib/spring-security-core-3.0.5.RELEASE.jar
lib/spring-security-taglibs-3.0.5.RELEASE.jar
lib/spring-security-web-3.0.5.RELEASE.jar
以下是web.xml条目的某些部分:
<!-- Delegating to a Spring-managed bean that implements the Filter interface -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetBean</param-name>
<param-value>filterChainProxy</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
目标豆
过滤链氧
springSecurityFilterChain
/*
向前地
要求
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.jsf
由FacesServlet
创建FacesContext
。因此,当它为null
时,表示您没有调用FacesServlet
。您需要确保浏览器请求URL与您在web.xml
中定义的FacesServlet
的
匹配
例如,如果是
<url-pattern>*.jsf</url-pattern>
*.jsf
然后,您需要确保按照以下方式调用登录页面:
因此,不作为
你能发布你的
MyEar/myWar/META-INF/MANIFEST.MF吗?
?我已经用MANIFEST内容更新了帖子。是的,balusC我也这么想,我的web.xml中有类似的条目,你可以在我的问题帖子的更新部分看到。我的浏览器只调用了。嘿@balusC任何评论我已经用更多信息更新了问题,这似乎是一个Spring特有的问题,而不是JSF特有的问题。对不起,我对春天不熟悉。