Package net.sourceforge.urlrewriter4j.core.errors

Examples of net.sourceforge.urlrewriter4j.core.errors.DefaultErrorHandler


      if (oClassNode != null) {
        //Class oClass = Class.forName(oClassNode.getNodeValue());
        //oHandler = (IRewriteErrorHandler) oClass.newInstance();
        oHandler = pConfig.getBeanFactory().newInstance(IRewriteErrorHandler.class, oClassNode.getNodeValue());
      } else {
        oHandler = new DefaultErrorHandler(oUrlNode.getNodeValue());
      }
    } catch (Exception e) {
      throw new ConfigurationException(String.format(Messages.INVALID_TYPE, new Object[] {oClassNode.getNodeValue(), IRewriteErrorHandler.class.getName()}));     
    }
    pConfig.getErrorHandlers().put(Integer.parseInt(oCodeNode.getNodeValue()), oHandler);
View Full Code Here


   * Make sure we don't redirect in which case we might loose any status codes actions might have set.
   * @throws Exception
   */
  @Test
  public void handleError() throws Exception {
    DefaultErrorHandler oHandler = new DefaultErrorHandler("/error.html");
    MockContextFacade oContext = new MockContextFacade("http://test.com/doesnotmatter.html");
    oHandler.handleError(oContext);
    oContext.expectLocation("/error.html");
    oContext.expectRedirectLocation(null);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.urlrewriter4j.core.errors.DefaultErrorHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.