Package hr.fer.zemris.java.webserver

Examples of hr.fer.zemris.java.webserver.RequestContext$RCCookie


  }
 
  private static void demo1(String filePath, String encoding) throws IOException {
   
    OutputStream os = Files.newOutputStream(Paths.get(filePath));
    RequestContext rc = new RequestContext(os, new HashMap<String, String>(),
       
    new HashMap<String, String>(),
    new ArrayList<RequestContext.RCCookie>());
   
    rc.setEncoding(encoding);
    rc.setMimeType("text/plain");
    rc.setStatusCode(205);
    rc.setStatusText("Idemo dalje");
   
    // Only at this point will header be created and written...
    rc.write("Čevapčići i Šiščevapčići.");
    os.close();
  }
View Full Code Here


    os.close();
  }

  private static void demo2(String filePath, String encoding) throws IOException {
    OutputStream os = Files.newOutputStream(Paths.get(filePath));
    RequestContext rc = new RequestContext(os, new HashMap<String, String>(),
       
    new HashMap<String, String>(),
    new ArrayList<RequestContext.RCCookie>());
   
    rc.setEncoding(encoding);
    rc.setMimeType("text/plain");
    rc.setStatusCode(205);
    rc.setStatusText("Idemo dalje");
    rc.addRCCookie(new RCCookie("korisnik", "perica", 3600, "127.0.0.1", "/"));
    rc.addRCCookie(new RCCookie("zgrada", "B4", null, null, "/"));
   
    // Only at this point will header be created and written...
    rc.write("Čevapčići i Šiščevapčići.");
    os.close();
  }
View Full Code Here

    Map<String,String> persistentParameters = new HashMap<String, String>();
    List<RCCookie> cookies = new ArrayList<RequestContext.RCCookie>();
   
    // create engine and execute it
    new SmartScriptEngine(new SmartScriptParser(documentBody).getDocumentNode(),
                new RequestContext(System.out, parameters, persistentParameters, cookies)
      ).execute();
  }
View Full Code Here

    parameters.put("b", "2");
   
    // create engine and execute it
    new SmartScriptEngine(
        new SmartScriptParser(documentBody).getDocumentNode(),
        new RequestContext(System.out, parameters, persistentParameters, cookies)
    ).execute();
  }
View Full Code Here

    Map<String,String> parameters = new HashMap<String, String>();
    Map<String,String> persistentParameters = new HashMap<String, String>();
    List<RCCookie> cookies = new ArrayList<RequestContext.RCCookie>();
    persistentParameters.put("brojPoziva", "3");
   
    RequestContext rc = new RequestContext(System.out, parameters, persistentParameters, cookies);
    new SmartScriptEngine(
        new SmartScriptParser(documentBody).getDocumentNode(), rc
    ).execute();
    System.out.println("\nVrijednost u mapi: "+rc.getPersistentParameter("brojPoziva"));
  }
View Full Code Here

TOP

Related Classes of hr.fer.zemris.java.webserver.RequestContext$RCCookie

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.