Package net.sourceforge.processdash.net.http

Examples of net.sourceforge.processdash.net.http.WebServer


        EVTaskDependencyResolver.getInstance().setDynamic(false);
       
        if (createWebServer) {
            DashboardURLStreamHandlerFactory.disable();
            try {
                webServer = new WebServer();
                webServer.setDashboardContext(this);
                webServer.setData(data);
                webServer.setProps(hierarchy);
                webServer.setRoots(TemplateLoader.getTemplateURLs());
                WebServer.setOutputCharset(getWebCharset());
View Full Code Here


       
        // start the http server.
        try {
            int httpPort = Settings.getInt(HTTP_PORT_SETTING, DEFAULT_WEB_PORT);
            webServer = new WebServer(httpPort);
            webServer.setDashboardContext(this);
            InternalSettings.addPropertyChangeListener
                (HTTP_PORT_SETTING, new HttpPortSettingListener());
            ScriptID.setNameResolver(new ScriptNameResolver(webServer));
        } catch (IOException ioe) {
View Full Code Here

    private String testContinuation(String prefix, String continuationURI) {
        if (prefix != null)
            continuationURI = WebServer.urlEncodePath(prefix) + "/"
                    + continuationURI;
        try {
            WebServer ws = getTinyWebServer();
            String continuationURL = "http://" + ws.getHostName(false) + ":"
                    + ws.getPort() + continuationURI;
            URL u = new URL(continuationURL);
            logger.finer("Testing continuation URL " + continuationURL);
            HttpURLConnection conn = (HttpURLConnection) u.openConnection();
            conn.connect();
            int status = conn.getResponseCode();
View Full Code Here

     * absolute (e.g. "/reports/foo"), it is interpreted relative
     * to the current request. */
    protected void parseInputFile(String scriptPath, String filename) throws IOException {
        if (filename == null || filename.length() == 0) return;

        WebServer t = getTinyWebServer();
        String origFilename = filename;
        try {
            filename = resolveRelativeURI(scriptPath, filename);
            parseInput(filename, t.getRequestAsString(filename));

            // now try looking for a companion resource bundle, and load
            // values from it as well.
            try {
                String bundleName = filename;
View Full Code Here

     * Examples: http://localhost:2468 or http://somehostname:3000
     *
     * @since 1.14.3.1
     */
    protected String getRequestURLBase() {
        WebServer ws = getTinyWebServer();

        // get the host that was used to make this request from the http headers
        String fullHostAndPort = (String) env.get("HTTP_HOST");
        if (StringUtils.hasValue(fullHostAndPort))
            return "http://" + fullHostAndPort;

        // if the http request did not contain a host header, reconstruct the
        // host and port from other values at our disposal.
        String host = (String) env.get("SERVER_ADDR");
        if (!StringUtils.hasValue(host))
            host = ws.getHostName(true);

        // get the port number that the server is listening on
        int port = ws.getPort();

        // return the appropriate value
        return "http://" + host + ":" + port;
    }
View Full Code Here

        StringBuffer fullUri = new StringBuffer();
        fullUri.append(WebServer.urlEncodePath(prefix)).append("/").append(uri);
        HTMLUtils.appendQuery(fullUri, queryString.toString());

        WebServer webServer = (WebServer) parentEnv
                .get(TinyCGI.TINY_WEB_SERVER);
        try {
            String results = webServer.getRequestAsString(fullUri.toString(),
                    extraEnvironment);
            snippet.setStatus(SnippetInvoker.STATUS_OK);
            snippet.setUri(fullUri.toString());
            return results;
        } catch (IOException ioe) {
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.net.http.WebServer

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.