Examples of ServletRequest


Examples of javax.servlet.ServletRequest

    }

    private void addHiddenFields()
        throws JspException{
        try {
            final ServletRequest request = pageContext.getRequest();
            final JspWriter writer = pageContext.getOut();
            String applicationId =
                    request.getParameter(RequestParams.APPLICATION_ID);
            if(applicationId != null){
                writer.println();
                writer.print(HIDDEN_FIELD_APP_ID_BEGIN);
                writer.print(applicationId);
                writer.println(HIDDEN_FIELD_END);
            }
            String objectName =
                    request.getParameter(RequestParams.OBJECT_NAME);
            if(objectName != null){
                writer.print(HIDDEN_FIELD_OBJECT_NAME_BEGIN);
                writer.print(StringUtils.htmlEscape(objectName));
                writer.println(HIDDEN_FIELD_END);
            }
View Full Code Here

Examples of javax.servlet.ServletRequest

   {
   }

   public void requestInitialized(ServletRequestEvent sre)
   {
      ServletRequest sr = sre.getServletRequest();
      String op = sr.getParameter("op");
      if(op != null)
      {
         if(op.equalsIgnoreCase("set"))
         {
            String value = sr.getParameter("array");
            if(value == null)
               throw new IllegalStateException("op=set requires an array=x,y,z... value");
            String[] values = value.split(",");
            int[] array = new int[values.length];
            for(int n = 0; n < values.length; n ++)
               array[n] = Integer.parseInt(values[n]);
            setArray(array);
         }
      }
      // Copy the current info array to the Sequencer.info attribute
      Integer[] info = Sequencer.info;
      sr.setAttribute("Sequencer.info", info);
   }
View Full Code Here

Examples of javax.servlet.ServletRequest

     * @throws IOException if an I/O exception ocours
     * @throws ServletException if a servlet exception ocours
     */
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
        throws IOException, ServletException {
        ServletRequest sessionBindingRequest = new HttpServletRequestWrapper((HttpServletRequest) servletRequest);
        HttpServletResponse response = (HttpServletResponse) servletResponse;
        ResponseFactory.addNoCacheHeaderDirective(response);
        filterChain.doFilter(sessionBindingRequest, servletResponse);
    }
View Full Code Here

Examples of javax.servlet.ServletRequest

    return scope;
  }
 
  private boolean isSessionScope()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request != null) {
      HttpSession session = ((HttpServletRequest) request).getSession();

      return session != null;
View Full Code Here

Examples of javax.servlet.ServletRequest

    return false;
  }
 
  private Scope getSessionScope()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request == null)
      return null;
   
    HttpSession session = ((HttpServletRequest) request).getSession();
View Full Code Here

Examples of javax.servlet.ServletRequest

    return scope;
  }
 
  private Scope createSessionScope()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request == null)
      return null;
   
    HttpSession session = ((HttpServletRequest) request).getSession();

    if (session == null)
      return null;
   
    Scope scope = (Scope) session.getAttribute(SESSION_CONVERSATION);
   
    if (scope == null) {
      scope = new Scope();
      session.setAttribute(SESSION_CONVERSATION, scope);
    }
   
    request.setAttribute(REQUEST_CONVERSATION, new RequestListener(scope));
   
    return scope;
  }
View Full Code Here

Examples of javax.servlet.ServletRequest

   * Returns true if the scope is currently active.
   */
  @Override
  public boolean isActive()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request != null) {
      HttpSession session = ((HttpServletRequest) request).getSession();

      return session != null;
View Full Code Here

Examples of javax.servlet.ServletRequest

  }

  @Override
  protected ContextContainer getContextContainer()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request == null)
      return null;

    HttpSession session = ((HttpServletRequest) request).getSession();
View Full Code Here

Examples of javax.servlet.ServletRequest

  }

  @Override
  protected ContextContainer createContextContainer()
  {
    ServletRequest request = ServletInvocation.getContextRequest();

    if (request == null)
      return null;

    HttpSession session = ((HttpServletRequest) request).getSession();
View Full Code Here

Examples of javax.servlet.ServletRequest

        String charEncoding = getCharEncoding();

        if (charEncoding != null)
          response.getResponseStream().setEncoding(charEncoding);

        final ServletRequest request = pageContext.getRequest();

        disp.include(request, response);

        final Integer statusCode
          = (Integer) request.getAttribute("com.caucho.dispatch.response.statusCode");

        //jsp/1jif
        if (statusCode != null) {
          final int status = statusCode.intValue();

          if (status < 200 || status > 299) {
            String message = L.l(
              "c:import status code {0} received while serving {1}",
              statusCode,
              context + url);

            throw new JspException(message);
          }
        }

        /*
        int status = response.getStatus();

        if (status < 200 || status > 299) {
          String message = L.l(
            "c:import status code {0} received while serving {1}",
            status,
            context + url);

          throw new JspException(message);
        }
        */
      }
      else
        handleExternalBody(context + url);
     
      return;
    }

    int colon = url.indexOf(':');
    int slash = url.indexOf('/');
    if (slash == 0 || colon < 0 || slash < 0 || slash < colon) {
      ServletRequest request = pageContext.getRequest();
      CauchoResponse response = (CauchoResponse) pageContext.getResponse();

      String charEncoding = getCharEncoding();

      if (charEncoding != null)
        response.getResponseStream().setEncoding(charEncoding);

      RequestDispatcher disp = request.getRequestDispatcher(url);

      JstlImportResponseWrapper wrapper = new JstlImportResponseWrapper(response);
      disp.include(request, wrapper);

      //jsp/1jie
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.