Tutorials to .com

Tutorials to .com » Jsp » Tapestry-hivemind » Tapestry Developer's Guide (2)

Tapestry Developer's Guide (2)

Print View , by: iSee ,Total views: 7 ,Word Count: 815 ,Date: Thu, 16 Apr 2009 Time: 10:14 PM

1.2 Interactive

We continue to discuss some of JSP, which allows to delete from the shopping cart item. Simplicity, we assume that there is a category called LineItem object of item, and there is a servlet to manipulate the situation to change cars.

<td> <% = item.getProductName ()%> </ td>
<td> <% = item.getQuantity ()%> </ td>
<td> <% String URL = response.encodeURL ( "/ servlet / update-cart? action = remove" +
"& item =" + item.getId ());
<a href ="<%= URL%> "> Remove </ a> </ td>
</ tr>

This clearly shows that, in the jsp application, the designer at a very low level, responsible for pages, servlets, and other elements of "knitting together." In contrast, Tapesrty automatically take care of almost all of these questions:

<td> <span jwcid="insertName"> Sample Product </ span> </ td>
<td> <span jwcid="insertQuantity"> 10 </ span> </ td>
<td> <a jwcid="remove"> Remove </ a> </ td>
</ tr>

tapestry as a result of the use of Component Object Model, a framework to know exactly what components remove "any place of the page." It uses this information to create the appropriate URL reference to remove components. If the user clicks on the link, the framework will be informed of the actions to carry out the necessary components. Remove such components can be removed from the shopping cart item.
In fact, in the Tapestry, the users do not have to encode or decode code URL. This application from the network to eliminate a whole category of errors (those URLs may be more than you think to bring together and resolve the difficulties!)

Tapestry is not only for your servlet to create a URL; servlets out of the overall concept of the network application. Tapesrty components to create URL to call a method.
Tapestry application, as "super-servlet", only a need to configure and deploy servlet. In contrast, even the use of Sun's Model 2 (servlets to provide control logic, JSPs submitted results), to develop a simple JSP application can easily lead to many servlet.

1.3 Security

Tapestry can be used to provide some development and application of appropriate security benefits.
Tapestry applications built on the java Servlet API on top, so the succession of all the security benefits of servlet. Majority for CGI programs (such as those with Perl or other scripting language to write the program) rely on the safety of the conflict on the loose code in the system shell in the URL part of the assessment; and in the use of java Servlet API, this has never occurred.
Tapestry was created to deal with because of customer interaction than the traditional way of URLs with the URLs stronger structure, can be used almost no weaknesses. Improperly formatted URLs lead to abnormal response to the user.

The Java Servlet API is the client identification difficult, as the session identifier to be stored in the customer, or as a HTTP Cookie, or code to each URL. Malicious software to obtain this identifier, and "borrow" the identity of the user, as if the user login application recently. In short, this is a common servlet application limitations.
Finally, Tapestry application has a unique control flow: All incoming requests for a special type of flow to go through a few designated method. This makes it easier on the application of additional security measures.

tapestry & hivemind Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.