开发者

JSF 2.0 and spring-security 3 integration?

Is it possi开发者_运维技巧ble to combine that stuff? I just need a simple log-in page even without db backend :) Username/pwd should be stored in the securityContext...

Can somebody provide me a tutorial or show how the things must be configured?

Thank you!


There are several ways to do this:

  • The "plain HTML way". In this case you use a standard Spring Security configuration and use a standard HTML page, pointing the submit form to Spring Security login-url.

  • The "JSF 2.0 way". What I do in this case is implement a backing bean for the login page and register an ActionListener for the submit button that dispatches to the login-url using FacesContext.getExternalContext(),dispatch(), and then calls FacesContext.responseComplete(), ending the request lifecycle. You might need to tweak your web.xml to allow Spring Security to intercept FORWARD requests for the login-url.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜