
servlet
文章平均质量分 80
gmemai
这个作者很懒,什么都没留下…
展开
-
Servlets Tutorial
Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. Servlets have access to the entire family of Ja转载 2015-08-29 04:49:36 · 306 阅读 · 0 评论 -
The Java EE 6 Tutorial The mood Example Application
The mood example application, located in the tut-install/examples/web/mood/ directory, is a simple example that displays Duke’s moods at different times during the day. The example shows how to develop转载 2015-08-30 15:53:18 · 451 阅读 · 0 评论 -
Session or cookie confusion
I’ve seen in some websites that user signed in into their accounts and then closed the browser. After closed and re-opened the browser and their accounts are still signed in. But some websites, canno转载 2015-08-31 02:47:44 · 500 阅读 · 0 评论 -
What is the difference between GenericServlet, HttpServlet and a Servlet?
Servlet is an interface defining what a servlet must implement. GenericServlet is just that, a generic, protocol-independent servlet. HttpServlet is a servlet tied specifically to the HTTP protocol.I转载 2015-08-31 03:26:25 · 611 阅读 · 0 评论 -
Tomcat's Java Servlet Examples Explained
Tomcat provides a number of excellent servlet examples in “<CATALINA_HOME>\webapps\examples“. The servlet source files are kept under “<CATALINA_HOME>\webapps\examples\WEB-INF\classes“, together with t转载 2015-08-31 05:45:00 · 732 阅读 · 0 评论 -
Java Servlet完全教程
Servlet是一些遵从Java Servlet API的Java类,这些Java类可以响应请求。尽管Servlet可以响应任意类型的请求,但是它们使用最广泛的是响应web方面的请求。 Servlet必须部署在Java servlet容器才能使用。虽然很多开发者都使用Java Server Pages(JSP)和Java Server Faces(JSF)等Servlet框架,但是这些技术都要在幕后转载 2015-08-31 03:52:09 · 366 阅读 · 0 评论 -
Filter that uses a response wrapper to convert all output to uppercase
import java.io.CharArrayWriter;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.Filter;import javax.servlet.FilterChain;import javax.servlet.FilterConfig;import javax.ser转载 2015-09-01 05:14:20 · 433 阅读 · 0 评论 -
Looking for an example for inserting content into the response using a servlet filter
I’ve been searching the net and stackoverflow for an example of somebody inserting content into the response using a servlet filter, but can only find examples of people capturing/compressing the outpu转载 2015-09-01 05:42:14 · 867 阅读 · 0 评论 -
JSP - Custom Tags
A custom tag is a user-defined JSP language element. When a JSP page containing a custom tag is translated into a servlet, the tag is converted to operations on an object called a tag handler. The Web转载 2015-09-01 08:20:10 · 516 阅读 · 0 评论 -
Where is JSESSIONID stored? (JavaEE)
I have two applications - A Java EE web application and a Java SE applet. I want to authenticate a user in the applet by means of a JSESSIONID (which is created by the web application). So there is a转载 2015-08-31 03:17:54 · 532 阅读 · 0 评论 -
How to properly logout of a Java EE 6 Web Application after logging in
You should have logout servlet/jsp which invalidates the session using the following ways:- Before Servlet 3.0, using `session.invalidate()` method which invalidates the session also.- Servlet 3.0 pro转载 2015-08-31 03:10:24 · 386 阅读 · 0 评论 -
Java EE 6: How to implement “Stay Logged In” when user login in to the web application
I am using Form-based authentication provided by GlassFish v3 btw. Most of the website, when the user about to provide the username and password to log into the system, it has a checkbox “Stay logged转载 2015-08-31 03:34:22 · 762 阅读 · 0 评论 -
Modify html response using filter
There may be instances where you want to modify the response before it is written to the client. In this tutorial we will show how to write a regex to append to a html element.I was working on a projec转载 2015-09-01 05:28:46 · 565 阅读 · 0 评论 -
ServletContextListener使用详解
在 Servlet API 中有一个 ServletContextListener 接口,它能够监听ServletContext对象的生命周期,实际上就是监听Web应用的生命周期。当Servlet 容器启动或终止Web 应用时,会触发ServletContextEvent事件,该事件由 ServletContextListener来处理。在ServletContextListener接口中定义了处理转载 2015-09-10 13:35:49 · 344 阅读 · 0 评论 -
web.xml Servlet Configuration
For a Java servlet to be accessible from a browser, you must tell the servlet container what servlets to deploy, and what URL’s to map the servlets to. This is done in the web.xml file of your Java web转载 2015-08-30 17:59:28 · 499 阅读 · 0 评论 -
HttpRequest
The HttpServlet class request processing methods take two parameters. javax.servlet.http.HttpRequest javax.servlet.http.HttpResponseFor instance, here is the signature of the HttpServlet.doGet()转载 2015-08-30 16:32:07 · 451 阅读 · 0 评论 -
Servlet Overview
What is a Servlet?A Java Servlet is a Java object that responds to HTTP requests. It runs inside a Servlet container. Here is an illustration of that: A Servlet is part of a Java web application. A转载 2015-08-30 16:15:30 · 392 阅读 · 0 评论 -
Servlets - Overview
What are Servlets?Java Servlets are programs that run on a Web or Application server and act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applicat转载 2015-08-29 04:55:47 · 341 阅读 · 0 评论 -
The Java EE 6 Tutorial Creating and Initializing a Servlet
Use the @WebServlet annotation to define a servlet component in a web application. This annotation is specified on a class and contains metadata about the servlet being declared. The annotated servlet转载 2015-08-29 09:13:35 · 370 阅读 · 0 评论 -
The Java EE 6 Tutorial
Servlets are Java classes which service HTTP requests and implement the javax.servlet.Servletinterface. Web application developers typically write servlets that extend javax.servlet.http.HttpServlet, a转载 2015-08-29 08:45:51 · 527 阅读 · 0 评论 -
The Java EE 6 Tutorial Accessing the Web Context
The context in which web components execute is an object that implements the ServletContext interface. You retrieve the web context by using the getServletContext method. The web context provides metho转载 2015-08-30 14:46:10 · 396 阅读 · 0 评论 -
HttpServlet
The javax.servlet.http.HttpServlet class is a slightly more advanced base class than the GenericServlet shown in the Simple Servlet example.The HttpServlet class reads the HTTP request, and determines转载 2015-08-30 16:26:02 · 315 阅读 · 0 评论 -
The Java EE 6 Tutorial Finalizing a Servlet
The web container may determine that a servlet should be removed from service (for example, when a container wants to reclaim memory resources or when it is being shut down). In such a case, the contai转载 2015-08-30 15:49:36 · 353 阅读 · 0 评论 -
Cookies and Servlets
HTTP Cookies are little pieces of data that a web application can store on the client machine of users visiting the web application. Typically up to 4 kilo bytes of data. This text will explain how to转载 2015-08-30 18:23:00 · 323 阅读 · 0 评论 -
The Java EE 6 Tutorial Writing Service Methods
The service provided by a servlet is implemented in the service method of a GenericServlet, in the doMethod methods (where Method can take the value Get, Delete, Options, Post, Put, or Trace) of an Htt转载 2015-08-29 15:35:53 · 355 阅读 · 0 评论 -
The Java EE 6 Tutorial Maintaining Client State
Many applications require that a series of requests from a client be associated with one another. For example, a web application can save the state of a user’s shopping cart across requests. Web-based转载 2015-08-30 14:51:34 · 415 阅读 · 0 评论 -
RequestDispatcher
The RequestDispatcher class enables your servlet to “call” another servlet from inside another servlet. The other servlet is called as if an HTTP request was sent to it by a browser.You can obtain a Re转载 2015-08-30 17:08:15 · 447 阅读 · 0 评论 -
Servlet Life Cycle
A servlet follows a certain life cycle. The servlet life cycle is managed by the servlet container. The life cycle contains the following steps:Load Servlet Class.Create Instance of Servlet.Call the转载 2015-08-30 16:20:10 · 516 阅读 · 0 评论 -
Java Servlet Example
A Java Servlet is just an ordinary Java class which implements the interfacejavax.servlet.Servlet;The easiest way to implement this interface is to extend either the class GenericServlet or HttpServlet转载 2015-08-30 16:21:40 · 514 阅读 · 0 评论 -
HttpSession
The HttpSession object represents a user session. A user session contains information about the user across multiple HTTP requests.When a user enters your site for the first time, the user is given a u转载 2015-08-30 17:04:47 · 327 阅读 · 0 评论 -
[顶]Different ways of loading a file as an InputStream
What’s the difference between:InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName)andInputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileN转载 2015-09-10 16:51:01 · 441 阅读 · 0 评论