I wrote a simple example yesterday .. Only registration, login, and exit functions are available. The submission address written when writing to exit the function is <form action = "logout">, then, when configuring action in the actionservlet, write <action Path = "/logout"> <forward name = "logout" Path = ""/form/login. JSP "> </Action>, and then in the welcome. the form/logout cannot be found until it exits in JSP...
That's depressing .. After a day of hard work, I finally found out where the problem was... Previously, I thought the problem was in the process of processing logoutaction. Later I changed the submission path for exiting the function to AAAA, and then the action path to AAAA. the problem still exists, form/AAAA not found .. So I began to suspect that the actionservlet didn't capture the submitted logout at all... Because the form/AAAA cannot be found, it is suspected that it is a path problem .... Finally, we can find out where the problem is.
The exit button is in welcome. JSP, and this JSP is in the form folder, that is to say, when you choose to exit, the submission address is logout, and the actual submission address is form/logout, the corresponding action path is set to logout, so it cannot be captured .. This means that the <action Path = "/logout"> depends on the path. It must be a logout under struts to be sent to the defined action, therefore, the submission address should be written as <form action = "/struts/logout"> ......
Lesson: When writing the submission path in the future, do not write the path as/struts /***. do, or set the action path to a path When configuring the action, such as Path = "/form/logout"