Simple entry to struts (-)

Source: Internet
Author: User

As the most popular Web framework, getting started with Struts may be quite troublesome. It takes me a whole day to get him started successfully. The results are as follows:

Example requirements:

1. allow the user to enter a name and return "Hello XXX!" after submission !", Output Format: Hello <Name> string

2. If the user does not enter a name, an error message is returned.

3. When the name entered by the user carries the "," symbol, an error message is prompted, that is, the name containing the "," symbol cannot be entered.

Running environment of the example:

Windows2000, jdk1.4.2, tomcat5.0, and struts1.2

Tomcat and struts

Preparations:

1. Create the struts directory under Tomcat 5.0/webapps/directory, which contains the WEB-INF directory and hello. jsp file

2. Create the classes directory, lib directory, WEB-INF file, Web. xml file under Tomcat 5.0/webapps/struts/struts-config.xml/directory

3. Copy the struts Runtime Library to the Tomcat 5.0/webapps/struts/WEB-INF/lib/directory.

Including: anlr. jar, commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-fileupload.jar, commons-logging.jar, commons-validator.jar, jakarta-oro.jar, Struts. jar, struts-bean.tld, struts-html.tld, struts-logic.tld

Some files may not be used in this example, but we recommend that you copy them all to save trouble :)

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.