Develop Web applications using XSLT and Struts frameworks

xiaoxiao2021-03-06  107

Develop Web applications using XSLT and Struts frameworks

content:

1. Strutscs Introduction 2, Tool Preparation 3

In the XML area:

Teaching tools and products all articles

Jing Jing (Jing Jing (jing.xiao@chinacreator.com) Software Engineer February 2004

Strutscs is an open source project, which is a web application development framework based on Struts. The StrutsCS project allows us to develop web applications using XML, XSLT, XPath and other technologies and Struts frameworks, not JSP technology used in Struts. Moreover, StrutsCs can change the output format to WML, PDF, etc., so the scalability is better after StrutsCs. The author in this article will give you detailed introductions and demonstrate how to use the StrutsCS project to develop web applications.

In order to separate business logic and performance in web applications, in particular, it is a lot of ways to use the JAVA code in the JSP file, including a large number of label libraries in JSP, applying the Struts framework, etc. Today, I will introduce a new new. Method - Use strutscs project - it uses XML, XPath, XSL and other technologies and Struts frames, and no longer uses JSP, and simultaneously maps the contents in Struts to XML content, in XSL (Fashion Layer) The XSLT, XPATH technology is accessed, thereby ensuring that any Java code is no longer needed in the XSL (performance layer). 1, Strutscs Introduction 1.1 What is Strutscs Simply, Strutscs is using XSLT instead of JSP as a Struts representing the layer. He overcomes the limitations of the Struts framework, so that we use XSL, XML, XPath, XSLT development web applications, Output web content, and it can be easily extended to output WML, PDF, ASCII file, etc. 1.2 StrutsCS and Struts Process Flow Comparison Figure 1: Struts Process Flow Diagram Figure 2: Strutscs Processing Flowchart The following two diagrams are StrutsCS and Struts given by the StrutsCS website. From the two figures here, we can see the relationship between Strutscs and Struts, the main scope: It is obvious, they both in the MVC model, Controller's two parts are completely consistent, Strutscs is only in View The part has been improved, that is, the main scope of StrutSCS is to extend Struts in the content display, so that we can use new technologies such as XML, XSL, XSLT, XPath to implement high productivity, scalability. 1.3 Strutscs main features

A lightweight web development framework that can be run in any servlet container is supported by international languages. Including IS0-8859-1, Chinese, etc. use 100% XML, XSLT, XPATH, etc., JSP and text information save content output 100% support XML, XHTML, XSL-FO, WML, or other output format you want. A simple error checking mechanism uses JDOM by default. Built-in support, support for PDF, SVG, ASCII, etc. Cappucinonet.com/strutscx/index.php go to view. 2. Tools 2.1 Strutscs Download the compilation version of the Strutscs project, source code, Demo can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=67148&package_id=65546&release_id=201686 2.2 Server Download The author uses Apache Tomcat 5 server as a servlet container to perform strutscs, please go to http://jakarta.apache.org/site/binindex.cgi to download Tomcat5. According to the installation guide of the Strutscs project, Tomcat4 can also be configured, but the author is configured to find Tomcat4 does not fully support strutscs, everyone is interested, you can test it. 3. Configuring StrutsCs Demo 3.1 Installing Strutscs Demo to Tomcat First Install Tomcat to C: / Tomcat5 (later using% Tomcat_home% Reference This directory) will decompress the downloaded StrutsCs Demo, then copy all files to% Tomcat_home% // WebApps // root is below. [Note] This action will make the StrutsCS project a default web application for Tomcat, if you use Tomcat servers, and don't want to overwrite the default web app, then configure the context path of the Strutscs project (Context-Path). 3.2 Make StrutSCS examples running text resource information in StrutSCS, read support internationalization, and StrutSCS application is executed according to the result of getLocale (Request). Getlanguage (), he is based on ISO 639 standard The Chinese corresponds to ZH, everyone can go to http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt to find ISO 639 standard. Its demo built-in support includes support for British, Korea, Germany, etc. In order to let him support the implementation of China, it needs to be modified. The main modifications involved include configuration file strutscs-config.xml and related information save files, please refer to Several chapters later. 3.2.1 Modifying the strutscs-config.xml file StrutSCS-Config.xml file is located in the web-inflicity, and the modification of it is mainly the following steps:

Increase the support of the mainland in China to find the LANG element in the strutscs-config.xml file. You can see that it has three en-de Ko by default, separated by spaces in each middle, indicating support for the UK, Germany and South Korea, now we To make it support in mainland China, you need to add a zh (this is getLocale (request). Getlanguage () performs value in mainland China, is also the two-digit code corresponding to Chinese language in ISO 639), after modification The Lang element looks like this: en-de ko zh Add corresponding resource file settings to ensure proper access to resource files (similar to the AppicationProperties in Struts, is also saved The files of static text content appear), we need to add new settings. Please find the Resources-Properties element in the strutscs-config.xml file, which looks like this:

"YOU CAN SWITCH The Loading of these Files on | OFF.

IF on, the will loaded to the servletcontext and serialized

- Depending on the Given Locale - INTO THE XML-OUTPUT-Document

->

ON

->

/web-inf/xml/variables_en.xml

/web-inf/xml/variables_de.xml

/web-inf/xml/variables_ko.xml

There is a comment "Provide a file for each , after he can see the resources-property element with three child elements, they are en de ko, their content is a file name, each file Name is the resource file used in the corresponding region, it is obvious that we should add a sub-elements of ZH. His corresponding file is /Web-inf/xml/variables_zh.xml, the content of the resources-property element is as follows:

"YOU CAN SWITCH The Loading of these Files on | OFF.

IF on, the will loaded to the servletcontext and serialized

- Depending on the Given Locale - INTO THE XML-OUTPUT-Document

->

ON

->

/web-inf/xml/variables_en.xml

/web-inf/xml/variables_de.xml

/web-inf/xml/variables_ko.xml /web-inf/xml/variables_zh.xml

3.2.2 Increase the corresponding resource file, now the corresponding configuration is done, we should increase the corresponding resource file, here the author only copies /Web-inf/xml/variables_en.xml, renamed / web-inf /XML/Variables_zh.xml. 3.2.3 Other Files You can see / Web-INF / XML / there are several XML files, where INFO_ .xml (such as info_en.xml) is the content of the XML database in the example, Intro_ .xml (such as intro_en.xml) is the resource file corresponding to the StrutSCS introduction content in the example. In order to ensure example operation, please copy all copies (preferably INFO_EN.XML, INTRO_EN.XML), then Modify to zh, that is, in / web-inf / xml / directory should increase the two files of info_zh.xml, intro_zh.xml. 3.2.4 Modifying the index.html file This may be the negligence of the StrutsCS project group, and it will guide the next page to /strutscx-demo/info.do, if you configure this web application context is not / Strutscx-Demo, Please modify your own context path, such as the author modified to /mystructscs/info.do, or directly modified to INFO.DO 3.3 test Now you can start Tomcat5, then open the browser, enter the address http: // localhost: 8080 / . The context path for the web application configured by the instance, we use the default context environment here, so the context-path is a null string. If you configure the context environment, modify the context path corresponding to yourself. He should appear as shown below: If you see this page, then your StrutSCS Demo application has been successfully run, if an error occurs, follow the author's steps to check. 4, Strutscs Development Example Demo 4.1 Development Environment Description 1. Servlet Container ---------------------------- Tomcat 52. Database --- -------------------------------- MySQL3. Build Tool -------------- ---------------- Ant4. Strutscs project context ------ / 4.2 Examples In order to complete how to use Strutscs projects to develop a complete Web Application, we will use a simple example, this example will complete a full process of book information entry, modification, deletion, and list display. Book information includes the following properties: number, book name, publishing house, ISDN number, author, the number is automatically generated by mysql. After downloading the author's MyTrutscs.war, you can find the DDL file (mysql.ddl) required to create a data table after decompressing directory / web -inf / db /. The database associated information used by the author is as follows:

// Database driver

Private string dbdriver = "org.gjt.mm.mysql.driver";

// Database connection string

Private string dburl = "jdbc: mysql: //127.0.0.1: 3306 / strutscs"; // Access database users

Private string user = "root";

// Access the database password

Private string pwd = "iOffice";

This information is stored in org.vivianj.sample.dao. Booksdao class file, please modify according to your actual situation. 4.3 Related Configuration 4.3.1 Struts-Config.xml This is some Action definitions, including Forward, you can see the last Forward inside to point StrutscxServlet, because StrutsCS is specified by the Action class To display the XSL file and related formbean content, then displayed by StrutscxServlet (this is why we can easily modify the output format in Strutscs, because we only need to change the output format and other modifications by XSL, XSL and other modifications For your own format).

Path = "/ books_new"

Type = "org.vivianj.sample.action.bookcreateAction"

unknown = "false"

Validate = "True"

>

Name = "success"

Path = "/ strutscxservlet"

REDIRECT = "false"

/>

Path = "/ updatebook"

TYPE = "org.vivianj.sample.action.bookupdateAction"

Name = "BOOKFORM"

Scope = "request"

unknown = "false"

Validate = "True"

>

Name = "success"

Path = "/ strutscxservlet"

REDIRECT = "false"

/>

Path = "/ deletebook"

Type = "org.vivianj.sample.action.bookDeletection"

Name = "BOOKFORM"

Scope = "request"

unknown = "false"

Validate = "True"

>

Name = "success"

Path = "/ strutscxservlet"

REDIRECT = "false"

/>

He needs Formbean support, the name of FORMBEAN is Bookform ->

PATH = "/ bookpersistence"

Type = "org.vivianj.sample.action.bookpersistenceaction"

Name = "BOOKFORM"

Scope = "request"

unknown = "false"

Validate = "True"

>

Name = "success"

Path = "/ booklist.do"

REDIRECT = "false"

/>

If you need to realize the query function, then Formbean support here ->

Path = "/ booklist"

Type = "org.vivianj.sample.action.bookListAction"

unknown = "false"

Validate = "True"

>

Name = "success"

Path = "/ strutscxservlet"

REDIRECT = "false"

/>

4.3.2 Strutscs-config.xml Set the XSL file you want to display in StrutsCS-Config.xml, which is mainly for easy management, because the books.create used in the name of the XSL file to be displayed, Instead of using the file name directly, when your filename changes, you only need to modify the configuration file instead of modifying the program source code. Of course, you can set these file names directly in the action. These elements defined below are sub-elements of the strutscx-definitions element in the strutscs-config.xml file. You can find the corresponding content in the strutscs-config.xml file provided by the author's mystrutscs.war:

/web-inf/xsl/books_create.xsl

/web-inf/xsl/books_all.xsl

/Web-inf/xsl/books_delete.xsl

After these settings are completed, we start developing the code of action and formbean. 4.4 Code Development Some 4.4.1 FormBean Code FORMBEAN is mainly to operate on the FORM data that needs to be passed, so it is all Get , SET Method. Detailed code, please refer to the downloaded mystructscs.war // web-inf // sample // form // bookform.java. [Note] This formbean, there is setAction, getAction method, his actual and our business does not matter, just the author uses an action (/ bookpersistence) to complete the insertion, modification, deletion, query of book data, etc., you need to bring it. A current Action feature value. 4.4.2 All access in the action code Strutscs is implemented by mapping * .do, depending on whether they are dealing with the formBean, these mapped Action code is divided into two different situations: the first case: not FORMBEAN deals

In this case, you can only set the name of the XSL file to display in the Action code. The following BookAddAction.java belongs to this

The second case: need to deal with Formbean

In this case, the information interaction is required in the Action code and FORMBEAN. The following bookeditAction.java, Bookmultiinfo.java belongs to this.

All of the following categories have inherited baseAction, and he provides an ExecuteTart method. This method is mainly to put some common data, especially through the browser, such as: The name of this web application, this servlet container The "/" directory is on the hard disk, the server name, etc. Detailed information, please refer to the downloaded mystructscs.war //web-inf//strutscx//sample01//presentsentation//Action//baseaction.java file in MyStructScs.war.

The following code interpretation and comments are only for the main part of the active implementation in each action, and the detailed code implementation, please refer to the downloaded mystructscs.war. Java file. 4.4.2.1 BookAddAction.java This class implements an action of an Execute method, because here is just to display an interface, do not need to be deal with FormBean, so we only need to set the name of the XSL file. The main code and comments are as follows:

// Write some fixed information to Request

ExecuteatStart (Mapping, Form, Request, Response);

/ / Point to the corresponding definition in strutscx-definitions, here is the Books.create // final display, which is converted to the corresponding XSL file according to the definition in Strutscx-definitions, as we define / web-inf / xsl / books_create. XSL

String xslfile = "books.create";

// Set the file name as the property to the Request

Request.setattribute (strutscxconstants.xsl_key, xslfile);

/ / Direction to the Forward specified in Struts.config.xml

String forward = constants.forward_success;

Return (Mapping.Findforward (Forward);

4.4.2.2 BookedTAction.java When the book information is displayed, we generally take the information corresponding to the book number, and then display it in the Form and modify it by the user. So the BookedTAction class implements an action of an Execute method. In this method, the first is to convert the entered book number into a corresponding FORMBEAN (he only has the book number information), then get a complete FORMBEAN according to this FORMBEAN (He has a complete book Information, including numbers, book names, etc.), put this complete FORMBEAN in the Request's properties, for the XSL file call to display, and finally set the XSL file name that you want to display. The main code and comments are as follows:

// Write some fixed information to Request

ExecuteatStart (Mapping, Form, Request, Response);

// Translate the incoming FORM data to FORMBEAN

Bookform bookform = (bookform) Form;

/ / According to the transformed FORMBEAN information (here is mainly the ID number of the book)

/ / Find the information corresponding to the FORMBEAN in the database, constitute a new FormBean object

Bookform = New booksdao (). FindbyPrimaryKey (INTEGER.PARSEINT (Bookform.getBookId ()));

/ ** Set the FORMBEAN as the property to the Request

* Set 'bookform' must be consistent with the FORM name defined in struts.config.xml

* As we define this regarding / updatebook:

Path = "/ updatebook"

TYPE = "org.vivianj.sample.action.bookupdateAction"

Name = "BOOKFORM"

Scope = "request"

unknown = "false"

Validate = "True"

>

* So we must use 'bookform' here (that is, the attribute value corresponding to the Name in the definition) as the attribute name of the Request

* /

Request.setttribute ("Bookform", Bookform;

/ / Point to the corresponding XSL file feature string in strutscx-definitions, here is Books.Update

/ / Finally, the definition in StrutsCX-definitions will be converted to the corresponding XSL file, such as our defined /Web-inf/xsl/books_update.xsl

String xslfile = "books.update";

// Set the file name as the property to Request.setttribute (StrutscxConstants.xsl_key, xslfile) in Request;

/ / Direction to the Forward specified in Struts.config.xml

String forward = constants.forward_success;

Return (Mapping.Findforward (Forward);

4.4.2.3 BookDeleteAction.java He is used to set the display book delete interface, and the processing flow of the display book modification interface is the same, just set the XSL file to display by 'books.update' to 'books.delete' please please Refer to the content corresponding to the file in the download file, this is no longer explained. 4.4.2.4 BookListAction.java This Action class is used to place the information of all books to be displayed in Request with the ArrayList object. Strutscs map this ArrayList into XML data, we will use XSLT, XPath to access him, rather than using JSP Java code Access it, at the same time, put the next XSL file to Request, the code and explanation of the main part is as follows:

// Write some fixed information to Request

ExecuteatStart (Mapping, Form, Request, Response);

/ (Pointing to the corresponding XSL file feature string in strutscx-definitions, here is Books.All

/ / Finally, the definition in Strutscx-definitions will be converted to the corresponding XSL file, as we define /Web-inf/xsl/books_all.xsl

String xslfile = "books.all";

// Set the file name as the property to the Request

Request.setattribute (strutscxconstants.xsl_key, xslfile);

/ / Create an ArrayList containing all book information

/ / The relevant data will be read according to this ArrayList in the display page.

ArrayList Booklist = New Booksdao (). GetBooksbyName ("");

// put the arraylist object in Request

Request.setttribute (strutscxconstants.xml_key, booklist);

/ / Direction to the Forward specified in Struts.config.xml

String forward = constants.forward_success;

Return (Mapping.Findforward (Forward);

Ok, the code of the code section is now completed, and the following will explain how to read these incoming FormBean and ArrayList in XSL. 4.4.3 Increasing Resource Information In Strutscs, all text resources are saved in the XML file, which is WEB-INF // XML // Variables_xx.xml, where XX is the code corresponding to countries, in China, this code Is EN, so we should save our own text resources into web-inf // xml // variables_zh.xml. The author is in Web-INF // XML // Variables_zh. The following is an increase in the following, which is the text resources that may be used in our book management applications (mainly for convenient maintenance and internationalization):

Book Management System - Based on Strutscs Project </ Title></p> <p><bookinfo></p> <p><ID> Number </ ID> <name> Title </ name></p> <p><Publisher> Press </ Publisher></p> <p><ISDN> ISDN No. </ ISDN></p> <p><Writer> Author </ write></p> <p></ bookinfo></p> <p><add_button_label> Add </ add_button_label></p> <p><edit_button_label> Modify </ Edit_Button_Label></p> <p><del_button_label> Delete </ del_button_label></p> <p></ books></p> <p>Where Books is a child element of ResourcesProperties / Page / INFO, the relationship between them please check the content of the corresponding files in the downloaded mystructscs.war. 4.4.4 How to Access Resources, FormBeam, ArrayList, Content 4.4.4.1 How to Access Resources in XSL We have access to these resource information through XSLT and XPath, and there are two: 1. absolute address access so-called The absolute address access is to access the content of the element by entering the absolute address in the resource element, he is beginning to "/". For example, we have to access the contents of the Title we join, his absolute address is "/ root / resourcesproperties / page / info / books / title". [Note] This address / root is a reference point to access static resources in XSL, and all of which can be accessed is mostly his child elements, such as resources, FORMBEAN, etc. will also be used in the following chapters. . 2. Relative address access relative address access needs to set an address reference through XSL: for-EACH, then XSL: for-Each access is to access relative to this address base. He is not starting with "/". For example, the authors provide BookAdd.xsl:</p> <p><xsl: for-each select = "/ root / resourcesproperties / page / info / books"></p> <p><XSL: Value-of Select = "BookInfo / ISDN" /></p> <p></ xsl: for-energy></p> <p>Then this intermediate / root / resourcesproperties / page / info / books is the benchmark for access, and bookinfo / isdn is a relatively access, he actually access / root / resourcesproperties / page / info / books / bookinfo / ISDN element content. 4.4.4.2 How to access FormBean in XSL We will access FormBean information through XSLT and XPath in XSL, you can see this in the book_update.xsl file:</p> <p><xsl: variable name = "bookid" select = "/ root / actionform / bookform / bookid" /></p> <p>XSL: Variable means that we build an XSL variable, name is the name of this variable, / root / actionform / bookform / bookid means that this is taken from a FORMBEAN, where the meanings of the character string are as follows:</p> <p>Root Please refer to how to access resources in XSL About / root Description Actionform indicates that we get the name of the BOOKFORM in the FormBean to indicate the name of the BEAN class corresponding to the incoming FormBean. Please modify it to the corresponding content. As we introduced by bookform is an example of the bookform class, then here is Bookform, if it is an instance of the bookformbean class, here should be BookFormbean. Bookid means that we get the corresponding bookid's properties in the FormBean, please modify to the corresponding content. [Note] Please pay attention to the upper and lower strings. 4.4.4.3 How to Access Session in XSL We will access the session through XSLT and XPath in XSL, you can see this content in the book_update.xsl file: <xsl: variable name = "SELECT =" / / session / domain "/></p> <p>XSL: Variable means that we create a XSL variable, name is the name of this variable, // session / domain means this is from a session, where the meanings of the string representatives are as follows:</p> <p>Session Represents Domain from Session Domain means that we get the value of the Domain property in the session, please modify to the corresponding content 4.4.4.4 How to loop in XSL Access ArrayList In every item in ArrayList, we need to use for a loop -Each, in Books_all. In the XSL file, you can see this code:</p> <p><xsl: for-each select = "/ root / data / boxvo"></p> <p><xsl: value-of select = "boxid" /></p> <p></ xsl: for-energy></p> <p>Where <XSL: for-Each Select = "/ root / data / bookvo"> Each of the ARRAYLIST objects that are incorporated in the loop, the meaning of each string in / root / data / bookvo is as follows:</p> <p>ROOT Please refer to how to access resources in XSL DATA for / root DATA indicates that this is from incoming data Bookvo this is the class name of the object in ArrayList, please modify to the corresponding content 4.4.5 XSL (Representation layer) 4.4.5.1 Book_create.xsl In this XSL, it is mainly to display a form of a user into book information, and the content of the form is implemented with HTML, so it is simple. Mainly demonstrate how to access the information provided in the resource file, detailed file content, please refer to the contents of the corresponding // web-inf // xsl // Books_create.xsl file in the downloaded mystructscs.war. For how to access text resources, please refer to how to access resources in XSL. 4.4.5.2 Books_UPDATE.XSL This XSL wants to display the interface of the user to modify the book information, mainly demonstrate how to access the FORMBEAN, and of course, how to access the content provided in the resource file. Detailed file content, please refer to the content of the corresponding // web-inf // xsl // book_update.xsl file in the downloaded mystructscs.war. For details on how to access the FORMBEAN, please refer to how to access the FORMBEAN in XSL. For how to access text resources, please refer to how to access resources in XSL. 4.4.5.3 Books_all.xsl This XSL mainly shows a list of all book information, which shows how to display each item in ArrayList cycled from incoming arrayList. Of course, I also demonstrate how to access the content provided in the resource file. Detailed file content, please refer to the contents of the corresponding // web-inf // xsl // books_all.xsl file in the downloaded mystructscs.war. For details on how to access ArrayList, please refer to how to access ArrayList in XSL. For how to access text resources, please refer to how to access resources in XSL. 5. When reading Chinese resources in the Chinese problem, there is a Chinese problem. The author has found that the contents of the resource file directly into the Document object of the JDom because StrutsCs read the contents of the resource content, without using his SAX builder. The author has modified his StrutscxStandardDocumentBuilder. After the relevant code of Java, I resolved this problem. In the following three cases, please use different ways to solve Chinese problems: 1. If you develop the Strutscs application based on the author's mystructscs.war, then there should be no more Chinese issues 2. If you download his Demo from the Strutscs website, Based on the DEMO development Chinese application, please use the strutscs.jar overwritten // web-inf // lib // strutscx-0.9.5.jar to solve Chinese issues 3. If you download his source file from the Strutscs website, After the configuration is developed, then use the author's mystructscs.war // web-inf // src // card // Cappuccinonet // strutscx // xslt // strutscxstandardDocumentBuilder. Java covers the corresponding StrutsCxStandardDocumentBuilder in the StrutsCS source file. Java to solve Chinese problems. 6, compile execution 6.1.1 Compiling all kinds of files of the authors are placed in the downloaded mystrutscs.war Web-INF // src directory if you have developed code, or you can put it in this directory. The author's ISTRUTSCS.WAR provides simultaneous setENV. BAT and build.xml, you only need to modify the java_home and ant_home parameters in setENV.bat, and the content you need to modify in Build.xml is</p> <p>Elements, this is mainly to provide a JAR file that supports servlets (such as WebLogic.jar, etc.). Then execute Ant under the DOS interface. 6.1.2 Run Now, restart Tomcat, then enter http: // localhost: 8080 / book_new.do in the browser, you should be able to see the interface to enter the new book information. You can see all lists of saving book information via http: // localhost: 8080 / booklist.do. [Note] If you set up the context path of the web application, add the corresponding context path. 7. Summary The StrutsCS project is an open source project. He is based on the Struts framework, but it has expanded the Struts representation layer section, allowing us to use XSL, XML, XPath, XSLT as a representation layer, and develop web applications based on Struts framework . Important is the StrutsCS extension feature maps the objects such as FormBean, ArrayList to XML data, and then accessed by XPath, XSLT, which means that the Java code is not required in the layer, and the HTML in the representation is realized. Separation of Java code. In this paper, the author introduces how to configure StrutsCS's operating environment, configure the StrutsCS's Demo sample to run, explain, and demonstrate how to create a strutscs application, configure strutscs, access FormBean / session / resource / arraylist through XSL. I hope to help you quickly grasp the advanced features in Strutscs, help better use MyStruts to assist our application development. Strutscs are supported in a variety of output formats, the author is studying, if there is an experience, it will be shared with everyone, and I hope that everyone will exchange the apps, study experience and experience. Reference Struts Project Online Document Http://jakarta.apache.org/struts/index.html Strutscs Project Online Document Http://it.cappucinonet.com/strutscx/overview.php?target=overview Tomcat5 Online Help Document http: //jakarta.apache.org/tomcat/tomcat-5.0-doc/index.html Ant Online help document http://ant.apache.org/manual/index.html instance code download: mystructscs.war</p> <p>About author</p> <p>Xiao Jing, is currently a software center software engineer, the software center of Changsha Railway College, Hunan Province, IBM DeveloperWorks / Bea dev2dev / sun Chinese technology community online lecture writer, mainly study J2EE programming technology, web service technology and them Implementation on WebSphere, WebLogic, Apache platform, with IBM's developing with WebSphere Studio certificates. Welcome everyone to access the author more technical articles through the author's personal homepage. You can contact your author through jing.xiao@chinacreator.com or 0731-6665772.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-104660.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="104660" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.050</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'vfI4JEWR4PL8GLB4LEV_2Bqr6pzOskUAufwn0uKf4oMRMciRytoYWckQtKBf6_2BPZ52T2UyvnsKefof2OPgrjk3ZQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>