环境:MyEclipse 14
1 struts1 框架搭建
在MyEclipse新建web project 取名为struts1_login,此时是一个空文档就不截图了然后在project上右键->选择myeclipse->add struts capabilities
单击上面Install Apache Struts(1.x)Facet
点击next
选择*.do ,改下包名改成与你项目相关的。如我的包名为com.lichang.struts1
点击next
点击完成,在我们的WEB-INF下就会多出struts-config.xml文件
以上就是让myeclipse帮我们加入框架的大概过程。项目的整体结构如下:
至此我们的struts1 框架搭建完成2 接着我们就开始编程来实现了。
2 接着我们就开始编程来实现了。
web.xml 如下:
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://.lichang.struts1;public class PasswordErrorException extends RuntimeException { public PasswordErrorException() { // TODO Auto-generated constructor stub } public PasswordErrorException(String message) { super(message); // TODO Auto-generated constructor stub } public PasswordErrorException(Throwable cause) { super(cause); // TODO Auto-generated constructor stub } public PasswordErrorException(String message, Throwable cause) { super(message, cause); // TODO Auto-generated constructor stub }}运行部分截图
登录界面
用户名不存在
源代码下载地址: struts1_login_jb51.rar
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。