具有URL操作的JSF表单? [英] JSF form with URL action?

查看:90
本文介绍了具有URL操作的JSF表单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以在<h:commandButton>内或为此在<h:form>内调用URL操作?我试图绕过我自己网站的电子邮件登录页面,所以我使用JSF bean将登录信息保存在<h:inputSecret>标记中,这样我就可以单击转到电子邮件",因为我已经登录进入我自己的网站,就可以直接进入收件箱,而无需再次登录

Is there any way to call a URL action within a <h:commandButton>, or for that matter a <h:form>? I'm trying to bypass my email's login page from my own website, so I'm using JSF beans to hold my login info in <h:inputSecret> tags so that I can simply click "Go to Email" and because I'm logged in to my own website, I could go straight to my inbox w/o logging in again

推荐答案

只需使用纯HTML <form>而不是JSF <h:form>.

Just use plain HTML <form> instead of JSF <h:form>.

<form action="http://example.com/mail" method="post">
    <input type="text" name="username" value="#{bean.username}" />
    <input type="password" name="password" value="#{bean.password}" />
    <input type="submit" value="Go to Email" />
</form>

这篇关于具有URL操作的JSF表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆