Posts

check valid URL for sitemaps in java code examples

How to check valid URL for sitemaps in java code, Examples private boolean isValidMyUrl(String input) {         Pattern p = Pattern.compile("[^A-Za-z0-9. ,@_$-]+");         Matcher m = p.matcher(input);         boolean result = m.find();         if (result) {             return false;         } else {             return true;         }     }

equals and equalsIgnoreCase in String java example

how to use equals and equalsIgnoreCase in String java example public class Test {         public static void main(String[] args) {                    String st = new String("Test String Here");             String st1 = new String("test string here");                         System.out.println(st.equals(st1));             System.out.println(st.equalsIgnoreCase(st1));                     } }

What is different type of indexOf() method in String java example

What is different type of indexOf() method in String java example public class Test {         public static void main(String[] args) {                    String st = new String("test string test here");                         int index = st.indexOf((int)'t');             System.out.println(index);                         index = st.indexOf((int)'t', 5);             System.out.println(index);                         index = st.indexOf("test");             System.out.pr...

BeanUtils.populate IllegalArgumentException: array element type mismatch

type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:627) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) root cause java.lang.IllegalArgumentException: array element type mismatch java.lang.reflect.Array.set(Native Method) org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:464) org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:986) org.apach...

What is different type of lastIndexOf method in String java example

What is different type of lastIndexOf() method in String java example public class Test {         public static void main(String[] args) {                    String st = new String("test string test here");                         int index = st.lastIndexOf((int)'t');             System.out.println(index);                         index = st.lastIndexOf((int)'t', 5);             System.out.println(index);                         index = st.lastIndexOf("test");           ...

What is different type of substring method in String java example

What is different type of substring method in String java example public class Test {         public static void main(String[] args) {                    String st = new String("Test String Here");             String st1 = new String("test string test here");                         String st2 = st.substring(5);             System.out.println(st2);                         st2 = st.substring(0, 11);             System.out.println(st2);                         st2 = st.s...

What is different between replace, replaceAll and replaceFirst in String java example

Java code example for different between replace, replaceAll and replaceFirst in String. public class Test {         public static void main(String[] args) {                    String st = new String("Test String Here");             String st1 = new String("test string test here");                         String st2 = st.replace("Test", "New");             System.out.println(st2);                         st2 = st1.replaceAll("test", "New");             System.out.println(st2);                  ...

Recent Post

Recent Posts Widget