since I know I can’t use the Spring tag library in Facelets, I wonder if anyone can tell me what should I use instead of
<sf:form method="POST" modelAttribute="spitter">
.....
</sf:form>
Where prefix sf refers to (in JSP only):
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
I really like the idea of this form, that it binds all properties directly to modelAttribute object.
Is there any possibility that <h:form>...</h:form> can do the same?
Or is there any other tag, that can handle it?
I can’t use JSP because i want to use PrimeFaces.
I’m just a beginner in J2EE, so please be patient 🙂
Thank you in advance
Yes,
<h:form>does a similar thing. Even though the JSF approach is a bit different, the end result is similar: With spring the object gets submitted, and with jsf the field values end up in your managed bean. You will just have to use(where
beanis a@ManagedBean-annotated class (for jsf2), or declared in faces-config (for jsf1))This difference is that the spring form is submitted to the target url, and spring finds the target method based on the mapping, while here you specify which method of the managed bean to invoke in your
<h:commandButton />