I have looked around this site but have not found anything to help me.
I have a jsp page which takes user input, the page is then posted to a servlet using ajax, the servlet then sets a bean value.
My problem is that when i go back to the main page, the bean value is not displaying in the jsp page.
I created a Bean class which has my setter and getter methods, and a servlet which sets the bean value.
in the servlet i used the following to set the value of the bean
SubscriberBean subscriberBeanRef = new SubscriberBean(); subscriberNameVar = request.getParameter("subscriberName"); subscriberBeanRef.setsubscriberName(subscriberNameVar);
In my jsp i use the jsp usebean tag which imports my bean class to get the value, and i set the scope to session. Is that correct?
I have read that i should set the httpsession to set the attribute, i have tried that as well, but still no results in my jsp page.
code used for setting the session attribute.
String subscriberNameVar; HttpSession session = request.getSession(true); subscriberNameVar = request.getParameter("subscriberName"); session.setAttribute("subscriberName", subscriberNameVar);
I have no clue what i m doing wrong please help