Students who have just been in touch with the framework will encounter such a problem:
When you use myeclipse to configure an SSH framework, you write a logon verification action. However, when you access it on the page, the following occurs:
Execute is executed every time it is the first time you log on, and then log on again. This is the first time you log on.
In addition, the console only outputs the information added to the execute method when it is executed for the first time.
Login can continue only after Tomcat refresh is restarted
The solution is:
The bean in the spring configuration file is Singleton by default, so it is loaded only once.
You can add an attribute scope = "prototype" to the bean you configured the action"
Example:
<Bean id = "loginaction" class = "com. tianhao. Action. loginaction" Scope = "prototype"> </bean>
In this way, each call to loginaction is to load a new action instance.