日期:2014-05-17 浏览次数:20618 次
<script type="text/javascript">
$().ready(function(){
$("#sub").click(function(){
$("#teacherRegist").submit();
})
});
</script>
<title></title>
</head>
<body>
<s:form id="teacherRegist" method="post" action="login!login">
<input type="text" name="userinfo.username"/>
<input type="password" name="userinfo.password"/>
<input type="button" value="queren" id="sub"/>
</s:form>
<action name="login" class="cn.dota.klaus.loginAction">
<result name="success">
/login.jsp
</result>
</action>
<!-- 读取applicationContext.xml -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<bean id="loginAction" class="cn.dota.klaus.loginAction">
<property name="message">
<value>123456</value>
</property>
</bean>
public class loginAction extends ActionSupport {
private String message;
public void setMessage(String message) {
this.message = message;
}
public String login(){
System.out.println(this.message);
return "success";
}
}
Resource resource = new ClassPathResource("applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(resource);