1. Response basics:
public void ServletResponse.setContentType(String); //content type of response
pubic PrintWriter ServletResponse.getWriter(); //charactor output
public ServletOutStream ServletResponse.getOutputStream(); //Stream output
2. Response buffering
ServletResponse.setBufferSize(int); //set buffer size
ServletResponse.getBufferSize(int); //get buffer size
ServletResponse.isCommited() // is sent?
ServletResponse.reset(); // reset,clear all buffer content
ServletResponse.flushBuffer(); //sent
3.Status Codes : public static final int fields of HttpServletResponse
HttpServletResponse.sendStatus(in t sc); //set status, should be called before committed.
HttpServletResponse.sendError(.., ..), //send error and clean buffer.
4. setting a Http Header: HttpServletResponse.setHeader(..,..) and so on.
5. redirecting a request:
HttpServletResponse.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); HttpServletResponse.setHeader("Location", site)
EQUALS TO
HttpServletResponse.sendRedirect(site);
6. Error Pages configured in web.xml:
<error-page> <error-code>code</error-code><location>/error.html</location></error-page>
7. Logging: GenericServlet.log(String, [...]);
8. Configure exception page in web.xml: <error-page> <exception-type> class </exception-type> <location>./pathname</location></error-page>
9. dynamically creating a exception(error) page : mainly using request.getAttribute("javax.servlet.error.status_code"); request.getAttribute("javax.servlet.error.message"); request.getAttribute("javax.servlet.error.exception_type");
10. A long-running servlet that doesn't mind committing the response early should call checkError() regularly to determine if it can halt processing before completion.
分享到:
相关推荐
**Burp Suite 手册-041-Sending requests between tools.pdf** Burp Suite 是一款广泛使用的网络安全测试工具,尤其在Web应用安全测试领域中占有重要地位。它提供了一整套功能,帮助测试人员发现、分析和利用潜在的...
Document for project manage
SPI(Serial Peripheral Interface)是一种同步串行通信接口,广泛用于微控制器和其他电子设备之间进行数据交换。在本案例中,我们关注的是STC12C5A60S2单片机作为SPI主机的角色,以及如何通过SPI协议发送查询来获取...
【文件名称列表】"calo-landing-page-with-mail-sending-master" 暗示这是一个GitHub仓库的主分支,可能包含以下关键文件和目录: 1. `index.php`:这个文件可能是项目的入口点,包含了HTML结构和PHP代码,用于处理...
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. -------------------------------------------------------------------------------- G ...
使用KotlinJs的Chrome扩展程序用KotlinJs编写的简单的chrome扩展名,用于显示当前url。 建造: ./gradlew compileKotlin2Jscd extensionnpm install安装: Chrome-> Extensions ->启用Developer Mode -> Load ...
而"J2EE add-on for sending mail (SMTP)"则是针对J2EE平台的一个扩展,主要用于帮助开发者实现邮件发送功能。这个开源项目名为J2EEMAIL,它简化了Java应用程序通过SMTP(Simple Mail Transfer Protocol)协议发送...
用于发送带有附件的电子邮件的脚本 此脚本用于向DSC SASTRA视为大学的核心团队成员发送带有附件的批量电子邮件。 该脚本可能不是最好的脚本,但仍然可以正常工作。 笔记: Google Apps脚本是一种JavaScript云脚本...
NULL 博文链接:https://sap.iteye.com/blog/832453
【信息安全与数据安全:应对机器无法处理的威胁】 在当今的数字时代,信息安全与数据安全已经成为企业生存和发展的重要基石。随着大数据的崛起和法律法规的不断完善,企业必须加强自身的安全建设,以抵御日益复杂的...
7.2 SENDING AN IDOC------------------------------52 7.3 CHANGING AN IDOC---------------------------52 7.4 CHANGING AN IDOC’S STATUS-----------53 7.5 READING AN IDOC-----------------------------53 ...
Here is the method CTestEmailDlg::OnSend method, which is used to pass the user specified information to the email object and call the IMail::Send method after setting everything. Collapse | Copy ...
《Python邮件发送库mail_sending_program详解》 Python作为一种强大且易学的编程语言,在开发领域广泛应用,尤其在后端开发中,Python以其丰富的库资源备受青睐。在众多的Python库中,`mail_sending_program-1.3-py...
**PyPI 官网下载 | mail_sending_program-0.0.4-py3-none-any.whl** 在Python编程环境中,PyPI(Python Package Index)是官方的第三方库分发平台,开发者可以在这里发布自己的Python模块供他人使用。标题中的"PyPI...
在USB4规范1.0版本中,"Sending TS2 After Bonding State"的工程变更通知(Engineering Change Notice,简称ECN)着重于调整了在连接建立(Bonding)后的TS2传输规则,以更好地适应当前生态系统的需求并提供更全面的...
资源来自pypi官网。 资源全名:mail_sending_program-1.3-py3-none-any.whl
剧本管理后台CMS generated with [Scaffold] RW Scaffold (https://redwoodjs.com/docs/how-to/sending-emails#scaffold) Authentication managed by [dbAuth] (https://redwoodjs.com/docs/authentication)剧本浏览...
快速生成邮件模板.zip,A Node.js package that generates clean, responsive HTML e-mails for sending transactional mail.
USB4 1.0 ECN - Adding Timeout for Sending LFPS on CLx Exit USB4 1.0 ECN(Engineering Change Notice,工程变更通知)是一种用于改进 USB4 1.0 规范的技术文档。该文档的主要内容是添加超时机制,以避免在 CLx ...