3 Replies Latest reply: Sep 21, 2006 4:55 AM by 807569 RSS

    difference request and session in scope

    807569
      can any one explaine me what is the
      difference request and session in scope in struts-config.xml

      i have a text box and a button in demo.jsp page
      while clicking the button after entering the text box

      it navigate to result.jsp page

      result.jsp page has a return button
      while clicking the button

      it navigate to demo.jsp page

      if i set scope as session , text box value remains in the text box
      if i set scope as request , text box value become empty in the text box

      how to make the text box empty when scope is set to session?

      thanks in advance
        • 1. Re: difference request and session in scope
          807569
          can any one explaine me what is the
          difference request and session in scope in
          struts-config.xml
          It's the same as the scope for a request attribute and session attribute. This is part of the basics of servlet/JSP.
          how to make the text box empty when scope is set to
          session?
          set the value of the text box explicitly to ""
          • 2. Re: difference request and session in scope
            807569
            Can u please tell me where should i need to reset?

            private String txt = "";

            setTxt(String txt)
            {
            this.txt = txt;
            }

            getTxt()
            {
            }

            public void reset(ActionMapping actionMapping, HttpServletRequest request)
            {         
            this.txt = "";     
            }

            thanks in advance
            • 3. check bok in session scope
              807569
              when i set scope as session

              check boks in my form doent set to false when i uncheck the check box

              set method is not called when i unchech the check box

              why it happen ?

              how to do it?

                   private boolean chk = false;

                   public boolean isChk()
                   {
                        System.out.println("Get chk :"+this.chk);
                        return chk;
                   }

                   public void setChk(boolean chk)
                   {
                        System.out.println("Set chk :"+chk);
                        this.chk = chk;
                   }