My solution is:
Don't use xwork-2.1.6.jar, for xwork-2.1.2.jar!
The struts tag library is introduced in the JSP page: <% @ taglib prefix = "S" uri = "/Struts-tags" %>
Write a simple form,
<Div> <s: Form Action = ""> <s: textfield name = "username" label = "username"> </S: textfield> <s: textfield name = "password" label = "password"> </S: textfield> <s: Submit value = "login"> </S: Submit> </s: form> </div>
JSP error after running result: Java. Lang. classnotfoundexception: COM. opensymphony. xwork2.util. textutils
Literally, we already know the cause: the textutils class cannot be found.
Take a lookCodeNo error. OK. The code is correct. That's another code issue! There is only one possibility for the object: there is a problem with the imported jar package.
It is said that the jar package conflicts on the Internet. Textutils has been removed in the xwork-2.1.6.jar !!! OK. Can you download this class and add it manually? Use the most secure. The target is locked on the jar package of the xwork-2, so let's take a look at the version of this jar. Google still got the answer. textutils exists in the previous version. It is also speechless to remove this class from version 2.1.6 of Shenma High. Some people say that 2.1.8 is acceptable, but the JSON jar package must be involved. For example: http://blog.csdn.net/foart/article/details/6669836:
Find the following jar package in the Lib folder of the downloaded struts2:
Json-lib-2.x.jar
Struts2-json-plugin-2.x.x.jar
Struts2-junit-plugin-2.x.x.jar
Add the above three packages to the project, and then delete the jsonplugin-0.3x.jar package
I'm using a s2sh frame, struts2-core-2.1.6.jar + xwork-2.1.6.jar.
Since textutils has been removed from the xwork-2.1.6.jar, it cannot be used.
I personally think that the deletion of the jsonplugin-0.3x.jar package for a few more jar packages, and the version is basically getting higher and higher. This is not highly secure. If you change the environment, there may be other problems, even if this problem does not occur again. Of course, my simple and conservative practices may also face some version problems. Let's share them with you.
Don't use xwork-2.1.6.jar, for xwork-2.1.2.jar!