JSP ajax question

Thread Solved
Reply

Join Date: Mar 2008
Posts: 288
Reputation: Thirusha is an unknown quantity at this point 
Solved Threads: 46
Thirusha's Avatar
Thirusha Thirusha is offline Offline
Posting Whiz in Training

JSP ajax question

 
0
  #1
Mar 10th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,582
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 461
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: JSP ajax question

 
0
  #2
Mar 10th, 2008
Yes, submit the form to a servlet, perform the processing and redirect to a page whose output you would like to have in responseText attribute of the XMLHttpRequest object.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 288
Reputation: Thirusha is an unknown quantity at this point 
Solved Threads: 46
Thirusha's Avatar
Thirusha Thirusha is offline Offline
Posting Whiz in Training

Re: JSP ajax question

 
0
  #3
Mar 11th, 2008
thanx for the reply.

when setting the value in the servlet do i call the setter method ?
or use request.setAttribute() ?
Last edited by Thirusha; Mar 11th, 2008 at 5:12 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,582
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 461
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: JSP ajax question

 
0
  #4
Mar 12th, 2008
Since you need to set the bean in the session scope, you need to do something like session.setAttribute("YourBeanName", yourBeanReference); . Read the form values in a normal manner; the same way you would do for a normal form submission i.e. request.getParameter("formFieldName");
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JSP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC