如何将此h:form转换为xhtml表单

时间:2010-05-27 07:21:06

标签: jsp xhtml jsf

<h:form id="login">
    Email: <h:inputText id="email" value="#{user.email}"/>
    <h:commandLink id="signupLink"  value="signup" action="#{userManager.validate}"/>
</h:form>

对于这样的事情:

<form action="#{userManager.validate}">
    Email: <input type="text" id="email" value="#{user.email}"/>
    <button type="submit" value="signup"/>
</form>

1 个答案:

答案 0 :(得分:0)

action指向servlet URL。然后在servlet的doGet()doPost()中编写代码以收集请求参数并存储在模型对象中并执行业务代码。在视图中,您可以使用EL中的${param.name}重新显示请求参数。基本上与JSF在引擎盖下所做的一样。 This is a good tutorial to learn JSP/Servlet