开发者

How do I convert this h:form into xhtml form

<h:form id="login">
    Email: <h:inputText id="email" value="#{user.email}"/>
    <h:commandLink id="signupLink"  value="signup" action="#{u开发者_如何学编程serManager.validate}"/>
</h:form>

To something like this:

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


Let the action point to the servlet URL. Then write code in servlet's doGet() or doPost() to collect the request parameters and store in model objects and execute the business code. In the view, you can redisplay the request parameters using ${param.name} in EL. Basically the same what JSF does under the hoods thus. This is a good tutorial to learn JSP/Servlet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜