
jsp/servlet
iteye_14814
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
jsp中的request.getContextPath()
<%=request.getContextPath()%>是为了解决相对路径的问题,可返回站点的根路径。 但不用也可以吧,比如<a href="<%=request.getContextPath()%>/catalog.jsp">我就直接用<a href="catalog.jsp">也行啊,这两个文件是在同一个目录下的 比如你要生成一个文件放...原创 2012-04-16 19:16:42 · 95 阅读 · 0 评论 -
fn函数使用
直接找fn.tld的文件放到WEB-INF下面,然后在web.xml里面<jsp-config> <taglib> <taglib-uri>fn</taglib-uri> <taglib-location>/WEB-INF/fn.tld</taglib-location> </taglib>&原创 2012-05-10 21:14:51 · 365 阅读 · 0 评论 -
自定义JSTL函数
public class SecurityFunction {//方法需要是static类型的 public static String testJstlFunction(String str) { System.out.println("执行一些操作"+str); return "hello jstl"; }} <?xml version="1.0" encoding="UTF...原创 2012-05-11 15:36:50 · 90 阅读 · 0 评论 -
${pageContext.request.contextPath} JSP取得绝对路径
1)采用绝对路径,但为了解决不同部署方式的差别,在所有非struts标签的路径前加${pageContext.request.contextPath},如原路径为: ”/images/title.gif”,改为 “${pageContext.request.contextPath}/images/title.gif”。 代码” ${pageContext.request.contextP...原创 2012-05-15 15:28:16 · 177 阅读 · 0 评论 -
servlet跳转到struts1
通过 getServletConfig().getServletContext().getRequestDispatcher(jumpAddress).forward(request, response); 跳转到struts1. 需要配置servlet原创 2012-05-22 17:52:35 · 136 阅读 · 0 评论 -
jsp页面转码
new String(xsjxj.getBytes("ISO8859_1"));原创 2012-06-08 19:09:28 · 293 阅读 · 0 评论