Which jar javax.servlet.servletcontext
Parameters: message - a String that describes the error or exception throwable - the Throwable error or exception getRealPath String getRealPath String path Gets the real path corresponding to the given virtual path. The real path returned will be in a form appropriate to the computer and operating system on which the servlet container is running, including the proper path separators. This method returns null if the servlet container is unable to translate the given virtual path to a real path.
Parameters: path - the virtual path to be translated to a real path Returns: the real path, or null if the translation cannot be performed getServerInfo String getServerInfo Returns the name and version of the servlet container on which the servlet is running.
Returns: a String containing at least the servlet container name and version number getInitParameter String getInitParameter String name Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist. This method can make available configuration information useful to an entire web application. For example, it can provide a webmaster's email address or the name of a system that holds critical data.
Parameters: name - a String containing the name of the parameter whose value is requested Returns: a String containing at least the servlet container name and version number See Also: ServletConfig. Returns: an Enumeration of String objects containing the names of the context's initialization parameters See Also: ServletConfig. String setInitParameter boolean setInitParameter String name, String value Sets the context initialization parameter with the given name and value on this ServletContext.
Parameters: name - the name of the context initialization parameter to set value - the value of the context initialization parameter to set Returns: true if the context initialization parameter with the given name and value was set successfully on this ServletContext, and false if it was not set because this ServletContext already contains a context initialization parameter with a matching name Throws: IllegalStateException - if this ServletContext has already been initialized UnsupportedOperationException - if this ServletContext was passed to the ServletContextListener.
An attribute allows a servlet container to give the servlet additional information not already provided by this interface. See your server documentation for information about its attributes.
A list of supported attributes can be retrieved using getAttributeNames. The attribute is returned as a java. Object or some subclass. Attribute names should follow the same convention as package names. 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. When i run the STS SpringBoot application i get the below error: The attempt was made from the following location: org.
ServletContext I guess there is something wrong with my pom. InvalidKeyException; import java. SignatureException; import java. List; import org. DateTime; import org. Instant; import org. Logger; import org. LoggerFactory; import org. It has the files you need. Once you hit the apply button and okay button it will resolve the missing import files. Here is a step by step description from a similar question on SO: How do I import the javax.
You'll want to add the Servlet API as a "provided" dependency. That is, you only use it to compile the code, but you don't need to package it with your web application since your web container will already contain a copy of it. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. 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.
0コメント