Search in sources :

Example 1 with PageMarkup

use of com.willshex.blogwt.server.page.PageMarkup in project blogwt by billy1380.

the class MainServlet method processStaticRequest.

/**
 * @param fragmentParameter
 * @param request
 * @throws IOException
 * @throws FailingHttpStatusCodeException
 */
private void processStaticRequest() throws IOException {
    HttpServletRequest request = REQUEST.get();
    String fragmentParameter = request.getParameter("_escaped_fragment_");
    Stack s = Stack.parse(fragmentParameter);
    PageMarkup p = PageMarkupFactory.createFromStack(s);
    HttpServletResponse response = RESPONSE.get();
    response.setCharacterEncoding(ServletHelper.UTF8);
    response.setHeader("Content-Type", "text/html; charset=" + ServletHelper.UTF8);
    if (p != null) {
        response.getOutputStream().write(p.asString().getBytes());
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) PageMarkup(com.willshex.blogwt.server.page.PageMarkup) HttpServletResponse(javax.servlet.http.HttpServletResponse) Stack(com.willshex.blogwt.shared.page.Stack)

Aggregations

PageMarkup (com.willshex.blogwt.server.page.PageMarkup)1 Stack (com.willshex.blogwt.shared.page.Stack)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1