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