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

JSP文件

<%@ page language="java" import="kg.TestBean2;" %>
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>HelloBean</title>
</head>
<body>
<%--
<%
kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean");
if(testbean==null){
testbean = new kg.TestBean2();
session.setAttribute("testbean",testbean);
}
%>
--%>
<jsp:useBean id="testbean" class="kg.TestBean2" scope="page" />
<%--
<jsp:setProperty name="testbean" property="myText" />
<jsp:getProperty name="testbean" property="myText"/>
<jsp:setProperty name="testbean" property="myPassword"/>
<jsp:getProperty name="testbean" property="myPassword"/>
--%>
<jsp:setProperty name="testbean" property="*"/>
用户名:<%=new String(testbean.getMyText().getBytes("ISO8859_1"),"GBK")%>
密码:<%=testbean.getMyPassword()%>
</body>
</html>


相关文档:

仿百度ajax搜索提示(jsp)

<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>index</title>
<meta http-equiv="pragma" content="no-cache"&g ......

jsp生成html静态页面代码

<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//在这里如果写成“WEB-INF\templates\template.htm”程序会报错
 String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......

让html以及jsp页面不被缓存

对于HTM网页,加入:
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
然后,jsp页面中加入:
<%
     response.setHeader("Cache-Control","no-store") ......

JSP文件

<%@ page language="java" import="kg.TestBean2;" %>
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>HelloBean</title>
</head>
<body>
<%--
<%
kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean");
if ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号