JSF中的导航有什么区别
FacesContext context = FacesContext.getCurrentInstance();
context.getApplication().getNavigationHandler().handleNavigation(context, null, url);
Run Code Online (Sandbox Code Playgroud)
和重定向
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect(url);
Run Code Online (Sandbox Code Playgroud)
以及如何决定何时使用什么?
导航问题是页面URL不会更改,除非faces-redirect=true
添加到导航URL的查询字符串中.但是,在我的情况下,faces-redirect=true
如果我想重定向到像纯HTML页面这样的非JSF页面,则会附加throws错误.
另一种选择是BalusC在JSF 2.0重定向错误中提出的建议
我是新手玩框架并尝试运行securesocial,如https://github.com/jaliss/securesocial 使用Play 2.3,Scala 2.10.0
.sbt文件配置为
name := "SecureSocial-parent"
version := Common.version
scalaVersion := Common.scalaVersion
lazy val core = project.in( file("module-code") ).enablePlugins(PlayScala)
lazy val scalaDemo = project.in( file("samples/scala/demo") ).enablePlugins(PlayScala).dependsOn(core)
lazy val javaDemo = project.in( file("samples/java/demo") ).enablePlugins(PlayJava).dependsOn(core)
lazy val root = project.in( file(".") ).aggregate(core, scalaDemo, javaDemo) .settings(
aggregate in update := false
)
Run Code Online (Sandbox Code Playgroud)
但低于错误
~\securesocial-master>activator run
[info] Loading project definition from ~\securesocial-master\project
[info] Set current project to SecureSocial-parent (in build file:~/securesocial-master/)
java.lang.RuntimeException: No main class detected.
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace …
Run Code Online (Sandbox Code Playgroud) 如何通过XML配置仅针对特定的URL模式在Spring Security 4中禁用CSRF?
弹簧security.xml文件
<security:http auto-config="true" use-expressions="true" pattern="/ext/**">
<csrf disabled="true" />
</security:http>
<security:http auto-config="true" use-expressions="true" authentication-manager-ref="authenticationManager">
<security:intercept-url pattern="/auth/**" access="hasAnyRole('ROLE_USER')" />
<security:form-login login-page="/login" authentication-success-handler-ref="loginSuccessHandler" authentication-failure-url="/login" login-processing-url="/j_spring_security_check" />
<security:logout invalidate-session="true" logout-url="/logout" success-handler-ref="logoutSuccessHandler" />
</security:http>
Run Code Online (Sandbox Code Playgroud)
如果我只使用一个安全性:http块,我的代码工作正常,但在我添加另一个块后,它会抛出错误,如下所示:
错误
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter gov.in.controller.filter.LoginAdtAuthFailHdlr.usernamePasswordAuthenticationFilter; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter] is defined: expected single matching bean but found 2: org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#1
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 58 more
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of …
Run Code Online (Sandbox Code Playgroud) 我正在使用Apache MyFaces 2.0.我注意到oam.Flash.RENDERMAP.TOKEN
为每个视图创建了一个cookie ,即使我没有使用Flash范围而且我已经设置了org.apache.myfaces.DISABLE_FLASH_SCOPE=true
.
我该如何删除oam.Flash.RENDERMAP.TOKEN
cookie?这是WebSphere特定的问题
我将从servlet过滤器返回到Facelets页面的消息.要将消息从servlet过滤器传输到Facelets页面,我使用的是会话变量.显示消息后,我想删除会话变量.如何实现这一目标?还有另一种方法将数据从servlet传递给Facelets吗?
我在WebSphere V8.0上使用MyFaces JSF 2.0 - IBM实现.在系统输出消息中,我仅在用户成功登录后才注意到以下错误.
HtmlLabelRend W Attribute 'for' of label component with id j_id1610532955_33b1d0aa is not defined
Run Code Online (Sandbox Code Playgroud)
我没有任何名为"id"的字段.解决此问题的任何指针都将非常有用
jsf-2 ×3
websphere ×2
flash-scope ×1
forward ×1
java ×1
jsf ×1
myfaces ×1
navigation ×1
redirect ×1
securesocial ×1
spring-mvc ×1