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
To create string there are two ways 1. String s3= new String("hello"); String s4= new String ("hello"); 2. String s1= "hello"; String s2="hello"; which method is better ? second method Because the content is same s1 and s2 refer to the same object where as s3 and s4 do not refer to the same object. The 'new' key word creates new objects for s3 and s4 which is expensive. StringBuffer and StringBuilder StringBuffer is used to store character strings that will be changed ( String objects cannot be changed). It automatically expands as needed. Related classes: String, CharSequence. it is synchronized . StringBuilder was added in Java 5. It is identical in all respects to StringBuffer except that it is not synchronized , which means that if multiple threads are accessing it at the same time, there could be trouble. For single-threaded programs, the most common case, avoiding the overhead ...
Comments
Post a Comment