Link to home
Start Free TrialLog in
Avatar of jaggernat
jaggernat

asked on

controlling display of data in jsp page

hi experts

I have a submit button in my jsp page and on submit it goes to the action class and displays the data. Displaying of data is
done in jsp and this peice of code in the jsp does that :

jsp code:

<div>
 
<%

   
   if(session.getAttribute("logrepor") != null) out.println((String)session.getAttribute("logrepor"));

%>


and i am setting it in the session in action class. like this



                session.setAttribute("logreportresult", lines.toString());
           
       

so when i hit submit button i see the data of -->   out.println((String)session.getAttribute("logrepor"));
in my jsp page
The problem is hereafter when ever the jsp page loads it shows me the data in  
out.println((String)session.getAttribute("logreportresult"));
 since it is set in session and its displaying it from session

is there any way i can change the code so that i can see -->  out.println((String)session.getAttribute("logrepor"));

only when i hit the submit button and not everytime the page loads

any responces greatly appreciated
thanks

J
ASKER CERTIFIED SOLUTION
Avatar of fargo
fargo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fargo
fargo

one more thing, if the page is getting load with the same action class.. u need to have different handling with the action class.
May be one action to handle the submit and the other action class to handle the page load. Something like dispatch action will work great in this scenario.
Avatar of jaggernat

ASKER

request works thanks