JSF form with URL action?

点点圈 提交于 2020-01-01 11:51:08

问题


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


回答1:


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>


来源:https://stackoverflow.com/questions/11939807/jsf-form-with-url-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!