jsp
共 5 篇文章
java 自定义标签 实例
自定义标签制作步骤: 1.扩展TagSupport 2.标签所对应的tld文件配置 3.在JSP页面引用tld配置文件并使用标签 标签制作常用方法说明: doStartTag()和doEndTag()返回值处理: SKIP_BODY (0) :跳过了开始和结束标签之间的代码。 EVAL_BODY_INCLUDE(1):将body的内容输出到存在的输出流中 SKIP_PAGE(5): 忽略剩下的页面。 EVAL_PAGE隐含(6):继续执行下面的页 实例制作: (1)index.jsp <%@ page language="java" pageEncoding="UTF-8"%> <%@ ta…
2011-10-07 09:45 · jsp · Java · bodytagsupport · tagext
一个错误 According to TLD or attribute directive in tag file, attribute test ..
应用部署运行的时候出现JSP异常, 发生在使用JSTL库的时候: According to TLD or attribute directive in tag file, attribute value does not accept any expressions, 可能是因为使用了JSP2.0版本, 同时又没有使用JSTL core库的备用版本(RT库), 以下有两种处理方法: 修改web.xml. JSTL core库的有两种taglib伪指令, 其中RT库即是依赖于JSP传统的请求时属性值, 而不是依赖于EL来实现(称为EL库.JSP2.0将支持EL) JSP中使用<%@ tagli…
2011-10-03 15:51 · jsp
jsp中页面关闭时关闭session,cookie,页面缓存
一、清除页面缓存 在jsp页里 <%response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); response.flushBuffer();%> 在html页里 二、清除cookie <% Cookie killMyCookie = new Cookie("mycookie", null); killMyCookie.setMaxAge(0); killMyCookie.setPath("/"); …
2011-09-29 22:40 · jsp
request.getRequestURL()和request.getRequestURI() 区别
request.getRequestURL()和request.getRequestURI() 区别 request.getRequestURI() 返回值类似:/myContext/requestdemo.jsp 返回值是String request.getRequestURL() 返回值类似:http://localhost:8080/myContext/requestdemo.jsp 返回值是StringBuffer
2010-11-04 11:07 · jsp · JSP
jsp内置对象的详解(转载)
1.request对象 客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。 序号 方 法 说 明 1 object getAttribute(String name) 返回指定属性的属性值 2 Enumeration getAttributeNames() 返回所有可用属性名的枚举 3 String getCharacterEncoding() 返回字符编码方式 4 int getContentLength() 返回请求体的长度(以字节数) 5 String getContentType() 得到请求体的…
2010-09-23 09:10 · jsp · 应用服务器 · JSP · 编程 · 虚拟机 · Servlet