Package net.sf.regain.util.sharedtag

Examples of net.sf.regain.util.sharedtag.PageRequest


    // Write the page to a buffer first
    // If an exception should be thrown the user gets a clear error message
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    PrintStream printStream = new PrintStream(stream, false, SIMPLE_TAG_ENCODING);

    PageRequest request = new SimplePageRequest(req);
    PageResponse response = new SimplePageResponse(this, req, resp, printStream, SIMPLE_TAG_ENCODING);

    // Add the error to the page attributes
    if (error != null) {
      request.setContextAttribute("page.exception", error);
    }
   
    try {
      executer.execute(request, response);
    }
View Full Code Here


   * @see SharedTag#printStartTag(PageRequest, PageResponse)
   * @return {@link #EVAL_PAGE}
   * @throws JspException If the tag could not be executed
   */
  public int doStartTag() throws JspException {
    PageRequest request = getPageRequest();
    JspPageResponse response = new JspPageResponse(pageContext);
    try {
      // Set the context
      mNestedTag.setContext(request);
     
View Full Code Here

   * @see SharedTag#printAfterBody(PageRequest, PageResponse)
   * @return {@link #EVAL_PAGE}
   * @throws JspException If the tag could not be executed
   */
  public int doAfterBody() throws JspException {
    PageRequest request = getPageRequest();
    PageResponse response = new JspPageResponse(pageContext);
    try {
      int result = mNestedTag.printAfterBody(request, response);
      switch (result) {
        case SharedTag.EVAL_TAG_BODY: return EVAL_BODY_TAG;
View Full Code Here

    catch(java.io.IOException exc) {
      throw new ExtendedJspException("Writing end tag failed", exc);
    }

    // Print the end tag
    PageRequest request = getPageRequest();
    PageResponse response = new JspPageResponse(pageContext);
    try {
      // Print the end tag
      mNestedTag.printEndTag(request, response);
     
View Full Code Here

   * If the adapter does not yet exist, it is created.
   *
   * @return The PageRequest adapter.
   */
  private PageRequest getPageRequest() {
    PageRequest request = (PageRequest) pageContext.getAttribute("SharedTagPageRequest");
    if (request == null) {
      request = new JspPageRequest(pageContext);
      pageContext.setAttribute("SharedTagPageRequest", request);
     
      // Add the error to the page attributes
      Throwable error = (Throwable) pageContext.getRequest().getAttribute("javax.servlet.jsp.jspException");
      if (error != null) {
        request.setContextAttribute("page.exception", error);
      }
    }
   
    return request;
  }
View Full Code Here

   * @throws Exception If executing the JSP page failed.
   */
  private void processFile(Request req, Response resp, File file)
    throws Exception
  {
    PageRequest request = new SimplePageRequest(req);
    PageResponse response = new SimplePageResponse(this, req, resp, null, null);
   
    SearchToolkit.sendFile(request, response, file);
  }
View Full Code Here

      req.setCharacterEncoding("UTF-8");
      pageContext = factory.getPageContext(this, req, resp,
        errorPageURL, needsSession, bufferSize, autoFlush);
   
      // Create a shared wrapper
      PageRequest request = new JspPageRequest(pageContext);
      PageResponse response = new JspPageResponse(pageContext);

      // Extract the file name
      String encoding = "utf-8"; // We use utf-8 in our JSPs
      String fileUrl = SearchToolkit.extractFileUrl(req.getRequestURI(), encoding);
View Full Code Here

      // This request does not come from localhost -> Send 403 Forbidden
      handle(req, resp, 403);
    }

    // Create a shared wrapper
    PageRequest request = new SimplePageRequest(req);
    PageResponse response = new SimplePageResponse(this, req, resp, null, null);

    // Get the request path (Without GET-Parameters)
    // NOTE: We don't use context.getRequestPath for this, because it decodes
    //       the URL, but we want to decode it ourselves using our encoding
View Full Code Here

TOP

Related Classes of net.sf.regain.util.sharedtag.PageRequest

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.