List of usage examples for javax.servlet ServletException ServletException
public ServletException(String message, Throwable rootCause)
From source file:org.zilverline.web.AddIMAPCollectionController.java
/** Method inserts a new <code>Collection</code>. */ protected ModelAndView onSubmit(Object command) throws ServletException { IMAPCollection collection = (IMAPCollection) command; // delegate the insert to the Collection Manager try {/* w w w . j a va2 s .c o m*/ collectionManager.addCollection(collection); collection.init(); collectionManager.store(); } catch (IndexException e) { throw new ServletException("Error initializing new index in AddIMAPCollectionController", e); } return new ModelAndView(getSuccessView(), "collections", collectionManager.getCollections()); }
From source file:org.zilverline.web.AddCollectionController.java
/** Method inserts a new <code>Collection</code>. */ protected ModelAndView onSubmit(Object command) throws ServletException { DocumentCollection collection = (DocumentCollection) command; // delegate the insert to the Collection Manager try {//from w w w .jav a 2 s. co m collectionManager.addCollection(collection); collection.init(); collectionManager.store(); } catch (IndexException e) { throw new ServletException("Error initializing new index in AddCollectionForm", e); } return new ModelAndView(getSuccessView(), "collections", collectionManager.getCollections()); }
From source file:ar.com.cema.methodology.analyzer.ui.servlet.DependencyInjectionHttpServlet.java
@Override public final void init() throws ServletException { try {//from www.j a v a 2 s .c om ApplicationContext ctx = getApplicationContext(); AutowireCapableBeanFactory beanFactory = ctx.getAutowireCapableBeanFactory(); beanFactory.autowireBeanProperties(this, AutowireCapableBeanFactory.AUTOWIRE_NO, false); beanFactory.initializeBean(this, getClass().getName()); } catch (Exception e) { throw new ServletException( "Error injecting dependencies on servlet '" + getServletName() + "': " + e.getMessage(), e); } postInit(); }
From source file:com.alliander.osgp.signing.server.application.config.SigningServerInitializer.java
@Override public void onStartup(final ServletContext servletContext) throws ServletException { try {/*w w w .j a v a 2 s . co m*/ // Force the timezone of application to UTC (required for // Hibernate/JDBC) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final Context initialContext = new InitialContext(); final String logLocation = (String) initialContext.lookup("java:comp/env/osp/signingServer/log-config"); LogbackConfigurer.initLogging(logLocation); final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); } catch (final NamingException e) { throw new ServletException("Naming exception", e); } catch (final FileNotFoundException e) { throw new ServletException("Logging file not found", e); } catch (final JoranException e) { throw new ServletException("Logback exception", e); } }
From source file:org.osgp.adapter.protocol.dlms.application.config.ProtocolAdapterDlmsInitializer.java
@Override public void onStartup(final ServletContext servletContext) throws ServletException { try {/* w w w . j av a2 s . c o m*/ // Force the timezone of application to UTC (required for // Hibernate/JDBC) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final Context initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osp/osgpAdapterProtocolDlms/log-config"); LogbackConfigurer.initLogging(logLocation); final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); } catch (final NamingException e) { throw new ServletException("naming exception", e); } catch (final FileNotFoundException e) { throw new ServletException("Logging file not found", e); } catch (final JoranException e) { throw new ServletException("Logback exception", e); } }
From source file:com.alliander.osgp.adapter.protocol.oslp.application.config.OsgpProtocolAdapterOslpInitializer.java
@Override public void onStartup(final ServletContext servletContext) throws ServletException { try {/*from w w w .j av a2 s . co m*/ // Force the timezone of application to UTC (required for // Hibernate/JDBC) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final Context initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osp/osgpAdapterProtocolOslp/log-config"); LogbackConfigurer.initLogging(logLocation); final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); } catch (final NamingException e) { throw new ServletException("naming exception", e); } catch (final FileNotFoundException e) { throw new ServletException("Logging file not found", e); } catch (final JoranException e) { throw new ServletException("Logback exception", e); } }
From source file:org.zilverline.web.IndexController.java
/** * Handles form submission by indexing given collections. * /* w w w . j a v a2 s .c om*/ * @param command the CollectionForm * * @return ModelAndView the view with updated model * * @throws ServletException on Indexing error */ public ModelAndView onSubmit(Object command) throws ServletException { String[] colNames = ((CollectionForm) command).getNames(); boolean fullIndex = ((CollectionForm) command).getFullIndex(); String cols = StringUtils.arrayToCommaDelimitedString(colNames); log.debug("Form called with " + cols + ", reindexing: " + fullIndex); try { indexService.doIndex(colNames, fullIndex); } catch (IndexException e) { throw new ServletException("Can't index collections " + cols, e); } log.debug("returning from CollectionForm to view: " + getSuccessView() + " with " + cols); return new ModelAndView(getSuccessView(), "collections", getCollectionManager().getCollections()); }
From source file:com.alliander.osgp.adapter.protocol.oslp.elster.application.config.OsgpProtocolAdapterOslpInitializer.java
@Override public void onStartup(final ServletContext servletContext) throws ServletException { try {/* ww w .j a v a 2 s . c om*/ // Force the timezone of application to UTC (required for // Hibernate/JDBC) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final Context initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osp/osgpAdapterProtocolOslpElster/log-config"); LogbackConfigurer.initLogging(logLocation); final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); } catch (final NamingException e) { throw new ServletException("naming exception", e); } catch (final FileNotFoundException e) { throw new ServletException("Logging file not found", e); } catch (final JoranException e) { throw new ServletException("Logback exception", e); } }
From source file:com.alliander.osgp.adapter.protocol.iec61850.application.config.OsgpProtocolAdapterIec61850Initializer.java
@Override public void onStartup(final ServletContext servletContext) throws ServletException { try {//from www . j a v a 2 s . c o m // Force the timezone of application to UTC (required for // Hibernate/JDBC) TimeZone.setDefault(TimeZone.getTimeZone("UTC")); final Context initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osp/osgpAdapterProtocolIec61850/log-config"); LogbackConfigurer.initLogging(logLocation); final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); } catch (final NamingException e) { throw new ServletException("naming exception", e); } catch (final FileNotFoundException e) { throw new ServletException("Logging file not found", e); } catch (final JoranException e) { throw new ServletException("Logback exception", e); } }
From source file:org.springmodules.validation.bean.context.web.ValidationContextFilter.java
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try {//from w w w . j a v a2 s .c om if (interceptor.preHandle(request, response, null)) { filterChain.doFilter(request, response); } } catch (Exception e) { throw new ServletException("Could not apply valication context filter", e); } finally { try { interceptor.postHandle(request, response, null, null); } catch (Exception e) { // do nothing } } }