还有一个方法,重新设置你的Class , 让你的LoginAction继承一个基类 (BaseAction), 那个基类BaseAction再继承ActionSupport,实现ServletRequestAware,SessionAware,ServletResponseAware,这样比较好
基于1个网页-相关网页
BaseAction was designed to provide most of the logic and helper methods that the other Action classes require to process the users' requests.
BaseAction用于提供大多数逻辑和辅助(helper)方法,而其他action类需要用这些方法来处理用户请求。
The added benefit is that it provides a good framework for future extensibility of the application. The BaseAction class provides the following functionality.
增加所带来的好处是为应用程序将来的扩展提供了良好框架。
应用推荐