Now let's start with the advantages of JSF. One by one, we should sort out the primary and secondary items at last. Now we will focus on the above issues first.
1. URL to action method
In JSF, we write a button to send a request and execute an action in a way like this:
<H: form>
<H: inputText value = "# {someAction. text1}"/>
<H: commandButton value = "execute" action = "# {someAction. method1}"/>
</H: form>
Execute the method1 method of someAction when you click the button. We do not need to care about the URL to which the form is submitted and how to call SomeAction. method1. You may be surprised to look at another example:
<H: form>
<! -- Loop the users set in someAction -->
<Ui: repeat value = "# {userAction. users}" var = "u">
<H: commandButton value = "delete" action = "# {userAction. remove (u)}"/> <! -- Are you surprised to see this method call? -->
</Ui: repeat>
</H: form>
The bean implementation class userAction contains a remove method that receives a User-type parameter. On the page, during the loop process, we directly ask the button's action = "# {userAction. remove (u)} ", so when you click the button, the background action object can correctly receive the User object you want to delete. How are the frontend and backend parameters transmitted? Where is the User object stored? We don't need to worry about it. As you can see, the above Code has almost no content related to HTTP details.