"Struts2 Authority Guide" Learning notes STRUTS2 Ajax tags s and submit

Source: Internet
Author: User
Tags i18n

<s:a> This tag generates a hyperlink that is used to send an asynchronous request like the server and load the server response into the specified HTML element

Xml

? XML version= "1.0" encoding= "GBK"?>
< Web-app Version = "2.4" xmlns = "http://java.sun.com/xml/ns/j2ee"
Xmlns:xsi = "Http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemalocation = "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >

< servlet >

< Servlet-name > Dwr </servlet-name >
< Servlet-class > Uk.ltd.getahead.dwr.DWRServlet </servlet-class >
< Init-param >
< param-name > Debug </param-name >
< Param-value > True </param-value >
</Init-param >
</servlet >

< servlet-mapping >
< Servlet-name > Dwr </servlet-name >
< Url-pattern >/dwr/* </url-pattern >
</servlet-mapping >



< filter >
< Filter-name > struts2 </filter-name >
< Filter-class > Org.apache.struts2.dispatcher.FilterDispatcher </filter-class >
</Filter >

< filter-mapping >
< Filter-name > struts2 </filter-name >
< Url-pattern >/* </url-pattern >
</filter-mapping >

</Web-app >

Struts.xml

<! DOCTYPE Struts Public
"-//apache Software foundation//dtd Struts Configuration 2.0//en"
"Http://struts.apache.org/dtds/struts-2.0.dtd" >

< struts >

< constant name = "Struts.custom.i18n.resources" value = "Messageresource"/>
< constant name = "Struts.i18n.encoding" value = "GBK"/>

< package name = "Ajax" extends = "Struts-default" >
< action name = "Ajaxtest" class = "Lee." Ajaxtestaction ">
< result >/ajaxresult.jsp </result >
</Action >
< action name = "Test3" >
< result >/testjs.jsp </result >
</Action >
</Package >

</Struts >

Randomaction

  Package  lee;

Import  com.opensymphony.xwork2.action;

Import  java.io.Serializable;


Public   class  AjaxTestAction  implements  action, serializable
... {

    private static int counter = 0;
    private String data;

    public long getservertime ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.