there are different types of result types for a struts2 action. for full list please visit. http://struts.apache.org/release/2.1.x/docs/result-types.html from the book how to implement a custom result type please see on http://lkreddy.blogspot.in/2012/04/how-to-write-our-own-result-type-in.html public class my customresultType extends PlainTextResult{ } then in struts.xml file define this result type and then use this in any action