I have one text box. While submitting my form it navigates to another JSP file. On that file i want to set session value and next to line i want to get that session value.
For example:
File1.JSP
<form action="File2.JSP" method="post">
    <input type="text" name="searchtxt"/>
    <input type=submit value="Save"/>
</form>
File2.JSP
<% 
    String searxhtxt=request.getParameter("searchtxt");
    if(searchtxt!=null && !searchtxt.equals("")){
        request.getSession().setAttribute("searchtxt",searchtxt);
    }
    String text=session.getAttribute("searchtxt").toString();
 %>
But always I am getting null value even the text box contains empty or some value. How to solve this problem?
 
     
     
     
    