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