Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

phobos simple server side script (index.js) (See related posts)

phobos simple server side script (index.js)

/* 
 * This script is called when the client tries to access the "/" URL.
 * It simply redirects to a URL that causes the main application page
 * to be displayed.
 */


// default index is to activate the main controller:

library.httpserver.sendRedirect(library.httpserver.makeUrl("/main/show"));

/* for example, you can directly execute some server side JavaScript
   and render the result in the page via the response global object:

    response.setStatus(200);
    response.setContentType("text/html");
    writer = response.getWriter();
    writer.println(
        "<html><head><title>Hello</title></head><body>" +
        "Today is "+ java.util.Date() +
        "</body></html>");
    writer.flush();

*/


You need to create an account or log in to post comments to this site.


Click here to browse all 4863 code snippets

Related Posts