<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>
<body>
访问BookAction_add 测试action标签中的method属性<br>
<a href="${pageContext.request.contextPath}/pattern/bookAction.action"> 测试</a><br>
<br>
<br>
通配符映射示例(1):<br>
<a href="${pageContext.request.contextPath}/pattern/a_add.action"> 通配符映射示例(1)</a><br>
<a href="${pageContext.request.contextPath}/pattern/b_add.action"> 通配符映射示例(1)</a><br>
<a href="${pageContext.request.contextPath}/pattern/c_add.action"> 通配符映射示例(1)</a><br>
<br>
<br>
<br>
通配符映射示例(2):<br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_add.action"> 图书</a><br>
<a href="${pageContext.request.contextPath}/pattern/UserAction_add.action">用户</a><br>
<br>
<br>
通配符映射示例(3):<br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_add.action">图书添加</a><br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_delete.action">图书删除</a><br>
<br>
<br>
<a href="${pageContext.request.contextPath}/pattern/UserAction_add.action">用户添加</a><br>
<a href="${pageContext.request.contextPath}/pattern/UserAction_delete.action">用户删除</a><br>
<br>
<br>
动态方法调用!形式:<br>
<a href="${pageContext.request.contextPath}/pattern/BookAction!add.action">图书添加</a><br>
<a href="${pageContext.request.contextPath}/pattern/BookAction!delete.action">图书删除</a><br>
<br><br>
使用通配符定义action<br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_add.action">图书添加</a><br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_delete.action">图书删除</a><br>
<br><br>
测试全局和局部的action<br>
<a href="${pageContext.request.contextPath}/pattern/BookAction_find.action">图书查询</a><br>
</body>
</html>
分享到:
相关推荐
<img src="${pageContext.request.contextPath}/checkcode.jsp"/> 另外在web.xml中配置验证码类的加载: <servlet> <servlet-name>CheckCodeImage</servlet-name> <servlet-class>...
例如,如果你有一个样式表 `style.css`,在JSP中引入它的正确方式是 `<link rel="stylesheet" href="${pageContext.request.contextPath}/style.css">`。 2. 统一资源定位:在使用Action或者Controller进行重定向或...
在JavaScript中,${pageContext.request.contextPath}是一个特殊表达式,它源于JavaServer Pages (JSP) 的Expression Language (EL),用于获取当前请求的应用上下文路径。应用上下文路径是Web应用程序在服务器上的根...
<form action="${pageContext.request.contextPath}/my/login" method="post"> <div>${message }</div> 邮箱:<input type="text" name="name"> <br> 密码: <input type="password" name="pwd"> <br> ...
<li><a href="${pageContext.request.contextPath}/student!list">学生信息管理</a></li> <li><a href="${pageContext.request.contextPath}/exam!list">学生作业情况查询</a></li> <li><a href="${pageContext....
开发者需要理解`<%=request.getContextPath()%>`获取应用的根路径,以及如何正确引用静态资源如CSS、JavaScript文件和图片。 3. **jdbc连接sqlserver2005.txt** 连接SQL Server 2005需要合适的驱动,如Microsoft ...
<li><img src = "${pageContext.request.contextPath}/resources/img/login/Desert."></li> <li> <img src = "${pageContext.request.contextPath}/resources/img/login/Whitebackground."> <div class = ...
value="${pageContext.request.contextPath }/common/plugins/calc/calc.swf"> <param name="flashvars" value="lcName=1165260.9155424985958207&&"> <param name="wmode" value="opaque"> ...
form id=”form0″ action=”${pageContext.request.contextPath}/news/baikeAdd.form” enctype=”multipart/form-data” method=”POST” target=”hidden_frame”> … … </form> <iframe name=’...
3、<form action="${pageContext.request.contextPath}/servlet/RegisterServlet" method="post"> 其中:“${pageContext.request.contextPath}”就是获取request的绝对路径,它的作用相当于“<%=pageContext....
<a href="${pageContext.request.contextPath}/updateCustomerAction.action">修改客户</a><br/> <a href="${pageContext.request.contextPath}/deleteCustomerAction.action">删除客户</a><br/> <a href="${...
//<br> out.println("已经成功上传乐文件,请查看<a href=upload/"+fn+">这里</a>,看文件是否上传成功");<br> }<br> catch(Exception e){<br> e.printStackTrace();<br> }<br> %><br>==============================...
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request....
<a href="${pageContext.request.contextPath}/download">Download</a> ``` 通过以上步骤,可以有效地实现Struts2中的文件上传和下载功能。这些功能对于构建复杂的应用程序来说是非常重要的组成部分。
link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extjs/pulgins/datetime/datetime.css" /> [removed][removed] [removed][removed] [removed][removed] [removed]...
<c:set var = "path" value = "${pageContext.request.contextPath }"></c:set> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <...
<img src="${pageContext.request.contextPath}/images/image1.jpg" alt="图片1描述"> <img src="${pageContext.request.contextPath}/images/image2.jpg" alt="图片2描述"> <!-- ... 更多图片 ... --> ``` `${...
form action="${pageContext.request.contextPath}/book?method=add" method="post"> <p>书籍名称:<input type="text" name="bookname" /> <p>书籍作者:<input type="text" name="bookauthor" />...
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/easyui.css"> <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script> ...