JSP的九个隐含对象
一、page 对象
page对象代表JSP本身,更准确地说它代表JSP被转译后的Servlet,它可以调用Servlet类所定义的方法。
二、config 对象
config 对象里存放着一些Servlet 初始的数据结构。
config 对象实现于javax.servlet.ServletConfig 接口,它共有下列四种方法:
public String getInitParameter(name)
public java.util.Enumeration getInitParameterNames( )
public ServletContext getServletContext( )
public Sring getServletName( )
三、request 对象
request 对象包含所有请求的信息,如:请求的来源、标头、cookies和请求相关的参数值等等。
request 对象实现javax.servlet.http.HttpServletRequest接口的,所提供的方法可以将它分为四大类:
1.储存和取得属性方法;
void setAttribute(String name, Object value) 设定name属性的值为value
Enumeration getAttributeNamesInScope(int scope) 取得所有scope 范围的属性
Object getAttribute(String name) 取得name 属性的值
void removeAttribute(String name) 移除name 属性的值
2.取得请求参数的方法
String getParameter(String name) &
相关文档:
一、page 对象
page对象代表JSP本身,更准确地说它代表JSP被转译后的Servlet,它可以调用Servlet类所定义的方法。
二、config 对象
config 对象里存放着一些Servlet 初始的数据结构。
config 对象实现于javax.servlet.ServletConfig 接口,它共有下列四种方法:
......
Actio中传递参数
request.setAttribute("userName",fbName);
request.setAttribute("passWord",pwd);
request.setAttribute("CDNUrl",CDNUrl);
-------------------------------------------------------------------
AC_FL_RunContent(
'codebase', 'http://download.macromed ......
Jsp 以Url方式传参数乱码问题
比如说 xxxx.action?name="中文"
传到Action 会发生 乱码
解决方法1:要改tomcat 的编码
2:
要改成这个方式可以解决乱码:
xxxx.action?name=encodeURIComponent("中文"); ......
<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="tet/css" href="mystyle.css" ?>
<%@ page errorPage="error.jap" %>
<%@ page contentType="text/xml" %>
<realmarid>
皇马花名册
<athlete>
<name>齐达内</name>
<country> ......