The first Java Web project that uses the Struts framework

Source: Internet
Author: User

This morning, for the first time, a HelloWorld-level Java Web Project login (login verification) project was completed.

Guided by the "Java EE mainstream open source Framework (second edition)".

1, the first download struts:struts-2.3.16.3-all.zip, after decompression see struts-2.3.16.3 directory has a Lib directory, this directory is all jar files, using the Struts framework needs to use the jar package is in this directory.

2, according to the instructions in the book, first set up the Web project in myeclipse8.5, named Login.

Then put the following five jar files under Login/webroot/web-inf/lib, and then myeclipse automatically appear under Login referenced libraries directory below is the five jar files just added, Indicates that the five jar files have been added to the BuildPath:

Ognl-3.0.6.jar,

Struts2-core-2.3.16.3.jar,

Xwork-core-2.3.16.3.jar,

Freemarker-2.3.19.jar,

Commons-logging-1.1.3.jar

3, the development of the model layer of business logic class

Loginservice

4, the Development view file, the view uses the JSP implementation.

Developed index.jsp and welcome.jsp.

5, defines the action class, defines the Loginaction class,

6. Configuring the Action class in Struts.xml

7. Call Loginaction in index.jsp

8. Configuring Filterdispatcher in Web. xml

Then start debugging, debugging encounters several problems:

1, compile encountered classnotfoundexception, according to exception information, to the project added a jar file Javassist-3.11.0.ga.jar, Commons-lang3-3.1.jar, Commons-io-2.2.jar, Commons-fileupload-1.3.1.jar

2, index_jsp class did not generate, see the problem is because index.jsp in the struts written structs, write a C cause, at the same time in the form action also did not write login.

3, Filterdispatcher class can not be resolved, the last view is found in Web. config Filterdispatcher class when the package name struts written in structs, wrote a C

The first Java Web project that uses the Struts framework

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.