difference request and session in scope

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

[614 byte] By [WorldOfJavaa] at [2007-10-3 5:25:57]
# 1

> 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 ""

aniseeda at 2007-7-14 23:33:11 > top of Java-index,Java Essentials,Java Programming...
# 2

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

WorldOfJavaa at 2007-7-14 23:33:11 > top of Java-index,Java Essentials,Java Programming...
# 3

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;

}

WorldOfJavaa at 2007-7-14 23:33:11 > top of Java-index,Java Essentials,Java Programming...