Package railo.runtime

Examples of railo.runtime.PageContext


        return false;
    }

    private Object _invoke(String methodName, Object[] args) throws PageException {
      CFMLEngine engine = CFMLEngineFactory.getInstance();
    PageContext pc = engine.getThreadPageContext();
    initCFC(pc);
      return cfc.call(pc, methodName, args);
  }
View Full Code Here


        if(isAdminContext()) return;
        throw new SecurityException(createExceptionMessage(res,false),"access is prohibited by security manager");
  }
   
    private boolean isAdminContext() {
      PageContext pc = ThreadLocalPageContext.get();
        try {
      if(pc!=null && "/railo-context".equals(pc.getBasePageSource().getMapping().getVirtualLowerCase())){
        return true;
      }
    }
        catch (Throwable t) {}
    return false;
View Full Code Here

  }
   
    private Object _invoke(String methodName, Object[] args, HttpServletRequest req, HttpServletResponse rsp, OutputStream out) throws PageException {
      CFMLEngine engine = CFMLEngineFactory.getInstance();
    Creation creator = engine.getCreationUtil();
    PageContext originalPC = engine.getThreadPageContext();
   
    // no OutputStream
    if(out==null)out=DevNullOutputStream.DEV_NULL_OUTPUT_STREAM;
   
    // no Request
    if(req==null){
      // TODO new File
      req=creator.createHttpServletRequest(new File("."), "Railo", "/", "", null, null, null, null, null);
    }
    // noRespone
    if(rsp==null){
      rsp=creator.createHttpServletResponse(out);
    }
   
   
    PageContext pc = creator.createPageContext(req,rsp,out);
    try{
      engine.registerThreadPageContext(pc);
      initCFC(pc);
        return cfc.call(pc, methodName, args);
    }
    finally{
      if(autoFlush) {
        try {
          pc.getRootWriter().flush();
        } catch (Throwable t) {}
      }
      engine.registerThreadPageContext(originalPC);
    }
  }
View Full Code Here

    }
  }

    public void flush() throws IOException {
      CFMLEngine engine = CFMLEngineFactory.getInstance();
    PageContext pc = engine.getThreadPageContext();
    pc.getRootWriter().flush();
    }
View Full Code Here

  }

  public Object getComponent(String cfcPath,String id) throws PageException  {
    String requestURI=toRequestURI(cfcPath);
   
    PageContext oldPC = ThreadLocalPageContext.get();
    PageContextImpl pc = createPageContext(requestURI,id, "init", null, false);
    try {
      ThreadLocalPageContext.register(pc);
      return getCFC(pc,requestURI);
    }
View Full Code Here

  }

  public Object call(String cfcPath,String id,String functionName,Struct arguments, boolean cfcPeristent, Object defaultValue) throws PageException  {
    String requestURI=toRequestURI(cfcPath);
   
    PageContext oldPC = ThreadLocalPageContext.get();
    PageContextImpl pc=createPageContext(requestURI,id,functionName,arguments,cfcPeristent);
   
    try {
      ThreadLocalPageContext.register(pc);
      Component cfc=getCFC(pc,requestURI);
View Full Code Here

//    String type=elStruct.getAttribute("type");
    String name=elComp.getAttribute("name");
    String md5=elComp.getAttribute("md5");
   
    // TLPC
    PageContext pc = ThreadLocalPageContext.get();
   
    // Load comp
    ComponentAccess comp=null;
    try {
      comp = ComponentUtil.toComponentAccess(pc.loadComponent(name));
      if(!ComponentUtil.md5(comp).equals(md5)){
        throw new ConverterException("component ["+name+"] in this enviroment has not the same interface as the component to load, it is possible that one off the components has Functions added dynamicly.");
      }
    }
    catch (ConverterException e) {
View Full Code Here

public class JavaProxy {
 
  public static Object call(ConfigWeb config,Component cfc, String methodName, Object... arguments) {
    try {
     
      PageContext pc = ThreadLocalPageContext.get();
      if(pc==null) {
        //PageSource ps = cfc.getPageSource();
        pc=ThreadUtil.createPageContext(
            config,
            DevNullOutputStream.DEV_NULL_OUTPUT_STREAM,
            "Railo", "/", "", null, null, null, null);
        pc.addPageSource(cfc.getPageSource(), true);
       
      }
     
      return cfc.call(
          ThreadLocalPageContext.get(),
View Full Code Here

    }
        return clazz;
    }
   
    private static Class<?> otherTypeToClass(String type) throws PageException, ClassException{
      PageContext pc = ThreadLocalPageContext.get();
      PageException pe=null;
        // try to load as cfc
      if(pc!=null)  {
          try {
            Component c = pc.loadComponent(type);
            return ComponentUtil.getServerComponentPropertiesClass(pc,c);
        }
            catch (PageException e) {
              pe=e;
            }
View Full Code Here

  public int compareTo(DateTime dt) throws PageException {
    return ct.content.compareTo(dt);
  }

  private boolean isReadonly() {
    PageContext pc = ThreadLocalPageContext.get();
    if(pc==null) return true;
    return pc.getThread()!=ct;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.PageContext

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.