Method 1: Add the following lines at the beginning of the file when starting in Web. xml Code You can:
<! -- Start spring -->
<Listener>
<Listener-class> org. springframework. Web. Context. contextloaderlistener </listener-class>
</Listener>
<Context-param>
<Param-Name> contextconfiglocation </param-Name>
<Param-value>/WEB-INF/classes/applicationcontext. xml </param-value>
</Context-param>
Method 2, started with plug-ins in struts-config.xml:
Modify in applicationcontext. xml:
<Bean id = "userbiz" class = "com. svse. Ssh. Web. Action. loginaction">
<Property name = "userbiz" ref = "userinfobiz"> </property>
</Bean>
For (or directly add ):
<Bean name = "/login" class = "com. svse. Ssh. Web. Action. loginaction">
<Property name = "userbiz" ref = "userinfobiz"> </property>
</Bean>
Modify action in struts-config.xml:
<Action
Input = "/form/register. jsp"
Name = "adduserform"
Path = "/adduser"
Scope = "request"
Type = "com. svse. Ssh. Web. Action. adduseraction">
<Forward name = "failure" Path = "/form/failure. jsp"/>
<Forward name = "success" Path = "/form/success. jsp"/>
</Action>
Then add the following lines of code to the struts-config.xml:
<! -- Start spring -->
<Plug-in classname = "org. springframework. Web. Struts. contextloaderplugin">
<Set-Property = "contextconfiglocation" value = "/WEB-INF/classes/applicationcontext. xml"/>
</Plug-in>
Either of the above serves as the basis and finally adds the following code to the struts-config.xml:
<! -- Define a controller that automatically forwards requests to the spring container -->
<Controller processorclass = "org. springframework. Web. Struts. delegatingrequestprocessor"> </controller>