Package org.apache.tomcat.core

Examples of org.apache.tomcat.core.Request


    public void release() {
    }

    private void init(HttpServletRequest request) {
  Request realRequest = (Request)
      request.getAttribute( Request.ATTRIB_REAL_REQUEST);
  if( realRequest==null )
      pageContext.getServletContext().log("Untrusted Application");
  else
      cm = realRequest.getContext().getContextManager();
    }
View Full Code Here


  cm.removeContext( ctx );
    }

    private void restartContext( ContextManager cm, Context ctx,HttpServletRequest req )
    throws TomcatException {
  Request request = (Request)
      req.getAttribute( Request.ATTRIB_REAL_REQUEST);
  if( request == null ) {
      throw new TomcatException("Untrusted Web-App");
  }
  synchronized(ctx) {
View Full Code Here

  for(int i=0; i < wf.length; i++) {
      if(getOneWelcomeFile(dir, wf[i])) {
    return wf[i];
      }
      String wfURI = concatPath(pathInfo, wf[i]);
      Request req = cm.createRequest(context, wfURI);
      int status = 0;
 
      for( int j=0; j< ri.length; j++ ) {
    status=ri[j].contextMap( req );
    if( status!=0 ) break;
      }
      if(status == 0 && req.servletPath() != null &&
         ! req.servletPath().equals("") &&
         req.getContainer().getMapType() != Container.EXTENSION_MAP) {
    return req.servletPath().toString().substring(pathInfo.length());
      }
  }
     
  return null;
    }
View Full Code Here

      doTrace(req, res);
      return;
  }
  // if we are in include, with req==original request
  // - just use the current sub-request
  Request subReq=req;
  if(req.getChild()!=null)
      subReq=req.getChild();
  Context ctx=subReq.getContext();
  // Use "javax.servlet.include.servlet_path" for path if defined.
  // ErrorHandler places the path here when invoking an error page.
  String pathInfo = (String)subReq.getAttribute("javax.servlet.include.servlet_path");
  if(pathInfo == null) {
      // If the attribute isn't there, then we aren't included.
      // In that case, we must use the real request.
      //*** DEBUG *** subReq = req;
      pathInfo=subReq.servletPath().toString();
  }
  String absPath = (String)subReq.getNote( realFileNote );
  if( absPath==null )
      absPath=FileUtil.safePath( context.getAbsolutePath(),
               pathInfo);

  if( debug>0) log( "Requested file = " + absPath);
View Full Code Here

  DateFormat dateFormat =
      new SimpleDateFormat(datePattern,locale );

  boolean inInclude=req.getChild()!=null;
  Request subReq=req;
  if( inInclude ) subReq = req.getChild();
  Context ctx=req.getContext();
  String pathInfo=subReq.servletPath().toString();
  if( pathInfo == null ) pathInfo="";
  String absPath=FileUtil.safePath( context.getAbsolutePath(),
            pathInfo);
  File file = new File( absPath );
  String requestURI=subReq.requestURI().toString();
  String base = ctx.getAbsolutePath();
  if (absPath.length() > base.length())
  {
    String relPath=absPath.substring( base.length() + 1);
    String relPathU=relPath.toUpperCase();
View Full Code Here

      sm.setDebug( debug );
      sm.setModule( this );
      ctx.getContainer().setNote( manager_note, sm );
  }
  if(ctx.getContainer().getNote(SESSIONS_RELOAD) != null ) {
      Request req = (Request)ctx.getContainer().getNote(SESSIONS_RELOAD);
      reload(req, ctx);
      // Dump for GC.
      ctx.getContainer().setNote(SESSIONS_RELOAD,null);
  }
   
View Full Code Here

    /** Called before service method is invoked.
     */
    public int preService(Request request, Response response) {
  if( request.getContext() == null ) return 0;
  // fix for 1112
  Request child=request.getChild();
  if( child!=null ) {
      request=child;
  }
  fixJDKContextClassLoader(request.getContext());
  return 0;
View Full Code Here

  fixJDKContextClassLoader(request.getContext());
  return 0;
    }

    public int postService(Request request, Response response) {
  Request child=request.getChild();
  if( child==null ) return 0;

  // after include, reset the class loader
  // fix for 1112
  request=child.getParent();
  if( request != null )
      fixJDKContextClassLoader(request.getContext());
  else
      jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
  return 0;
View Full Code Here

    public final Handler getHandlerForPath( ContextManager cm,
              Context ctx, String path ) {
  if( ! path.startsWith( "/" ) ) {
      return ctx.getServletByName( path );
  }
  Request req1=cm.createRequest(ctx, path);

  cm.processRequest( req1 );
  return req1.getHandler();
    }
View Full Code Here

  // A Jsp initialized in web.xml -
        BaseInterceptor ri[];
  String path=((ServletHandler)result).getServletInfo().getJspFile();
  String requestURI = path + "?jsp_precompile=true";

  Request req = cm.createRequest(context, requestURI);
  ri=context.getContainer().
      getInterceptors(Container.H_preInitCheck);
  for( int i=0; i< ri.length; i++ ) {
      int status = ri[i].preInitCheck(req, result);
      if(status != 0) {
View Full Code Here

TOP

Related Classes of org.apache.tomcat.core.Request

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.