javax.servlet
接口 ServletRegistration

所有超级接口:
Registration
所有已知子接口:
ServletRegistration.Dynamic
所有已知实现类:
ServletHolder.Registration

public interface ServletRegistration
extends Registration

Interface through which a Servlet may be further configured.

从以下版本开始:
Servlet 3.0

嵌套类摘要
static interface ServletRegistration.Dynamic
          Interface through which a Servlet registered via one of the addServlet methods on ServletContext may be further configured.
 
方法摘要
 Set<String> addMapping(String... urlPatterns)
          Adds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration.
 Collection<String> getMappings()
          Gets the currently available mappings of the Servlet represented by this ServletRegistration.
 String getRunAsRole()
          Gets the name of the runAs role of the Servlet represented by this ServletRegistration.
 
从接口 javax.servlet.Registration 继承的方法
getClassName, getInitParameter, getInitParameters, getName, setInitParameter, setInitParameters
 

方法详细信息

addMapping

Set<String> addMapping(String... urlPatterns)
Adds a servlet mapping with the given URL patterns for the Servlet represented by this ServletRegistration.

If any of the specified URL patterns are already mapped to a different Servlet, no updates will be performed.

If this method is called multiple times, each successive call adds to the effects of the former.

参数:
urlPatterns - the URL patterns of the servlet mapping
返回:
the (possibly empty) Set of URL patterns that are already mapped to a different Servlet
抛出:
IllegalArgumentException - if urlPatterns is null or empty
IllegalStateException - if the ServletContext from which this ServletRegistration was obtained has already been initialized

getMappings

Collection<String> getMappings()
Gets the currently available mappings of the Servlet represented by this ServletRegistration.

If permitted, any changes to the returned Collection must not affect this ServletRegistration.

返回:
a (possibly empty) Collection of the currently available mappings of the Servlet represented by this ServletRegistration

getRunAsRole

String getRunAsRole()
Gets the name of the runAs role of the Servlet represented by this ServletRegistration.

返回:
the name of the runAs role, or null if the Servlet is configured to run as its caller


Copyright © 2013. All Rights Reserved.