下面来做测试:
修改index.jsp代码为:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
姓名:<s:property value="employee.vcEmpName"/><br/>
公司:<s:property value="dept.vcDeptName"/><br/>
公司职员: <br/>
<s:iterator value="dept.employees" id="emp">
姓名:<s:property value="vcEmpName"/>
<br/>
</s:iterator>
</body>
</html>
2.并新建一个error.jsp文件:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'error.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
出错了!!!
</body>
</html>
OK,最后把写好的项目部署到服务器上运行即可.
在此附上更详细的代码包:
lib太大,只上传张图片:
分享到:
相关推荐
Maven+spring+ struts2+ Ibatis+mysql整合增删改查
flex+spring+struts2+ibatis 整合的eclipse工程,可以导入eclipse环境下直接使用,因为加入开发的jar大于了上传的最大限制,只能把jar另外打包上传,下载可以从我上传资源的lib1,lib2下载,这个工程的搭建花费了我两...
使用ibatis+spring+struts2 做的开发例子 帮助大家一起学习ibatis的整合
是将struts2+spring3+iBATIS进行整合。
struts2+spring+ibatis整合项目实例
maven3+struts2+spring+ibatis,本来是用maven3+struts2+spring+hibernate但考虑到hibernate在多表级联查询的时候执行效率不高,所以改用性能更好不过sql比较麻烦的的ibatis,本项目只有登录和插入数据,仅供参考: ...
Spring+struts2+ibatis整合demo,包括源代码,jar包等,此demo非maven项目,由于是以前整理的,可能有些老,但适合学习。
maven构建项目,简单的struts2、spring、mybatis结构实现,页面展示用的easyui
一个完整的Spring+ Struts+Ibatis 应用框架整合的小例子,项目中使用的数据库为MySQL,表结构在文档贴出,可以自己照着例子做一下。
Struts2 Spring Ibatis实例整合 里面实现了用户登录注册查询删除 认真体会里面的架构
Struts2+Spring+Ibatis ,里面实现了登录功能, 可供初学者学习,代码很详细, 注释很多, 还可以用于做项目
项目需要,可直接拿来用。本人花了一个礼拜心血搞的。有点,如果是发布到tomcat55上面可能要删掉验证xml的jar包才能正确运行
struts2+ibatis+spring+Hessian 整合项目 web项目整合,服务端用hessian协议远程调用服务端的方法,hessian是用spring代理整合,struts2+ibatis+spring的整合项目,用作学习和开发基础平台构建很有用处,工程导入...
前言:本讲是在【第四讲:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6+iBatis2.3.4】的基础上添加iBatis,此次集成其实质是Spring与Struts2的整合而已 目标:WEB项目-集成Flex3+BlazeDS3.2+Spring2.5.6+iBatis2.3.4+...
博文链接:https://klygit.iteye.com/blog/215011
Struts2+Spring+Ibatis项目
这是一个struts2+spring+ibatis项目中需要的jar包,其中包括很多其他包,例如:发邮件需要的包,dwr包,等。
struts2 spring ibatis 项目整合源码
struts1 spring ibatis整合项目源码struts1 spring ibatis整合项目源码struts1 spring ibatis整合项目源码struts1 spring ibatis整合项目源码struts1 spring ibatis整合项目源码struts1 spring ibatis整合项目源码