Struts super simple entry (-)

xiaoxiao2021-03-06  18

As the most popular Web Framework, Struts may be more troublesome. I spend a whole day, I will work successfully, and now I will organize the results as follows:

Example requirements:

1. Allow users to enter a name, return "Hello XXX!", The output form is Hello string

2, when the user does not enter the name, return an error prompt

3. When the user entered the name belt "," symbol, prompt the error message, ie the name "," symbol is not allowed.

Example of operating environment:

Windows2000, JDK1.4.2, Tomcat5.0, Struts1.2

Tomcat and struts are in http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi and http://struts.cgi.org/download.cgi download

Ready to work:

1. Create a struts directory in the Tomcat 5.0 / WebApps / Directory which contains web-inflics and hello.jsp files

2, create a new CLASSES directory, lib directory, struts-config.xml file, web.xml file in Tomcat 5.0 / WebApps / Struts / Web-INF / Directory

3. In the Struts runtime COPY to Tomcat 5.0 / WebApps / Struts / Web-INF / LIB / directory

Includes: antlr.jar, commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-fileupload.jar, commons-logging.jar, commns-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 it is recommended that all COPY is more expensive. Hehe :)

转载请注明原文地址:https://www.9cbs.com/read-41471.html

New Post(0)