Saturday, 13 September 2014

How to Make Spring form input as Read Only

Spring JSTL form:input tag the proper syntax is readonly=”true"
==============================================
<form:input path="caseId" readonly="true"/>

=======================================================================
And if you are using HTML tag input then this will be the tag readonly="readonly"

<input name="caseId"  readonly="readonly" class="required"/>
=======================================================================

spring mvc form input readonly syntax is readonly="true"

for Html tag it is  readonly="readonly"

how to set up html image height width

how to set up html image height width
======================================================

<html>
<body>

<img src="vipulImagePath.gif"  width="42" height="60">

</body>
</html>

======================================================
We have image tag attributes height width
======================================================

Saturday, 6 September 2014

All Pages link

===================================================================
Glassfish server runtime requires full JDK instead of JRE
===================================================================
Starting Tomcat v7.0 server at localhost has encountered a problem in eclipse
===================================================================
Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
===================================================================
Fixed error Project facet Java version 1.7 is not supported in eclipse
===================================================================
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed
===================================================================

Friday, 4 July 2014

How do I compare strings in Java

Use equals () to compare

two string 



package com.vipul;

public class StringComporation {

      /**
      * How do I compare strings in Java
      * @param args
      */
      public static void main(String[] args) {
            String fooString1 = new String("foo");
            String fooString2 = new String("foo");
            // Evaluates to true
            if(fooString1.equals(fooString2));
            {
                  System.out.println(fooString1);
            }
           

      }

}
==========================================================================
Maven + eclipse related 
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed

==================================================================================

How to convert StringBuilder to String

package com.vipul;

public class StringBuildertoString {

      /**
      * How to convert StringBuilder to String
      * @param args
      */
      public static void main(String[] args) {
            StringBuilder sb = new StringBuilder();
                sb.append("test");

                System.out.println(sb.toString());

      }

}

==========================================================================
Maven + eclipse related 
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed

==================================================================================

How to concatenate or combine two Strings

How to combine two Strings


package com.vipul;

public class Stingconcatenate {

      /**
      * How to combine two Strings
      * @param args
      */
      public static void main(String[] args) {
            String firstName = "Vipul";
            String lastName  = "Gulhane";
            String fullName  = firstName + lastName;
            System.out.println("Stingconcatenate is "+fullName);
      }

}

==========================================================================
Maven + eclipse related 
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed

==================================================================================

How to remove the last character in StringBuilder

How to remove the last character in StringBuilder


package com.vipul;

public class StringBufferDelete {

      /**
      * How to remove the last character in StringBuilder
      * @param args
      */
      public static void main(String[] args) {
            String text2 = "Test";         
              StringBuffer text=new StringBuffer(text2);
           // ...
           final int length = text.length();
           if ( length > 0 ) {
                // We have remove the last character.
                text.deleteCharAt( length - 1 );
           }
           System.out.println(text);
      }

}

==========================================================================
Maven + eclipse related 
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 fixed

==================================================================================