Tag Archives: Java

How to create a Custom ADF Component

In this tutorial, we will create a custom ADF Component. Create new files and package structure as shown: Source Code of the required files is as below: AlertDemo.java package com.techutils.adf.jsf.faces.component; import javax.faces.event.AbortProcessingException; import javax.faces.event.FacesEvent; import org.apache.myfaces.trinidad.bean.FacesBean; import org.apache.myfaces.trinidad.bean.PropertyKey; import org.apache.myfaces.trinidad.component.UIXObject; … Continue reading

Posted in Oracle, Oracle ADF | Tagged , , , , , , , | Leave a comment

Retrieve GET parameters from URL in Managed Bean in Oracle ADF

For obtaining parameter from URL in java code in Oracle ADF use the below code URL: http://127.0.0.1:7101/Application-ViewController-context-root/faces/page.jspx?paramName=Testing123 Use the code: String test = FacesContext. getCurrentInstance().getExternalContext().getRequestParameterMap().get(“paramName”);

Posted in Oracle, Oracle ADF | Tagged , , , , , | Leave a comment

File Sorting based on parameters

Many times our file directories are full of files that we may like to be sorted in some particular manner. Below is the code to sort the files as per the following ways: Month Sorting Alphabetic Sorting Music Album Sorting Extension … Continue reading

Posted in Java, Open Source | Tagged , , , , , , | Leave a comment

Code to Encrypt Folder Structure Completely

Below is the code to encrypt/decrypt complete folder structure in java import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.CipherOutputStream; import javax.crypto.spec.SecretKeySpec; public class CryptoX { static String pwd = “”; private static String compressPassword(String … Continue reading

Posted in Java | Tagged , , , , , , , | Leave a comment

Code to Download File from URL in Java

Below is the code to download the complete contents of a URL to your local hard drive. //IMPORTS import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.io.File; METHOD CODE private static void download(String url) throws … Continue reading

Posted in Java | Tagged , , , , , , | Leave a comment

How to Decompile Class/Jar Files

For Decompiling Java Classes or Complete Jar files, JD-GUI is very useful. Download Link   Since it is Open Source, no worries for Licencing fees as well

Posted in Java, Open Source | Tagged , , , , , | 1 Comment

Insert Rows in ADF View Object Programatically

Suppose that I have EmpVO view object which have below attributes EmpId, FirstName, LastName We can do inserting rows by two ways in data model layer (Application Model or View Object classes) I will write my code in ApplicationModuleImpl class try … Continue reading

Posted in Oracle, Oracle ADF | Tagged , , , , , , | Leave a comment