User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 391,971 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,174 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 980 | Replies: 3 | Solved
Reply
Join Date: Mar 2008
Posts: 108
Reputation: Thirusha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
Thirusha Thirusha is offline Offline
Junior Poster

JSP ajax question

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,775
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: JSP ajax question

  #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."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Mar 2008
Posts: 108
Reputation: Thirusha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
Thirusha Thirusha is offline Offline
Junior Poster

Re: JSP ajax question

  #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 4:12 am.
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,775
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: JSP ajax question

  #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."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 9:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC