After tens of millions of failures, I finally wrote a complete small example of struts to verify how much I understand struts,
For "form" and "from" errors, this idiot error made me busy for a whole afternoon,
At last, I found this "hacker" with the help of others ",
While cursing your idiots, you have to hate the intelligence of Java IDE,
~~~ You may report an error .........
After the error "form" is mistakenly written as "from,
ProgramIt finally started to run normally, because it started to report an error,
That happy in my heart (isn't it BT, but if you try the JAVA-IDE Life and Death don't report an error, and you will line by lineCodeWhen looking for an error, you will find it so nice to report the error ........)
First, introduce the functions implemented in this demo in advance,
Use struts to create a user name and password verification function. The user name and password can only be a combination of numbers and letters, and have at least 6 characters.
The specific operation steps are not described in detail this time.ArticleMany of them can be done after your reference,
Here I will only talk about solutions that may cause problems.
After writing the code, run, test, and an exception occurs:
Java. lang. noclassdeffounderror: ORG/Apache/Oro/text/perl/perl5util <br/> Org. apache. commons. validator. genericvalidator. matchregexp (genericvalidator. java: 65) <br/> Org. apache. struts. validator. fieldchecks. validatemask (fieldchecks. java: 233) <br/> sun. reflect. nativemethodaccessorimpl. invoke0 (native method) <br/> sun. reflect. nativemethodaccessorimpl. invoke (nativemethodaccessorimpl. java: 39) <br/> sun. reflect. delegatingmethodaccessorimpl. invoke (delegatingmethodaccessorimpl. java: 25) <br/> JAVA. lang. reflect. method. invoke (method. java: 597) <br/> org.apache.commons.validator.validatexception.exe cutevalidationmethod (validatoraction. java: 544) <br/> Org. apache. commons. validator. field. validateforrule (field. java: 796) <br/> Org. apache. commons. validator. field. validate (field. java: 876) <br/> Org. apache. commons. validator. form. validate (form. java: 288) <br/> Org. apache. commons. validator. validator. validate (validator. java: 351) <br/> Org. apache. struts. validator. validatorform. validate (validatorform. java: 116) <br/> Org. apache. struts. chain. commands. servlet. validateactionform. validate (validateactionform. java: 58) <br/> org.apache.struts.chain.commands.abstractvalidateactionform.exe cute (abstractvalidateactionform. java: 120) <br/> org.apache.struts.chain.commands.actioncommandbase.exe cute (actioncommandbase. java: 51) <br/> org.apache.commons.chain.impl.chainbase.exe cute (chainbase. java: 190) <br/> org.apache.commons.chain.generic.lookupcommand.exe cute (lookupcommand. java: 304) <br/> org.apache.commons.chain.impl.chainbase.exe cute (chainbase. java: 190) <br/> Org. apache. struts. chain. composablerequestprocessor. process (composablerequestprocessor. java: 283) <br/> Org. apache. struts. action. actionservlet. process (actionservlet. java: 1913) <br/> Org. apache. struts. action. actionservlet. dopost (actionservlet. java: 462) <br/> javax. servlet. HTTP. httpservlet. service (httpservlet. java: 710) <br/> javax. servlet. HTTP. httpservlet. service (httpservlet. java: 803) <br/>
The following error message indicates that the class definition is missing: ORG/Apache/Oro/text/perl/perl5util.
And this class exists with the jakarta-oro.jar package, this package generally comes with the IDE is not integrated,
After downloading the file, copy it to the Lib of your project and re-compile and run it,
Attached to the jakarta-oro.jar:
Click to go
I released the instance project code and liked to read it myself:
Click to go
If you have any questions, you can discuss them together.