分享
 
 
 

javax.servlet.RequestDispatcher翻译

王朝java/jsp·作者佚名  2006-04-12
窄屏简体版  字體: |||超大  

[/url]

[url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES

All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.servlet

Interface RequestDispatcher

public interface RequestDispatcher

Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name. 定义了一个对象用来接收客户端的请求,将它们发送给服务器上的任何资源(比如servlet,HTML文件,或者JSP文件)。 servlet容器创建了RequestDispatcher对象,用于包装以特定路径或特定名称定位的服务器资源。

This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource. 该接口目的是包装servlet,但是servlet容器创建的RequestDispatcher可以包装任何类型的资源。

Version: $Version$ Author: Various See Also: ServletContext.getRequestDispatcher(java.lang.String), ServletContext.getNamedDispatcher(java.lang.String), ServletRequest.getRequestDispatcher(java.lang.String)

Method Summary

void

forward(ServletRequest request, ServletResponse response)

Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. 从servlet向服务器上其他资源(servlet,JSP文件或者HTML文件)转发请求。

void

include(ServletRequest request, ServletResponse response)

Includes the content of a resource (servlet, JSP page, HTML file) in the response. 包含响应中的资源(servlet,JSP文件,HTML文件)内容。

Method Detail

forward

public void forward(ServletRequest request,

ServletResponse response)

throws ServletException,

IOException

Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response. 从servlet向服务器上其他资源(servlet,JSP文件或者HTML文件)转发请求。该方法允许请求和其他资源生成响应之前做一些预处理。

For a RequestDispatcher obtained via getRequestDispatcher(), the ServletRequest object has its path elements and parameters adjusted to match the path of the target resource. 对于通过getRequestDispatcher()获得的RequestDispatcher,ServletRequest对象可以调整路径组成和参数来匹配目标资源的路径。

forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward. forward应当在响应提交给客户端之前调用(响应体输出被刷新前)。如果响应已经被提交,该方法抛出IllegalStateException。响应缓存中未提交的输出在转发之前自动清空。

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them. 传递给调用servlet的service方法的请求和响应参数可以是相同的对象,也可以是 对它们进行包装的ServletRequestWrapper或ServletResponseWrapper类的子类。

Parameters: request - a ServletRequest object that represents the request the client makes of the servlet ServletRequest对象,表示客户端向servlet发出的请求 response - a ServletResponse object that represents the response the servlet returns to the client ServletResponse对象,表示servlet返回给客户端的响应 Throws: ServletException - if the target resource throws this exception 如果目标资源抛出该异常时抛出 IOException - if the target resource throws this exception 如果目标资源抛出该异常时抛出 IllegalStateException - if the response was already committed 如果响应已经提交则抛出

include

public void include(ServletRequest request,

ServletResponse response)

throws ServletException,

IOException

Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes. 包含响应中的资源(servlet,JSP文件,HTML文件)内容。本质上,该方法使服务器端包含成为可能。

The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored. 来自调用者的ServletResponse对象的路径组成和参数保持不变。包含的servlet 不能改变响应状态代码或设置头;任何变更的企图都会被忽略。

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them. 传递给调用servlet的service方法的请求和响应参数可以是相同的对象,也可以是 对它们进行包装的ServletRequestWrapper或ServletResponseWrapper类的子类。

Parameters: request - a ServletRequest object that contains the client's request ServletRequest对象,表示客户端请求 response - a ServletResponse object that contains the servlet's response ServletResponse对象,表示servlet响应 Throws: ServletException - if the included resource throws this exception 如果包含的资源抛出该异常时抛出 IOException - if the included resource throws this exception 如果包含的资源抛出该异常时抛出[/url]

[url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES

All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有