/**
* Initialize this servlet.
*/
@Override
public void init()
throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(
getServletConfig().getInitParameter("maxDepth"));
if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
allowSpecialPaths = Boolean.parseBoolean(
getServletConfig().getInitParameter("allowSpecialPaths"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}
java类javax.servlet.UnavailableException的实例源码
WebdavServlet.java 文件源码
项目:tomcat7
阅读 36
收藏 0
点赞 0
评论 0
HostManagerServlet.java 文件源码
项目:tomcat7
阅读 37
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("hostManagerServlet.noWrapper"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
}
InvokerServlet.java 文件源码
项目:lams
阅读 28
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("invokerServlet.noWrapper"));
// Set our properties from the initialization parameters
if (getServletConfig().getInitParameter("debug") != null)
debug = Integer.parseInt(getServletConfig().getInitParameter("debug"));
if (debug >= 1)
log("init: Associated with Context '" + context.getPath() + "'");
}
WebdavServlet.java 文件源码
项目:lams
阅读 32
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
public void init()
throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(
getServletConfig().getInitParameter("maxDepth"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}
HostManagerServlet.java 文件源码
项目:lams
阅读 33
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("hostManagerServlet.noWrapper"));
// Verify that we were not accessed using the invoker servlet
String servletName = getServletConfig().getServletName();
if (servletName == null)
servletName = "";
if (servletName.startsWith("org.apache.catalina.INVOKER."))
throw new UnavailableException
(sm.getString("hostManagerServlet.cannotInvoke"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
;
}
}
ValidatorPlugIn.java 文件源码
项目:lams
阅读 35
收藏 0
点赞 0
评论 0
/**
* Initialize and load our resources.
*
* @param servlet The ActionServlet for our application
* @param config The ModuleConfig for our owning module
* @throws ServletException if we cannot configure ourselves correctly
*/
public void init(ActionServlet servlet, ModuleConfig config)
throws ServletException {
// Remember our associated configuration and servlet
this.config = config;
this.servlet = servlet;
// Load our database from persistent storage
try {
this.initResources();
servlet.getServletContext().setAttribute(VALIDATOR_KEY + config.getPrefix(),
resources);
servlet.getServletContext().setAttribute(STOP_ON_ERROR_KEY + '.' + config.getPrefix(),
(this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new UnavailableException("Cannot load a validator resource from '" + pathnames + "'");
}
}
ManagedServlet.java 文件源码
项目:lams
阅读 35
收藏 0
点赞 0
评论 0
public void createServlet() throws ServletException {
if (permanentlyUnavailable) {
return;
}
try {
if (!started && servletInfo.getLoadOnStartup() != null && servletInfo.getLoadOnStartup() >= 0) {
instanceStrategy.start();
started = true;
}
} catch (UnavailableException e) {
if (e.isPermanent()) {
permanentlyUnavailable = true;
stop();
}
}
}
InvokerServlet.java 文件源码
项目:jerrydog
阅读 28
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("invokerServlet.noWrapper"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
;
}
if (debug >= 1)
log("init: Associated with Context '" + context.getPath() + "'");
}
WebdavServlet.java 文件源码
项目:apache-tomcat-7.0.73-with-comment
阅读 35
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init()
throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(
getServletConfig().getInitParameter("maxDepth"));
if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
allowSpecialPaths = Boolean.parseBoolean(
getServletConfig().getInitParameter("allowSpecialPaths"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}
HostManagerServlet.java 文件源码
项目:apache-tomcat-7.0.73-with-comment
阅读 31
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("hostManagerServlet.noWrapper"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
}
WebdavServlet.java 文件源码
项目:lazycat
阅读 37
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(getServletConfig().getInitParameter("maxDepth"));
if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
allowSpecialPaths = Boolean.parseBoolean(getServletConfig().getInitParameter("allowSpecialPaths"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}
HostManagerServlet.java 文件源码
项目:lazycat
阅读 35
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException(sm.getString("hostManagerServlet.noWrapper"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
}
LayoutServlet.java 文件源码
项目:sistra
阅读 33
收藏 0
点赞 0
评论 0
public void init() throws ServletException {
super.init();
// Nombre del layout por defecto
defaultLayoutName = getServletConfig().getInitParameter("defaultLayoutName");
try {
Context context = new InitialContext();
// Bajo JNDI habr� todos los pares: nombre, path que metemos en el Map
NamingEnumeration namingEnum = context.listBindings("java:comp/env/layout");
while (namingEnum.hasMore()) {
Binding binding = (Binding) namingEnum.next();
layoutPathMap.put(binding.getName(), binding.getObject());
}
} catch (NamingException e) {
log.error("Error accediendo a JNDI", e);
}
// El layout por defecto debe estar en el Map!
if (!layoutPathMap.containsKey(defaultLayoutName)) {
log.error("El layout por defecto \"" + defaultLayoutName + "\" no est� definido bajo java:comp/env/layout");
throw new UnavailableException("Error de configuraci�n");
}
}
AgentInstaller.java 文件源码
项目:OpenMobster
阅读 29
收藏 0
点赞 0
评论 0
public void init(ServletConfig servletConfig) throws ServletException
{
try
{
this.agentModules = new HashMap<String, byte[]>();
//Parse the JAD file
this.parseAgentJAD("rimos/430/MobileCloud.jad");
//Parse the Modules
this.parseAgentModules("rimos/430/MobileCloud.cod");
//Parse the JAD file
this.parseAgentJAD("rimos/430/CloudManager.jad");
//Parse the Modules
this.parseAgentModules("rimos/430/CloudManager.cod");
log.info("OpenMobster AppStore Successfully Initialized........................");
}
catch(Exception exception)
{
log.error(this, exception);
throw new UnavailableException(exception.getMessage());
}
}
AndroidAgentInstaller.java 文件源码
项目:OpenMobster
阅读 30
收藏 0
点赞 0
评论 0
public void init(ServletConfig servletConfig) throws ServletException
{
try
{
InputStream is = Thread.currentThread().getContextClassLoader().
getResourceAsStream("android/20/CloudManager.apk");
this.cloudModule = IOUtilities.readBytes(is);
log.info("OpenMobster Android AppStore Successfully Initialized........................");
}
catch(Exception exception)
{
log.error(this, exception);
throw new UnavailableException(exception.getMessage());
}
}
ValidatorPlugIn.java 文件源码
项目:sonar-scanner-maven
阅读 31
收藏 0
点赞 0
评论 0
/**
* Initialize and load our resources.
*
* @param servlet The ActionServlet for our application
* @param config The ModuleConfig for our owning module
* @throws ServletException if we cannot configure ourselves correctly
*/
public void init(ActionServlet servlet, ModuleConfig config)
throws ServletException {
// Remember our associated configuration and servlet
this.config = config;
this.servlet = servlet;
// Load our database from persistent storage
try {
this.initResources();
servlet.getServletContext().setAttribute(VALIDATOR_KEY
+ config.getPrefix(), resources);
servlet.getServletContext().setAttribute(STOP_ON_ERROR_KEY + '.'
+ config.getPrefix(),
(this.stopOnFirstError ? Boolean.TRUE : Boolean.FALSE));
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new UnavailableException(
"Cannot load a validator resource from '" + pathnames + "'");
}
}
ActionServlet.java 文件源码
项目:sonar-scanner-maven
阅读 31
收藏 0
点赞 0
评论 0
/**
* <p>Look up and return the {@link RequestProcessor} responsible for the
* specified module, creating a new one if necessary.</p>
*
* @param config The module configuration for which to acquire and return
* a RequestProcessor.
* @return The {@link RequestProcessor} responsible for the specified
* module,
* @throws ServletException If we cannot instantiate a RequestProcessor
* instance a {@link UnavailableException} is
* thrown, meaning your application is not loaded
* and will not be available.
* @since Struts 1.1
*/
protected synchronized RequestProcessor getRequestProcessor(
ModuleConfig config) throws ServletException {
RequestProcessor processor = this.getProcessorForModule(config);
if (processor == null) {
try {
processor =
(RequestProcessor) RequestUtils.applicationInstance(config.getControllerConfig()
.getProcessorClass());
} catch (Exception e) {
throw new UnavailableException(
"Cannot initialize RequestProcessor of class "
+ config.getControllerConfig().getProcessorClass() + ": "
+ e);
}
processor.init(this, config);
String key = Globals.REQUEST_PROCESSOR_KEY + config.getPrefix();
getServletContext().setAttribute(key, processor);
}
return (processor);
}
TestActionServlet.java 文件源码
项目:sonar-scanner-maven
阅读 35
收藏 0
点赞 0
评论 0
/**
* Make sure processFormBeanConfigClass() returns what it was given if the
* form passed to it doesn't extend anything.
*/
public void testProcessFormBeanConfigClassNoExtends()
throws Exception {
moduleConfig.addFormBeanConfig(baseFormBean);
FormBeanConfig result = null;
try {
result =
actionServlet.processFormBeanConfigClass(baseFormBean,
moduleConfig);
} catch (UnavailableException e) {
fail("An exception should not be thrown when there's nothing to do");
}
assertSame("Result should be the same as the input.", baseFormBean,
result);
}
TestActionServlet.java 文件源码
项目:sonar-scanner-maven
阅读 37
收藏 0
点赞 0
评论 0
/**
* Make sure processExceptionConfigClass() returns what it was given if
* the handler passed to it doesn't extend anything.
*/
public void testProcessExceptionConfigClassNoExtends()
throws Exception {
moduleConfig.addExceptionConfig(baseException);
ExceptionConfig result = null;
try {
result =
actionServlet.processExceptionConfigClass(baseException,
moduleConfig, null);
} catch (UnavailableException e) {
fail("An exception should not be thrown when there's nothing to do");
}
assertSame("Result should be the same as the input.", baseException,
result);
}
TestActionServlet.java 文件源码
项目:sonar-scanner-maven
阅读 27
收藏 0
点赞 0
评论 0
/**
* Make sure processForwardConfigClass() returns what it was given if the
* forward passed to it doesn't extend anything.
*/
public void testProcessForwardConfigClassNoExtends()
throws Exception {
moduleConfig.addForwardConfig(baseForward);
ForwardConfig result = null;
try {
result =
actionServlet.processForwardConfigClass(baseForward,
moduleConfig, null);
} catch (UnavailableException e) {
fail("An exception should not be thrown when there's nothing to do");
}
assertSame("Result should be the same as the input.", baseForward,
result);
}
TestActionServlet.java 文件源码
项目:sonar-scanner-maven
阅读 25
收藏 0
点赞 0
评论 0
/**
* Make sure processActionConfigClass() returns what it was given if the
* action passed to it doesn't extend anything.
*/
public void testProcessActionConfigClassNoExtends()
throws Exception {
moduleConfig.addActionConfig(baseAction);
ActionConfig result = null;
try {
result =
actionServlet.processActionConfigClass(baseAction, moduleConfig);
} catch (UnavailableException e) {
fail("An exception should not be thrown here");
}
assertSame("Result should be the same as the input.", baseAction, result);
}
PUTestServlet.java 文件源码
项目:opengse
阅读 30
收藏 0
点赞 0
评论 0
/**
* By passing ServletTest's service method
*
*/
public void service( ServletRequest request, ServletResponse response ) throws ServletException , IOException {
PrintWriter out = response.getWriter();
try {
throw new UnavailableException( "Throwing Permanent unavailable Exception " );
} catch ( UnavailableException ex ) {
if ( ex.isPermanent() == true ) {
out.println( "PUTest test PASSED" );
} else {
out.println( "PUTest test FAILED <BR>" );
out.println( "isPermanent() method is returing false for Permanent Unavailable Exception" );
}
}
}
XMLConfiguration.java 文件源码
项目:Wilma
阅读 47
收藏 0
点赞 0
评论 0
protected void initFilter(XmlParser.Node node) throws ClassNotFoundException,UnavailableException
{
String name=node.getString("filter-name",false,true);
String className=node.getString("filter-class",false,true);
if(className==null)
{
log.warn("Missing filter-class in "+node);
return;
}
if(name==null)
name=className;
FilterHolder holder=getWebApplicationHandler().defineFilter(name,className);
Iterator iter=node.iterator("init-param");
while(iter.hasNext())
{
XmlParser.Node paramNode=(XmlParser.Node)iter.next();
String pname=paramNode.getString("param-name",false,true);
String pvalue=paramNode.getString("param-value",false,true);
holder.put(pname,pvalue);
}
}
AbstractRestServlet.java 文件源码
项目:java-docs-samples
阅读 27
收藏 0
点赞 0
评论 0
@Override
public void init(ServletConfig servletConfig) throws ServletException {
// First try the servlet context init-param.
String source = "InitParameter";
key = servletConfig.getInitParameter(APPKEY);
if (key == null || key.startsWith("${")) {
source = "System Property";
key = System.getProperty(APPKEY);
}
if (key == null || key.startsWith("${")) {
source = "Environment Variable";
key = System.getenv(APPKEY_ENV);
}
if (key == null) {
throw new UnavailableException("Places App Key not set");
}
if (key.startsWith("${")) {
throw new UnavailableException("Places App Key not expanded from " + source);
}
}
InterfaceA_EngineBasedServer.java 文件源码
项目:yawl
阅读 29
收藏 0
点赞 0
评论 0
public void init() throws ServletException {
ServletContext context = getServletContext();
// read persistence flag from web.xml & get engine instance
try {
String persistOn = context.getInitParameter("EnablePersistence") ;
boolean enablePersist = "true".equalsIgnoreCase(persistOn);
_engine = (EngineGateway) context.getAttribute("engine");
if (_engine == null) {
_engine = new EngineGatewayImpl(enablePersist);
context.setAttribute("engine", _engine);
}
} catch (YPersistenceException e) {
logger.fatal("Failure to initialise runtime (persistence failure)", e);
throw new UnavailableException("Persistence failure");
}
}
WebdavServlet.java 文件源码
项目:class-guard
阅读 37
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init()
throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(
getServletConfig().getInitParameter("maxDepth"));
if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
allowSpecialPaths = Boolean.parseBoolean(
getServletConfig().getInitParameter("allowSpecialPaths"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}
HostManagerServlet.java 文件源码
项目:class-guard
阅读 38
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init() throws ServletException {
// Ensure that our ContainerServlet properties have been set
if ((wrapper == null) || (context == null))
throw new UnavailableException
(sm.getString("hostManagerServlet.noWrapper"));
// Set our properties from the initialization parameters
String value = null;
try {
value = getServletConfig().getInitParameter("debug");
debug = Integer.parseInt(value);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
}
SpaceSearchController.java 文件源码
项目:fenixedu-spaces
阅读 30
收藏 0
点赞 0
评论 0
@RequestMapping(value = "/view/{space}", method = RequestMethod.GET)
public String view(@PathVariable Space space, Model model, @RequestParam(defaultValue = "50") BigDecimal scale,
@RequestParam(defaultValue = "") Boolean viewOriginalSpaceBlueprint,
@RequestParam(defaultValue = "") Boolean viewBlueprintNumbers,
@RequestParam(defaultValue = "") Boolean viewIdentifications,
@RequestParam(defaultValue = "") Boolean viewDoorNumbers) throws UnavailableException {
model.addAttribute("scale", scale);
model.addAttribute("viewOriginalSpaceBlueprint", viewOriginalSpaceBlueprint);
model.addAttribute("viewBlueprintNumbers", viewBlueprintNumbers);
model.addAttribute("viewIdentifications", viewIdentifications);
model.addAttribute("viewDoorNumbers", viewDoorNumbers);
model.addAttribute("information", space.bean());
model.addAttribute("blueprintTextRectangles", getBlueprintTextRectangles(space, scale));
model.addAttribute("spaces", getChildrenOrderedByName(space));
model.addAttribute("parentSpace", space.getParent());
model.addAttribute("currentUser", Authenticate.getUser());
model.addAttribute("spacePhotos", photoService.getVisiblePhotos(space));
return "spaces/view";
}
SpaceSearchController.java 文件源码
项目:fenixedu-spaces
阅读 31
收藏 0
点赞 0
评论 0
@RequestMapping(value = "/blueprint/{space}", method = RequestMethod.GET)
public void blueprint(@PathVariable Space space,
@DateTimeFormat(pattern = InformationBean.DATE_FORMAT) @RequestParam(
defaultValue = "#{new org.joda.time.DateTime()}") DateTime when,
@RequestParam(defaultValue = "50") BigDecimal scale,
@RequestParam(defaultValue = "false") Boolean viewOriginalSpaceBlueprint,
@RequestParam(defaultValue = "true") Boolean viewBlueprintNumbers,
@RequestParam(defaultValue = "true") Boolean viewIdentifications,
@RequestParam(defaultValue = "false") Boolean viewDoorNumbers, HttpServletResponse response)
throws IOException, UnavailableException {
Boolean isToViewOriginalSpaceBlueprint = viewOriginalSpaceBlueprint;
Boolean isToViewBlueprintNumbers = viewBlueprintNumbers;
Boolean isToViewIdentifications = viewIdentifications;
Boolean isToViewDoorNumbers = viewDoorNumbers;
BigDecimal scalePercentage = scale;
response.setContentType("image/jpeg");
try (OutputStream outputStream = response.getOutputStream()) {
SpaceBlueprintsDWGProcessor.writeBlueprint(space, when, isToViewOriginalSpaceBlueprint, isToViewBlueprintNumbers,
isToViewIdentifications, isToViewDoorNumbers, scalePercentage, outputStream);
}
}
WebdavServlet.java 文件源码
项目:apache-tomcat-7.0.57
阅读 32
收藏 0
点赞 0
评论 0
/**
* Initialize this servlet.
*/
@Override
public void init()
throws ServletException {
super.init();
if (getServletConfig().getInitParameter("secret") != null)
secret = getServletConfig().getInitParameter("secret");
if (getServletConfig().getInitParameter("maxDepth") != null)
maxDepth = Integer.parseInt(
getServletConfig().getInitParameter("maxDepth"));
if (getServletConfig().getInitParameter("allowSpecialPaths") != null)
allowSpecialPaths = Boolean.parseBoolean(
getServletConfig().getInitParameter("allowSpecialPaths"));
// Load the MD5 helper used to calculate signatures.
try {
md5Helper = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
throw new UnavailableException("No MD5");
}
}