如何重定向到托管bean中的j_security_check?
我已经成功运行了一个基于 FORM 身份验证的项目,并尝试对 Icefaces 项目执行相同的操作。换句话说,我想使用ice:form而不是form,所以我想知道是否可以将登录请求重定向到托管bean中的j_security_check:
public void myMethod(ActionEvent e){
//some code that redirects to j_security_check
}
和我的登录页面:
<ice:commandButton value="login" ActionListener="#{myBean.myMethod}"/>
但我真的不知道该怎么做,我并没有真正找到有关 j_security_check 及其实际工作原理的文档。
i've successfully run a based FORM authentication project and trying to do the same with an icefaces project. In other terms i want to use ice:form instead of form, so i was wondering if i could redirect the login request to j_security_check in the managed bean:
public void myMethod(ActionEvent e){
//some code that redirects to j_security_check
}
and in my login page:
<ice:commandButton value="login" ActionListener="#{myBean.myMethod}"/>
But i don't really know how to do it, and i don't really find documentation about j_security_check and how it really works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以拥有一个带有
action="j_security_check"
的表单,其中包含包含用户名和密码的文本字段或隐藏字段。您可以将这些字段绑定到托管 bean 中的变量。您可以在表单中使用提交按钮来代替
。如果您必须使用
,您可以使用Javascript发送“myform.submit()”脚本:您还可以在Javascript中动态创建表单元素,分配用户名/密码值并使用 JavascriptContext.addJavascriptCall() 方法提交
You can have a form with
action="j_security_check"
, with text fields or hidden fields containing the username and password. You can bind these fields to variables in your managed bean. You can use a submit button in the form instead of<ice:commandButton>
.If you have to use the
<ice:commandButton>
, you can use Javascript to send a "myform.submit()" script:You can also dynamically create a form element in Javascript, assign username/password values and submit it, using the
JavascriptContext.addJavascriptCall()
method