Read the javadoc methodinit() carefully :
Init
public void init() throws ServletException
...
Throws:
ServletException - if an exception occurs that interrupts the normal operation of the servlet
, ServletException. 2.3.2.1 API- :
2.3.2.1
UnavailableException ServletException. . destroy , .
...
, , ( , , Java /, ):
@Override
public void init() throws ServletException {
try {
securityController = SecurityControllerFactory.getInstance().create();
} catch (Exception e) {
throw new ServletException("Error creating security controller", e);
}
maxFileSize = getBytes(10);
maxMemSize = getBytes(2);
}
, super.init(). Javadoc , init(), init(ServletConfig).
, catch Exception . , , RuntimeException catch Exception, / .
catch, (), throws . :
try {
securityController = SecurityControllerFactory.getInstance().create();
} catch (SecurityControllerCreationException e) {
throw new ServletException("Error creating security controller", e);
}
, , throws Exception. .