ssh(struts
MyEclipse整合SSH過程概述
MyEclipse整合SSH登陸范例
< body>
< form action=
< table border=
< tr>< td>name:< /td>
< td>< input type=
< tr>< td>password:< /td>
< td>< input type=
< tr>< td colspan=
< input type=
< input type=
< /td>
< /tr>
< /table>
< /form>
< /body>
< action
< !
< action name=
scope=
type=
< forward name=
< forward name=
< /action>
< /action
< message
parameter=
< plug
className=
< set
value=
< /plug
< !
< bean name=
< property name=
< /bean>
< !
< bean id=
< property name=
< /bean>
< !
< bean id=
< property name=
< /bean>
前面說過
< !
< bean id=
class=
< property name=
value=
< /property>
< property name=
value=
< /property>
< property name=
< property name=
< /bean>
< bean id=
class=
< property name=
< ref bean=
< /property>
< property name=
< props>
< prop key=
org
< /prop>
< prop key=
< prop key=
< /props>
< /property>
< property name=
< list>
< value>com/dc/pojo/User
< /property>
< /bean>
userDAO的驗證方法「如下」
public class UserDAOImpl extends HibernateDaoSupport implements UserDAO {
public User checkUser(String name
String sql =
List userList = this
new Object[]{name
return userList
}
}
//用戶登錄驗證
public ActionForward execute(ActionMapping mapping
HttpServletRequest request
LoginActionForm laf = (LoginActionForm) form;
String name = laf
String password = laf
User user=userService
if(user!=null){
HttpSession session=request
session
return mapping
}
return mapping
}
這就是一個簡單的流程
以上就介紹了MyEclipse整合SSH的流程
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28247.html