`
sunxiang0918
  • 浏览: 45734 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Spring+Struts2+IBatis 项目整合(四)

    博客分类:
  • J2EE
阅读更多

 下面来做测试:

  修改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太大,只上传张图片:

分享到:
评论
5 楼 xiaolng 2011-08-23  
color=orange] :idea: 很好的教程。。好文章就要狂顶。[/color]
4 楼 AccpAnderw 2011-07-01  
  第一次用spring+struts2+ibatis 整合web框架开发!能看到这些资料,对我的帮助那是没话说!  感谢!!!
3 楼 shupili141005 2010-04-20  
楼主,非常感谢!
按照你的思路我也搞出来了,刚开始架构SSI框架。
不过你好像Impl封装的太多了,没啥意思。
直接用Action调用一个Service即可
2 楼 FF1280 2009-01-15  
thanks a lot!
1 楼 grape927 2008-12-26  
呵呵 谢拉 还蛮详细的

相关推荐

Global site tag (gtag.js) - Google Analytics