I have solved the problem, but ran into another one.
If a servlet gets rendered the same way a jsp does, if i place the jsp usebean tags in the servlet, shouldnt the bean display in the servlet?
I have solved the problem, but ran into another one.
If a servlet gets rendered the same way a jsp does, if i place the jsp usebean tags in the servlet, shouldnt the bean display in the servlet?
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
Thanx
I am not sure i understand correctly but are u looking to do something like this:
<a href='/somepage.asp?name=<%=session("username")%>'
thanx for the reply.
when setting the value in the servlet do i call the setter method ?
or use request.setAttribute() ?
Hi
I am using ajax and jsp in my web application.
The user is required to fill out a few forms, for this i am using ajax to go through the forms, on one of the forms i need to set the session bean value and i am unsure as to how to do that.
Do i submit the form to a servlet then cause the servlet to redirect to a particular page within the specified div tag.
I have to use struts 1.1 though.
any help will be appreciated.
Thanx