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

jsp页面 URL传中文参数到Action里面出现乱码

解决方法:
第一种:在Action中用 new String(str.getBytes("ISO8859_1"), "UTF8"),进行转码,因为传递的时候,中文默人的是ISO8859_1
 
第二种:可通过配置TOMCAT来解决此问题,具体解决方法如下:在tomcat的server.xml里,找到<Connector port="8080" useBodyEncodingForURI="true" URIEncoding="utf-8">
其中是修改useBodyEncodingForURI="true" URIEncoding="utf-8" 其方法是防止在url中出现乱码
然后在每个Jsp页面添加如下代码
<%@ page pageEncoding=” utf-8″%>
<%@ page contentType=”text/html;charset= utf-8″%>
<%request.setCharacterEncoding(” utf-8″);%>


相关文档:

Google App Engine: RUN JSP ERROR

I used Eclipse to try the google app engine demo project: guestbook.
when i create a *.jsp file in the WAR directory,the error information appear:
"Your Web Application Project must be configured to use a JDK in order to use JSPs."
solution:
It is because Eclipse put the JRE to the JRE directory ......

JSP的分页实现!

package com.gc.tool;
import java.util.ArrayList;
import java.util.List;
public class MyPagination {
    private int recordCount = 0;
   
    private int pagesize = 0;
   
    private int maxPage = 0;
  &n ......

html、asp、php、jsp 禁止缓存的方法

HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP:
header("Expires: Mon, 26 Jul 1997 ......

jsp:setProperty标签

jsp:setProperty标签用于设置被加载到当前页面中的JavaBean中属性的值
格式:<jsp:setProperty name=? property=? value=?(或param=?) />
name:某个JavaBean的对象名,用于指定给哪个JavaBean中的属性赋值
property:JavaBean中的某个属性名,用于指定给当前JavaBean中的哪个属性赋值
    & ......

jsp:getProperty标签

jsp:getProperty标签用于获取被加载到当前页面中的JavaBean中某个属性的值
格式:<jsp:getProperty name=? property=? />
name:JavaBean的对象名,用于指定从哪个JavaBean中获取属性值
property:JavaBean中的属性名,用于指定获取JavaBean中的哪个属性值
        &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号