Question: hello all i got a tutorial for getting string/text as response from struts2 action class. it is from struts2 documentation and the link is [tutorial](http://struts.apache.org/2.2.3/docs/how-can-we-return-a-text-string-as-the-response.html). It is working. But my question is the StringBufferInputstream calss is deprecated. So can we use this class. if no so what is alternate for this.

Answer: 
You can try it this way:

```
import org.apache.struts2.ServletActionContext;
import java.io.PrintWriter;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class MyStringAction extends ActionSupport {

      @Override
      public String execute() throws Exception
      {
        PrintWriter out = ServletActionContext.getResponse().getWriter();
        out.write("Your String!");
        return Action.NONE;
      }
    }

```
First thing first, that example is more about file download content and work with stream results.
`StringBufferInputstream` has been deprecated and you can use its alternate one.I am not sure what kind of things you are working with and if you do not working with file download stuff i will not suggest you use stream result for other things.

For Ajax you can use simple Jquery and see how you can call Struts2 actions and how response is getting back to the JSP page.

for starting, suggest to have look at following official documents

* [Struts2 guides](http://struts.apache.org/2.3.3/docs/guides.html)
* [Struts2 tutorials](http://struts.apache.org/2.3.3/docs/tutorials.html)

Hope that will give you some idea.