Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequest


    ActionForward actionForward = new ActionForward();

    NavigableFormSubmitBean actionBean = createStrictMock(NavigableFormSubmitBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    actionBean.preBind();
    form.bindInwards(actionBean);
    actionBean.execute();
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);
View Full Code Here


    ActionForward actionForward = new ActionForward();

    NavigableFormSubmitBean actionBean = createStrictMock(NavigableFormSubmitBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    DelegatingForm form = createStrictMock(DelegatingForm.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(Boolean.TRUE);
    actionBean.cancel();
    expect(actionBean.getSuccessResult()).andReturn("cancel");
    expect(mapping.findForward("cancel")).andReturn(actionForward);

    replay(actionBean);
View Full Code Here

    ActionForward actionForward = new ActionForward();

    NavigableFormSubmitBean actionBean = createStrictMock(NavigableFormSubmitBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    BasicActionForm form = createStrictMock(BasicActionForm.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(null);
    actionBean.execute();
    expect(actionBean.getSuccessResult()).andReturn("success");
    expect(mapping.findForward("success")).andReturn(actionForward);

    replay(actionBean);
View Full Code Here

    ActionForward actionForward = new ActionForward();

    NavigableFormSubmitBean actionBean = createStrictMock(NavigableFormSubmitBean.class);
    ActionMapping mapping = createStrictMock(ActionMapping.class);
    BasicActionForm form = createStrictMock(BasicActionForm.class);
    HttpServletRequest request = createStrictMock(HttpServletRequest.class);

    expect(request.getAttribute(Globals.CANCEL_KEY)).andReturn(Boolean.TRUE);
    actionBean.cancel();
    expect(actionBean.getSuccessResult()).andReturn("cancel");
    expect(mapping.findForward("cancel")).andReturn(actionForward);

    replay(actionBean);
View Full Code Here

  @WebMethod
  @WebResult(name = "stringOut", partName = "stringOut")
  public String test1StringInStringOut(
      @WebParam(name = "string", partName = "string") String string) {
    HttpServletRequest request = (HttpServletRequest)Fiber.current().getPacket().get(MessageContext.SERVLET_REQUEST);
    HttpSession session = request.getSession(true);
    if(session != null){
      Object sessionAttr = session.getAttribute("sessionAttr");
      session.setAttribute("sessionAttr", string);
      if(sessionAttr != null){
        return sessionAttr.toString();
View Full Code Here

  }

  public void doFilter(ServletRequest req, ServletResponse res,
      FilterChain chain) throws IOException, ServletException {
    if (req instanceof HttpServletRequest) {     
      HttpServletRequest request = (HttpServletRequest) req;
      HttpServletResponse response = (HttpServletResponse) res;
      try{
        String uri = request.getRequestURI().substring(request.getContextPath().length());
        boolean ignore = ignore_pages.contains(uri);
        /*
        if(ignore){
          System.out.println("Ignore " + uri);
        }*/
 
View Full Code Here

            return;
         }

         if (config == null || Util.getUIPortal().getName().equals(portalName))
         {
            HttpServletRequest request = prContext.getRequest();
            request.getSession().invalidate();
            prContext.setResponseComplete(true);
            prContext.getResponse().sendRedirect(request.getContextPath());
            return;
         }

         //event.getSource().loadPortalConfigs();
         //UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);   
View Full Code Here

   *  Accepts string to display action detail information
   */
  public void setTitle()
  {
    setCompanyname("CentraView");
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
    HttpSession session = request.getSession(true);
    title = "<title> ";

    if (session.getAttribute("userName") != null)
    {
      setUsername(session.getAttribute("userName").toString());
      title += (companyname + ":" + username);
    }
    else
    {
      title += companyname;
    }

    title += (": " + moduleName);

    if (request.getAttribute("detailName") != null)
    {
      title += (": " + request.getAttribute("detailName"));
    }

    if (request.getAttribute("actionName") != null)
    {
      setActionname(request.getAttribute("actionName").toString());
      title += (":" + actionname);
    }

    if (request.getAttribute("actionDetail") != null)
    {
      setActiondetail(request.getAttribute("actionDetail").toString());
      title += (":" + actiondetail);
    }

    title += " </title>";
  }
View Full Code Here

   * @param chain     The Filterchain object passed in from the container.
   * @return          void
   */
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException
  {
    HttpServletRequest req = (HttpServletRequest)request;
    HttpServletResponse res = (HttpServletResponse)response;

    // Check to see if we are currently trying to log in.  If so, then let the request go.
    if ((request.getParameter("username") == null) && (request.getParameter("password") == null)) {
      // well we aren't trying to login in an obvious way, so check the session for a null UserObject
      HttpSession session = req.getSession(true);
      if ((UserObject)session.getAttribute("userobject") == null) {
        // Apparently we don't have a userObject.  Is this request trying to go to
        // a screen which doesn't require a valid logged-in user with a session?
        String servletPath = req.getServletPath();

        boolean isValidUrl = false;
        for (int i = 0; i < PopulateUserObject.validUrls.length; i++) {
          if (servletPath.equals(PopulateUserObject.validUrls[i])) {
            isValidUrl = true;
          }
        }

        if (! isValidUrl) {
          // nope.  Go Directly to Jail. Do not pass Go. Do not collect $200.
          req.getRequestDispatcher(res.encodeURL("/start.do")).forward(req, res);
        }
      } else if (session.getAttribute("expiredLicense") != null) {
        // okay, so we have a non null userobject on the session, BUT the license is expired
        // So the admin may be trying to dance without paying the piper.  But the chisler
        // didn't count on this filter.  He had better be trying to view or save the license and
        // that is all, or else there will be a repeat of that business that occurred in Hamelin.
        String requestURL = req.getServletPath();
        // SaveLicense.do or DisplayLicense.do or logout.do
        if (!(requestURL.matches("^/\\S+License.do$") || requestURL.matches("^/logout.do$"))) {
          // get back there and pay me!
          req.getRequestDispatcher(res.encodeURL("/DisplayLicense.do")).forward(req, res);
        }
      }
    }
    chain.doFilter(req, res);
  }   // end doFilter()
View Full Code Here

  public int doEndTag() throws JspException
  {

    setDisabled(false);
    HttpSession session = ((HttpServletRequest)pageContext.getRequest()).getSession();
    HttpServletRequest req = (HttpServletRequest)pageContext.getRequest();

    UserObject userObject = (UserObject)session.getAttribute("userobject");

    int individualID = userObject.getIndividualID();
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServletRequest

Copyright © 2015 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.