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

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-property-group>
<description>
Special property group for JSP Configuration JSP example.
</description>
<display-name>JSPConfiguration</display-name>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
<page-encoding>GB2312</page-encoding>
<scripting-invalid>false</scripting-invalid>
<include-prelude></include-prelude>
<include-coda></include-coda>

<description>
Special property group for JSP Configuration JSP example.
</description>
<display-name>JSPConfiguration</display-name>
<url-pattern>*.html</url-pattern>
<el-ignored>true</el-ignored>
<page-encoding>GB2312</page-encoding>
<scripting-invalid>false</scripting-invalid>
<include-prelude></include-prelude>
<include-coda></include-coda>
</jsp-property-group>
</jsp-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
... ...
</webapp>
说明:<jsp-config>里的定义,就是通知当前应用服务器,当前应用系统下,所有的 .jsp, .html 文件,若是没有定义contentType="text/html;charset=gb2312" 时,就会采用预设的 "GB2312" 字符集去处理,如此,就不须要在每个 include 的档案第一行加上 contentType="text/html;charset=gb2312" 了。


相关文档:

求jsp高手帮帮忙

我刚学jsp,找了一个网站想配置好环境,然后改改,可是遇到一个问题,不懂怎么解决。请大家帮帮我!
问题如下:我装的环境是:eclipse+MyEclipse5.5+sql2000+tomcat5.5运行后出现:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this r ......

jsp九种内置对象

request, reponse, out, session, application, config, pagecontext, page, exception.

一.request对象:该对象封装了用户提交的信息,通过调用该对象相应的方法可以获取封装的信息,即使用该对象可以获取用户提交信息。
1.Request对象可以使用getParameter(string s)方法获取该表单通过text提交的信息。如:
Requ ......

jsp提交表单的乱码问题

简单的说吧。
request的默认编码方式是ISO-8859-1。
jsp/html里面的charset属性是解码的字符集。
我们要统一用utf-8的编码方式。
所以要对request的编码方式进行设置,这样写:
request.seCharacterEncoding("utf-8");
然后把数据库的编码方式也设成utf-8.
然后就不会有乱码出现了。
乱码问题算是web开发中经常遇到 ......

jsp写的验证码

第一步:建立一个code.jsp的页面,产生随机码
   <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"
     import="java.io.*,
          java.util.*,
       & ......

jsp标准动作

//下面,从请求中得到属性 为一个 类,,会判断是否为null,,如为null则实例化
// id 值  相当于  class 的 对象名
<jsp:useBean id="order" class="com.entity.Order" scope="request" />
<==>
<%
 Order order=(Order)request.getAttribute("order");
 if(order==null)
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号