struts-2小练习
来源:互联网 发布:mac如何打开文件夹 编辑:程序博客网 时间:2024/05/19 20:56
index.jsp
<%@ page language="java" import="java.util.*" import="pack1.filter1" pageEncoding="ISO-8859-1"%><%@ taglib prefix="s" uri="/struts-tags" %><%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"> --><script language="javascript">function fun(){<%out.print("fdasf");%>}</script> </head> <body> This is my JSP page. <br> <a href="first!jia">tianjiao</a> <a href="first!geng">gengxin</a> </form> <font color="red"> <s:property value="info"/> </font> </body></html>
配置下struts.xml
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"><struts> <!-- 声明包 --> <package name="myPackage" extends="struts-default"> <!-- 定义action --> <action name="first" class="pack1.filter1"> <!-- 定义处理成功后的映射页面 --> <result name="jia">/user.jsp</result> <result name="geng">/geng1.jsp</result> </action> </package></struts>
Note:
href=”<%=basePath%>”>
0 0
- struts-2小练习
- 初识Struts,快速熟悉小练习
- 练习小程序2
- 编程小练习(2)
- TCP小练习2
- 编程小练习2
- 小练习2
- 操作系统小练习2
- 计算机网络小练习2
- 小练习2
- 小练习2
- linux小练习2
- Struts 2 类型转换练习1
- C语言小练习 2
- Python小练习(2)
- 小练习
- 小练习
- 小练习
- poj 1860 Currency Exchange
- C语言:线索二叉树的线索化及其遍历实现
- android 简单的网格布局 GridLayout
- 继承,继承的好处
- xml解析
- struts-2小练习
- #pragma_pack(n)_与__attribute(aligned(n))的关系与区别
- 正则表达式——肯定环视模拟固化分组
- 大数据&机器学习资料 记录
- Spring-data-redis:特性与实例
- ThreadPoolExecutor里面4种拒绝策略(详细)
- H264 数据avi文件封装和拆解
- 什么时候使用覆盖操作
- 【java基础总结系列】:java 多线程3种实现方式