Package com.softwarementors.extjs.djn.router

Examples of com.softwarementors.extjs.djn.router.RequestRouter


  protected RequestRouter createRequestRouter(Registry registry, GlobalConfiguration globalConfiguration) {
    assert registry != null;
    assert globalConfiguration != null;
   
    return new RequestRouter( registry, globalConfiguration, createDispatcher(globalConfiguration.getDispatcherClass()) );
  }
View Full Code Here


      throws IOException {
   final String JSON_CONTENT_TYPE = "application/json";
   final String JAVASCRIPT_CONTENT_TYPE = "text/javascript"; // *YES*, shoul be "application/javascript", but then there is IE, and the fact that this is really cross-browser (sigh!)
   final String HTML_CONTENT_TYPE = "text/html";
   
   RequestRouter processor = getProcessor();
    switch( type ) {   
    case FORM_SIMPLE_POST:
      response.setContentType(JSON_CONTENT_TYPE);
      processor.processSimpleFormPostRequest( request.getReader(), response.getWriter() );
      break;
    case FORM_UPLOAD_POST:
      response.setContentType(HTML_CONTENT_TYPE); // MUST be "text/html" for uploads to work!
      processUploadFormPost(request, response);
      break;
    case JSON:
      response.setContentType(JSON_CONTENT_TYPE);
      processor.processJsonRequest( request.getReader(), response.getWriter() );
      break;
    case POLL:
      response.setContentType(JSON_CONTENT_TYPE);
      processor.processPollRequest( request.getReader(), response.getWriter(), request.getPathInfo() );
      break;
    case SOURCE:
      response.setContentType(JAVASCRIPT_CONTENT_TYPE);
      processor.processSourceRequest( request.getReader(), response.getWriter(), request.getPathInfo());
      break;
    }
  }
View Full Code Here

 
  private void processUploadFormPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    assert request != null;
    assert response != null;
   
    RequestRouter router = getProcessor();
    UploadFormPostRequestProcessor processor = router.createUploadFromProcessor();
    try {
       router.processUploadFormPostRequest( processor, getFileItems(request), response.getWriter() );
    }
    catch( FileUploadException e ) {
      processor.handleFileUploadException( e );
    }
  }
View Full Code Here

  }

  @Override
  protected RequestRouter createRequestRouter(final Registry registry, final GlobalConfiguration globalConfiguration) {
    final Dispatcher dispatcher = createDispatcher(globalConfiguration.getDispatcherClass());
    return new RequestRouter(registry, globalConfiguration, dispatcher)
    {
      @Override
      public void processPollRequest(final Reader reader, final Writer writer, final String pathInfo)
          throws IOException
      {
View Full Code Here

TOP

Related Classes of com.softwarementors.extjs.djn.router.RequestRouter

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.