GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  Programming  >  Struts
Go To First  |  Previous Question  |  Next Question 
 Struts  |  Question 34 of 65    Print  
Hi, how can i implement Ajax in my existing struts Application?

Thanks in Advance.


  
Total Answers and Comments: 1 Last Update: March 01, 2007     Asked by: Nawaz 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 01, 2007 06:31:09   
Prashanth Reddy Yannam        

RE: Hi, how can i implement Ajax in my existing struts...
Hi

You need to take care of one thing in using AJAX with Struts and the remaining things will be same as a normal web application.

When you send a request using AJAX the corresponding Action class will be executed.
In normal scenario we return a ForwardAction from the execute method which interns used to identify and display a view.

But in our case we should return 'null' from the execute method as we are not trying to reload the present page or redirect to other page.

We store the result of the action in HttpServletResponse and we use PrintWriter to send the result as if we are writing a normal Servlet.

If we try to return a ActionMapping it will throw a IllegalStateException as the output is already committed.


All the best.
Regards
Prashanth

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Hi Guys,This is Krishna. As per my knowledge struts properties is new concept introduced in struts 2.0. its a file with name struts.properties. In this file we can specify wat is the resource bundle we are using like tat we specify....I m not quite sure ...

Latest Answer : hello sir,i want to know how to read the array of elements in java servlets ...
Read Answers (3) | Asked by : nilima

I got Problem while working in Validator Frame work?Any body can help plz.Problem is. All the Java Script coding from the validator-rules.xml all are printling on the screen. how to solve it? and what is the reason for that. i included the plug-in in struts-config.xml and i wrote the appropriate codes in validation.xml and i wrote bean.
Read Answers (2) | Asked by : Uma

In Struts Programming which is the controller,which is the model(interms of action class,form bean,struts-config.xml,Jsp page)and which is the view exactly.
Read Answers (17) | Asked by : venkat

In my struts application. after mapping from the action class to the jsp. the jsp couldnt identify the form bean.the tag tag not identifing my from bean. how can i rectify this problem
i dont know 

Latest Answer : Hi friend, I too lernt struts recently,acc to my knowledge,Advantages are 1)In case of big projects,If code for maintaining and display are combined, It will be difficult to change any thing in future. for ex, If database is changed from oracle to other, ...
Read Answers (7) | Asked by : Sudhakar

I am planing to use JFree charts in my project. My Apps is designed in Struts. I want to Know How to use Jfree charts in Struts.Please let me know
Read Answers (1) | Asked by : Rao

Latest Answer : Hi,    The explanation given by parindia is crystal clear But not Formatted thatt why looks messy,I have formatted it,Wonderful parindia ,You are really expert.  1) When a user submitted a jsp page. that page having (attribute ...

Latest Answer : Hello friend,Plz see this following linkhttp://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.htmli too learnt from this itselfbyecontact me at kynathk@yahoo.co.in ...
Read Answers (2) | Asked by : REDDY

Latest Answer : U can provide any value to the path attribute of the tag,but it must be same to the value written in action attribute of the form tag in the jsp. ...
Read Answers (1) | Asked by : suman


 Sponsored Links

 
Related Articles

Microsoft AJAX Library - Introducing JSON

Introducing JSON In AJAX applications client server communication is usually packed in XML documents or in the JSON JavaScript Object Notation format Interestingly enough JSON s popularity increased together with the AJAX phenomenon although the AJAX acronym includes XML mosgoogle JSON is the format
 

Microsoft AJAX Library - Inheritance using Prototypes

Inheritance using Prototypes Once again prototyping can help us implement an OOP feature in a more elegant way than when using closures Prototype based inheritance makes use of the behavior of JavaScript prototypes When accessing a member of a function that member will be looked for in the function
 

Microsoft AJAX Library - Inheritance using Closures

Inheritance using Closures and Prototypes There are two significant techniques for implementing the OOP concept of inheritance with JavaScript code The first technique uses closures and the other technique makes use of a feature of the language named prototyping Early implementations of the Microsof
 

Microsoft AJAX Library - JavaScript Execution Context

JavaScript Execution Context In this section we ll take a peek under the hood of the JavaScript closures and the mechanisms that allow us to create classes objects and object members in JavaScript For most cases understanding these mechanisms isn t absolutely necessary for writing JavaScript code&am
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Associative Arrays

Thinking of Objects as Associative Arrays A key element in understanding JavaScript objects is understanding the notion of associative arrays which are nothing more than collections of key value pairs As a NET developer you have worked with associative arrays represented by classes such as NameValue
 

Microsoft AJAX Library - C# and JavaScript Classes

C and JavaScript Classes For the purpose of demonstrating a few more OOP related concepts we ll use another class Our new class is named Table and it has two public fields rows columns and one method getCellCount The getCellCount method should return the number of rows multiplied by the number of co
 

Microsoft AJAX Library - JavaScript Classes

JavaScript Classes Not only can JavaScript functions contain other functions but they can also be instantiated This makes JavaScript functions a good candidate for implementing the concept of a class from traditional object oriented programming This is very helpful feature indeed because JavaScript
 

Microsoft AJAX Library - Anonymous Functions

Anonymous Functions Anonymous functions can be created adhoc and used instead of a named function Although this can hinder readability when the function is more complex you can do this if you don t intend to reuse a function s code In the following example we pass such an anonymous function to Displ
 

Microsoft AJAX Library - Functions as Variables

Functions as Variables In JavaScript functions are first class objects This means that a function is regarded as a data type whose values can be saved in local variables passed as parameters and so on For example when defining a function you can assign it to a variable and then call the function thr
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape