Struts整合spring方法(二)
采集日期:2008-4-21作者:zhaosoft(注:本数据由系统自动采集,内容与BHCODE无关)
用Spring的DelegatingRequestProcessor类来代替struts中的RequestProcessor类,从而把struts中的action与Spring分离。并把struts的动作置于Spring框架的控制下。
1。新建一个登陆页面:loginDelegatingRequestProcessor.jsp
<%@page contentType="text/html;charset=GBK" isELIgnored="false"%>
<html>
<head><title>实现用户登录的Struts实例</title></head>
<body>
<font size=’22’>${msg}<br></font>
<form name="form1" action="/myLogin2/loginDelegatingRequestProcessor.do" method="post">
用户名:<input type="text" name="username" value="${user.username}"/><br>