Posts

Showing posts with the label system

Difference between System Exception and Portal Exception

SystemException  This  Exception caused by system problems. Examples include database connection errors and file not found errors.   System exceptions are always unexpected , and generally indicate that the   portal is misconfigured or that a critical service is unavailable. PortalException  This exceptions related to business logic. Examples include invalid input, portlet errors, and references to non existent database records.   Portal exceptions are generally caused by user error , and do not indicate that anything is wrong with the portal itself.

Copying array to another array

Sometimes it is required to copy array to another array, how can we do that? Here is the things, In the java.lang.system class we have System.arrayCopy(-,-.....); we can utlize these method to copy the array. Here is the method : System.arraycopy(src, srcPos, dest, destPos, length); Here we have 2 array fields , which we need to copy into the String [] finalfields array. final String [] userField = {"screenName","firstName","lastName","emailAddress","jobTitle"}; final String [] addressFields= {"streetNo","pinCode"}; Calculating the finalfields array size int fieldsSize = userField.length + addressFields.length; String [] finalfields = new String[fieldsSize]; System.arraycopy(userField, 0, finalfields, 0, userField.length); Here we have copied the "userField" array values into the "finalfields" array values. System.arraycopy(addressFields, 0, finalfields, userField.length, addressFie...