Struts 2 with Ajax

Struts and Struts2 compared to a major improvement is support for Ajax. In this paper, look at the Div in Struts2 is how Ajax used to output the results, the main use of the Dojo.

First of all, we first create a simple use case, in this use case will be displayed on the screen of a user list, click on the userid list, the list below will show the user detailed information, showing detailed information of the user steps we will the use of Ajax.

First, create a web.xml





struts2
org.apache.struts2.dispatcher.FilterDispatcher


struts2
/ *



Second, create struts.xml
"- / / Apache Software Foundation / / DTD Struts Configuration 2.0 / / EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">



/ userlisting.jsp


/ userdetail.jsp




III, page: userlisting.jsp
Displays list of users
<% @ Taglib prefix = "s" uri = "/ struts-tags"%>





你可能感兴趣的:(Struts,2,Struts,Ajax,JSP,Dojo,Apache)