How to execute method on page load method call in ADF Faces

1. Open the page definition of your JSF Page – TestOnPageLoad.jspx 2. Add the controllerlclass in the <PageDefinition> tag as given below <pageDefinition xmlns=”http://xmlns.oracle.com/adfm/uimodel” version=”11.1.1.60.13″ id=”TestOnPageLoadPageDef” Package=”view.pageDefs” ControllerClass=”com.test.bean.PageLoadBackingBean”> 3. Create the class – executeOnPageLoadMethod which implements PagePhaseListener and override the beforePhase method. import oracle.adf.controller.faces.context.FacesPageLifecycleContext; import oracle.adf.controller.v2.lifecycle.Lifecycle; import oracle.adf.controller.v2.lifecycle.PagePhaseEvent; import oracle.adf.controller.v2.lifecycle.PagePhaseListener; import oracle.binding.BindingContainer; public class executeOnPageLoadMethod […]

Read More

How ADF client authentication can be defined or set in the web.xml

<security-constraint> <web-resource-collection> <web-resource-name>allPages</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>valid-users</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>adfAuthentication</web-resource-name> <url-pattern>/adfAuthentication</url-pattern> </web-resource-collection> <auth-constraint> <role-name>valid-users</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>CLIENT-CERT</auth-method> </login-config> <security-role> <role-name>valid-users</role-name> </security-role>

Read More

mime types to be defined in web.xml for pdf, css, images,javascript in the mime-mapping tag

If you are using the PDF or JavaScript or images with differnt extensions png, jpeg, gif then that should be defined in the mime-mapping tag in the web.xml . Example is given below. <mime-mapping> <extension>pdf</extension> <mime-type>application/pdf</mime-type> </mime-mapping> <mime-mapping> <extension>javascript</extension> <mime-type>application/x-javascript</mime-type> </mime-mapping> <mime-mapping> <extension>css</extension> <mime-type>text/css</mime-type> </mime-mapping> <mime-mapping> <extension>swf</extension> <mime-type>application/x-shockwave-flash</mime-type> </mime-mapping> <mime-mapping> <extension>txt</extension> <mime-type>text/plain</mime-type> </mime-mapping> <mime-mapping> <extension>png</extension> […]

Read More

How to identify the different user agent values for browsers in ADF Faces

Place the below sample code in your application to receive the user agent values for diffent browsers like safari, chrome ,IE , Mozilla public String getUserAgentValue() { FacesContext facesCtx = FacesContext.getCurrentInstance().getCurrentInstance(); ExternalContext externalctx = facesCtx.getExternalContext(); HttpServletRequest request = (HttpServletRequest)externalctx.getRequest(); String userAgentVal = null; userAgentVal=request.getHeader(“User-Agent”); userAgentVal=userAgentVal.toLowerCase(); if (userAgentVal != null && userAgentVal.indexOf(“iphone”) > -1) { userAgentVal […]

Read More

How to remove default value “ALL” from the and

If you see the below given value in the SelectItem it does not show the value for “ALL” but still the option “ALL” will be shown in the mutiple selection. <af:selectManyChoice label=”SelectManyChoiceExp” binding=”#{backingBeanScope.backing_sample.smc1}” id=”smc1″> <af:selectItem label=”One” value=”One” binding=”#{backingBeanScope.backing_sample.si1}” id=”si1″/> <af:selectItem label=”Two” value=”Two” binding=”#{backingBeanScope.backing_sample.si2}” id=”si2″/> </af:selectManyChoice> <af:selectManyListbox label=”SelectManyListBoxExp” binding=”#{backingBeanScope.backing_sample.sml1}” id=”sml1″> <af:selectItem label=”One” value=”One” binding=”#{backingBeanScope.backing_sample.si3}” id=”si3″/> <af:selectItem […]

Read More