...
Apache Struts 2 Architecture in a Nutshell
|
|
...
The Struts Tags help you create rich web applications with a minimum of coding. Often, much of the coding effort in a web application goes into the pages. The Struts Tags reduce effort by reducing code.
Code Block | ||
---|---|---|
| ||
<% User user = ActionContext.getContext() %> <form action="Profile_update.action" method="post"> <table> <tr> <td> align="right"<label>First name:</label></td> <td><input type="text" name="user.firstname" value="<%=user.getFirstname() %> /></td> </tr> ... <tr> <td> <input type="radio" name="user.gender" value="0" id="user.gender0" <% if (user.getGender()==0) { %> checked="checked" %> } %> /> <label for="user.gender0">Female</label> ... |
Looking over the markup, it's easy to see what why Java web development without the aid from a modern framework is hard! So far, we've only coded two controls, and there are six more to go! Let's finish the form using Struts Tags.
...