本文整理汇总了Java中javax.servlet.UnavailableException类的典型用法代码示例。如果您正苦于以下问题:Java UnavailableException类的具体用法?Java UnavailableException怎么用?Java UnavailableException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnavailableException类属于javax.servlet包,在下文中一共展示了UnavailableException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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");
}
}
示例2: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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);
}
}
示例3: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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() + "'");
}
示例4: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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");
}
}
示例5: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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) {
;
}
}
示例6: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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 + "'");
}
}
示例7: createServlet
import javax.servlet.UnavailableException; //导入依赖的package包/类
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();
}
}
}
示例8: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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() + "'");
}
示例9: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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");
}
}
示例10: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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);
}
}
示例11: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
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");
}
}
示例12: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
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());
}
}
示例13: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
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());
}
}
示例14: init
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* 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 + "'");
}
}
示例15: getRequestProcessor
import javax.servlet.UnavailableException; //导入依赖的package包/类
/**
* <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);
}