Skip to main content

Posts

Localization/Internationalization in oracle adf

Internationalization and Localization are means of adapting aplication to different languages, regional differences and technical requirements of a target market. Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for aspecific region or language by adding locale-specific components and translating text. Follow below steps for doing localization. 1. Create .properties files as per the locales required in your application. For demo purpose i created german and english locale properties file, one main file is required which will congtain all labelsSo total 3 properties files are there. For property file creation ViewController->New->General->File InterBundle.properties file is the main properties file and for the same labels 2 different files are created one is for english and a...

ADF Servlet Filter

This blog is to guide you how you can filter the requests and add your custom checks in ADF application. Follow below steps to create/configure a Servlet Filter in your ADF/Webcenter application. 1. From new wizard select Servlet and select Servlet Filter 2. Click on next 3. Enter the name of Servlet filter and package 4. Map to Servlet or JSP radio button should be selected and it is default selection. 5. Click on finish and you will get a servlet filter created. This is the class generated after you click finish, it is having init, destroy and doFilter methods.  We will write our logic in doFilter method. This will be called whenever a Servlet or jsp page request arrive to application.    As we created servlet filter with ADF steps so it has added our filter entry in web.xml file which is a mandate to work our filter.  We can create other filters also but we must register it in web.xml file. W...

Read data from ADF property file using java

package propertyfile; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; public class ReadPropertyFile {     public ReadPropertyFile() {         super();     }       public static void main(String args []){         try {             File file = new File("/opt/oracle/urls/test.properties");             FileInputStream fileInputStream = new FileInputStream(file);             ResourceBundle bundle =new PropertyResourceBundle(fileInputStream);             String appURL = bundle.getString("googleRedirectURL");             System.out.println(appURL);             fileInputStream.clo...

Java Design Patterns

Introduction : Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time. In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book titled Design Patterns - Elements of Reusable Object-Oriented Software which initiated the concept of Design Pattern in Software development.These authors are collectively known as Gang of Four (GOF). As per the design pattern reference book Design Patterns - Elements of Reusable Object-Oriented Software, there are 23 design patterns which can be ...

Deployment - Session-Descriptor Parameters

Below list of will help you to configure cookies and do session related settings. You can do these settings at application or server level. 1. timeout-secs Sets the time, in seconds, that WebLogic Server waits before timing out a session. The default value is 3600 seconds. On busy sites, you can tune your application by adjusting the timeout of sessions. While you want to give a browser client every opportunity to finish a session, you do not want to tie up the server needlessly if the user has left the site or otherwise abandoned the session. This element can be overridden by the session-timeout element (defined in minutes) in web.xml. 2. invalidation-interval-secs Sets the time, in seconds, that WebLogic Server waits between doing house-cleaning checks for timed-out and invalid sessions, and deleting the old sessions and freeing up memory. Use this element to tune WebLogic Server for best performance on high traffic sites. The default value is 60 seconds. 3. sharing-ena...

ADF Faces configuration

ADF Faces configuration options are defined in the web.xml file using <context-param> elements. STATE_SAVING_METHOD : The JSF parameter javax.faces.STATE_SAVING_METHOD identifies where the state of the view is stored between requests.  By default, the state is saved in the servlet session. Set the STATE_SAVING_METHOD parameter to client in the context-param stanza of the web.xml file, so that JSF stores the state of the entire view in a hidden field on the rendered page. If you do not, then JSF may attempt to cache that state,  which is not serializable, in the session object. <context-param>     <param-name>javax.faces.STATE_SAVING_METHOD</param-name>     <param-value>client</param-value> </context-param> CLIENT_STATE_METHOD  :  org.apache.myfaces.trinidad.CLIENT_STATE_METHOD specifies the type of client-side state saving to use when client-side state saving is enabled by using javax.fa...

ADF Deployment - Security settings

To Avoid the Cross-Site Request Forgery (CSRF) attack in your application, make below settings in web.xml file. <!--Enable client-side state saving, to store the view state on the browser client.--> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <!--- Specifies the type of client-side state saving to use when client-side state saving is enabled by using javax.faces.STATE_SAVING_METHOD-->  <context-param> <param-name>org.apache.myfaces.trinidad.CLIENT_STATE_METHOD</param-name> <param-value>token</param-value> </context-param> <!--Defined to specify context parameter to use framebusting in your application--> <context-param> <param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name> <param-value>differentDomain</param-value> </context-p...