易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP 绝对路径 终极解决方案

context.xml 文件夹中
<Context path="/wap"
docBase="D:\IDE\MyEclipse\wap\WebRoot" reloadable="false" >
request.getContextPath(); -==> /wap
this.getServletContext().getRealPath("") ;// D:\IDE\MyEclipse\wap\WebRoot


相关文档:

jsp标准动作

//下面,从请求中得到属性 为一个 类,,会判断是否为null,,如为null则实例化
// id 值  相当于  class 的 对象名
<jsp:useBean id="order" class="com.entity.Order" scope="request" />
<==>
<%
 Order order=(Order)request.getAttribute("order");
 if(order==null)
  ......

jsp中的include静态页面出现乱码问题

在当前应用系统的web.xml里加入jsp-config代码:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<jsp-config>
< ......

JSP中页面自动定时刷新


1.JSP中页面定时刷新
Java
代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3C%25%0A%20%20 ......

jsp端口检测以及域名检测

<tr>
<td height="30" align="right">域名:</td>
<td align="left"><input name="domain" type="text" class="input" value="<%=request.getServerName()%>"/></td>
<td align="left">系统已经检测出您的域名,请勿改动</td>
</t ......

JSP页面传值中文乱码的简单解决方法

源代码,a.jsp往b.jsp传值:
a.jsp页面内容
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<form action="b.jsp">
  name:<input type=text name=name>
  <input type=submit>
</form>
b.jsp页面内容:
<%@ page language="java" import="java.ut ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号