I have a html mockup with lots of css images refs etc. and need to convert it to a jsf 2.0 app.
I know of the facelets attributes jsfc, but as i see it this does not work for jsf tags that need an attribute itself. Say you have a simple login form that needs to be converted. within there is a submit button. does not work, my action will not be called.
jsfc="h:button" action="#{auth.authenticate}"
I am having开发者_开发技巧 a hard time to believe that the interaction between developers and designers still is an unsolved problem, after all those iterations in Java EE. Designers do their stuff in html, css, maybe js but no jsf tags or el code. So there must be an efficient way how we can annotate html where the only difference between rendered from the filesysem and rendered from a jsf container is that the later has dynamic functionality.
anyone?
As to the concrete problem as stated in your question, you're confusing <h:button>
with <h:commandButton>
. The <h:button>
sends a GET request and supports a navigation case outcome
only and the <h:commandButton>
sends a POST request and can invoke a bean action
method.
So fix it accordingly as
jsfc="h:commandButton" action="#{auth.authenticate}"
or
jsfc="h:button" outcome="nextPage"
I'll ignore the remnant of your question as that's subjective. Try http://programmers.stackexchange.com instead (only try to make it a bit more constructive, or it'll get closed as non-constructive).
See also:
- JSF View Declaration Language Documentation - the ultimate JSF tag documentation
精彩评论