Javax.servlet..servlet which jar




















Use the getAttribute java. String method with an attribute name to get the value of an attribute. Returns: an Enumeration of attribute names See Also: getAttribute java. If the name specified is already used for an attribute, this method will replace the attribute with the new to the new attribute.

If listeners are configured on the ServletContext the container notifies them accordingly. If a null value is passed, the effect is the same as calling removeAttribute. Parameters: name - a String specifying the name of the attribute object - an Object representing the attribute to be bound removeAttribute void removeAttribute String name Removes the attribute with the given name from this ServletContext.

After removal, subsequent calls to getAttribute java. String to retrieve the attribute's value will return null. Parameters: name - a String specifying the name of the attribute to be removed getServletContextName String getServletContextName Returns the name of this web application corresponding to this ServletContext as specified in the deployment descriptor for this web application by the display-name element.

Returns: The name of the web application or null if no name has been declared in the deployment descriptor. The registered servlet may be further configured via the returned ServletRegistration object.

The specified className will be loaded using the classloader associated with the application represented by this ServletContext. If this ServletContext already contains a preliminary ServletRegistration for a servlet with the given servletName , it will be completed by assigning the given className to it and returned.

This method introspects the class with the given className for the ServletSecurity , MultipartConfig , javax. RunAs , and javax. DeclareRoles annotations. In addition, this method supports resource injection if the class with the given className represents a Managed Bean.

Parameters: servletName - the name of the servlet className - the fully qualified class name of the servlet Returns: a ServletRegistration object that may be used to further configure the registered servlet, or null if this ServletContext already contains a complete ServletRegistration for a servlet with the given servletName Throws: IllegalStateException - if this ServletContext has already been initialized IllegalArgumentException - if servletName is null or an empty String UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

If this ServletContext already contains a preliminary ServletRegistration for a servlet with the given servletName , it will be completed by assigning the class name of the given servlet instance to it and returned. Parameters: servletName - the name of the servlet servlet - the servlet instance to register Returns: a ServletRegistration object that may be used to further configure the given servlet, or null if this ServletContext already contains a complete ServletRegistration for a servlet with the given servletName or if the same servlet instance has already been registered with this or another ServletContext in the same container Throws: IllegalStateException - if this ServletContext has already been initialized UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

If this ServletContext already contains a preliminary ServletRegistration for a servlet with the given servletName , it will be completed by assigning the name of the given servletClass to it and returned. In addition, this method supports resource injection if the given servletClass represents a Managed Bean. Parameters: servletName - the name of the servlet servletClass - the class object from which the servlet will be instantiated Returns: a ServletRegistration object that may be used to further configure the registered servlet, or null if this ServletContext already contains a complete ServletRegistration for the given servletName Throws: IllegalStateException - if this ServletContext has already been initialized IllegalArgumentException - if servletName is null or an empty String UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The returned Servlet instance may be further customized before it is registered with this ServletContext via a call to addServlet String,Servlet. The given Servlet class must define a zero argument constructor, which is used to instantiate it. This method introspects the given clazz for the following annotations: ServletSecurity , MultipartConfig , javax. In addition, this method supports resource injection if the given clazz represents a Managed Bean. Parameters: clazz - the Servlet class to instantiate Returns: the new Servlet instance Throws: ServletException - if the given clazz fails to be instantiated UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

Returns: the complete or preliminary ServletRegistration for the servlet with the given servletName , or null if no ServletRegistration exists under that name Throws: UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The returned Map includes the ServletRegistration objects corresponding to all declared and annotated servlets, as well as the ServletRegistration objects corresponding to all servlets that have been added via one of the addServlet methods. If permitted, any changes to the returned Map must not affect this ServletContext. Returns: Map of the complete and preliminary ServletRegistration objects corresponding to all servlets currently registered with this ServletContext Throws: UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The registered filter may be further configured via the returned FilterRegistration object. If this ServletContext already contains a preliminary FilterRegistration for a filter with the given filterName , it will be completed by assigning the given className to it and returned. This method supports resource injection if the class with the given className represents a Managed Bean.

Parameters: filterName - the name of the filter className - the fully qualified class name of the filter Returns: a FilterRegistration object that may be used to further configure the registered filter, or null if this ServletContext already contains a complete FilterRegistration for a filter with the given filterName Throws: IllegalStateException - if this ServletContext has already been initialized IllegalArgumentException - if filterName is null or an empty String UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

If this ServletContext already contains a preliminary FilterRegistration for a filter with the given filterName , it will be completed by assigning the class name of the given filter instance to it and returned. Parameters: filterName - the name of the filter filter - the filter instance to register Returns: a FilterRegistration object that may be used to further configure the given filter, or null if this ServletContext already contains a complete FilterRegistration for a filter with the given filterName or if the same filter instance has already been registered with this or another ServletContext in the same container Throws: IllegalStateException - if this ServletContext has already been initialized IllegalArgumentException - if filterName is null or an empty String UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

If this ServletContext already contains a preliminary FilterRegistration for a filter with the given filterName , it will be completed by assigning the name of the given filterClass to it and returned.

This method supports resource injection if the given filterClass represents a Managed Bean. Parameters: filterName - the name of the filter filterClass - the class object from which the filter will be instantiated Returns: a FilterRegistration object that may be used to further configure the registered filter, or null if this ServletContext already contains a complete FilterRegistration for a filter with the given filterName Throws: IllegalStateException - if this ServletContext has already been initialized IllegalArgumentException - if filterName is null or an empty String UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The returned Filter instance may be further customized before it is registered with this ServletContext via a call to addFilter String,Filter. The given Filter class must define a zero argument constructor, which is used to instantiate it.

This method supports resource injection if the given clazz represents a Managed Bean. Parameters: clazz - the Filter class to instantiate Returns: the new Filter instance Throws: ServletException - if the given clazz fails to be instantiated UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener. Returns: the complete or preliminary FilterRegistration for the filter with the given filterName , or null if no FilterRegistration exists under that name Throws: UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The returned Map includes the FilterRegistration objects corresponding to all declared and annotated filters, as well as the FilterRegistration objects corresponding to all filters that have been added via one of the addFilter methods. Any changes to the returned Map must not affect this ServletContext. Returns: Map of the complete and preliminary FilterRegistration objects corresponding to all filters currently registered with this ServletContext Throws: UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

Repeated invocations of this method will return the same SessionCookieConfig instance. Returns: the SessionCookieConfig object through which various properties of the session tracking cookies created on behalf of this ServletContext may be configured Throws: UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.

The given sessionTrackingModes replaces any session tracking modes set by a previous invocation of this method on this ServletContext. SSL , or if sessionTrackingModes specifies a session tracking mode that is not supported by the servlet container Since: Servlet 3. The session tracking modes in effect are those provided to setSessionTrackingModes. By default, the session tracking modes returned by getDefaultSessionTrackingModes are in effect.

ServletContext , then the class with the given name may also implement ServletContextListener , in addition to the interfaces listed above. As part of this method call, the container must load the class with the specified class name to ensure that it implements one of the required interfaces.

If the class with the given name implements a listener interface whose invocation order corresponds to the declaration order i. Parameters: className - the fully qualified class name of the listener Throws: IllegalArgumentException - if the class with the given name does not implement any of the above interfaces, or if it implements ServletContextListener and this ServletContext was not passed to ServletContainerInitializer.

ServletContext , then the given listener may also be an instance of ServletContextListener , in addition to the interfaces listed above. If the given listener is an instance of a listener interface whose invocation order corresponds to the declaration order i. Parameters: t - the listener to be added Throws: IllegalArgumentException - if the given listener is not an instance of any of the above interfaces, or if it is an instance of ServletContextListener and this ServletContext was not passed to ServletContainerInitializer.

ServletContext , then the given listenerClass may also implement ServletContextListener , in addition to the interfaces listed above. If the given listenerClass implements a listener interface whose invocation order corresponds to the declaration order i.

This method supports resource injection if the given listenerClass represents a Managed Bean. Parameters: listenerClass - the listener class to be instantiated Throws: IllegalArgumentException - if the given listenerClass does not implement any of the above interfaces, or if it implements ServletContextListener and this ServletContext was not passed to ServletContainerInitializer.

The returned EventListener instance may be further customized before it is registered with this ServletContext via a call to addListener EventListener. The given EventListener class must define a zero argument constructor, which is used to instantiate it.

Since: Servlet 3. If a security manager exists, and the caller's class loader is not the same as, or an ancestor of the requested class loader, then the security manager's checkPermission method is called with a RuntimePermission "getClassLoader" permission to check whether access to the requested class loader should be granted. Roles that are implicitly declared as a result of their use within the setServletSecurity or setRunAsRole methods of the ServletRegistration interface need not be declared.

Need the JAR file for a javax. HttpServletRequest [duplicate] Ask Question. Asked 7 years, 4 months ago. Active 5 years, 3 months ago. Viewed 65k times. Improve this question. Moon Moon You need the servlet api. It is generally provided by your servlet container.

You could, but no. Your websphere installation will have the servlet-api somewhere. Otherwise, you can get it here. SotiriosDelimanolis which version 3. You can include Tomcat dependencies in Maven via the tomcat-servlet-api and tomcat-jsp-api jars.

One exists for each version of Tomcat. Usually adding these with scope provided is sufficient. Add a comment. Use is subject to license terms. Skip navigation links. Package javax. Interface Summary Interface Description AsyncContext Class representing the execution context for an asynchronous operation that was initiated on a ServletRequest.

Listener that will be notified in the event that an asynchronous operation initiated on a ServletRequest to which the listener had been added has completed, timed out, or resulted in an error. A filter is an object that performs filtering tasks on either the request to a resource a servlet or static content , or on the response from a resource, or both.

A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource.

A filter configuration object used by a servlet container to pass information to a filter during initialization. Interface through which a Filter may be further configured. Interface through which a Filter registered via one of the addFilter methods on ServletContext may be further configured.

This class represents a call-back mechanism that will notify implementations as HTTP request data becomes available to be read without blocking. Interface through which a Servlet or Filter may be further configured. Interface through which a Servlet or Filter registered via one of the addServlet or addFilter methods, respectively, on ServletContext may be further configured.

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.



0コメント

  • 1000 / 1000