Showing posts with label ADF. Show all posts
Showing posts with label ADF. Show all posts

Saturday, November 3, 2018

Logout and expiring session in Oracle ADF

To end a user's session before the session expires, you can call the invalidate() method on the HttpSession object from a backing bean in response to the user's click on a Logout button or link. This cleans up the HttpSession in the same way as if the session time had expired. Using JSF and ADF, after invalidating the session, you must perform a redirect to the next page you want to display, rather than just doing a forward.

Following code shows a way to perform this task from a Logout button.           

 import javax.faces.context.ExternalContext; 
 import javax.faces.context.FacesContext; 
 import javax.servlet.http.HttpServletRequest; 
 import javax.servlet.http.HttpSession;                
 import weblogic.servlet.security.ServletAuthentication; 
  
   public String onLogout(){ 
     FacesContext fctx = FacesContext.getCurrentInstance(); 
     ExternalContext ectx = fctx.getExternalContext(); 
     String url = ectx.getRequestContextPath() + "/adfAuthentication?logout=true&end_url=/faces/login.jspx"; 
      
     HttpSession session = (HttpSession)ectx.getSession(false); 
     session.invalidate(); 
      
     HttpServletRequest request = (HttpServletRequest)ectx.getRequest(); 
     ServletAuthentication.logout(request); 
     ServletAuthentication.invalidateAll(request); 
     ServletAuthentication.killCookie(request); 
      
     try{ 
       ectx.redirect(url); 
     } 
     catch(Exception e){ 
       e.printStackTrace(); 
     } 
     fctx.responseComplete(); 
      
     return null; 
   } 

Happy learningJ

Thursday, October 11, 2018

Oracle ADF Application – Migration from 12.2.1.0.0 to 12.2.1.3.0

                        Sometimes the ADF applications migration is not a simple button press, so when you are thinking of migrating our ADF application take in consideration that it is possible to lose some time to make all your code working in a new ADF version. However, I hope that reading this document could help you and speed up any problem situation you face in this process.

Ideally, When we thought of migration, we will just install the required version and open old version ADF application new version JDeveloper. 

So, it will show the migration wizard, Whereas it's given while we are doing  Migration from 12.2.1.0.0 to 12.2.1.3.0.

Here are the simple steps I followed to migrate the ADF application from 12.2.1.0.0 to 12.2.1.3.0.

I made below changes on jws and jpr files to migrate. [ Close the application from Jdeveloper]

1. jws changes: comment the below line in Application jws.

  <!--<value n="oracle.mds.internal.dt.ide.migrator.MDSConfigMigratorHelper" v="11.1.1.0.5313"/>-->

2. jpr changes: comment the below line in project jpr.

<!--<value n="oracle.adfdtinternal.view.common.migration.wizards.MigrationHelper" v="11.1.1.1.0.3"/>-->

 Note:-  need to do the same for all jpr's if you have multiple projects in the application.

Open the Application in JDeveloper(after changes)- now it will ask for migration wizard.






How? Can I verify the migration? Probably (Thinking………..? running the application and see if its working as expected) J

I can also check by verifying the below changes in jpr and jws.

Jpr:- Check the below values

Before migration:
<value n="oracle.ide.model.Project" v="12.2.1.0.0"/>

After Migration:
<value n="oracle.ide.model.Project" v="12.2.1.0.0;12.2.1.3.0"/>

And commented one will change back while migration.
                <value n="oracle.adfdtinternal.view.common.migration.wizards.MigrationHelper" v="11.1.1.1.0.3"/>

Jws:- Check the below values

Before migration:
<value n="oracle.ide.model.Project" v="11.1.1.1.0;12.2.1.0.0"/>

After Migration:
<value n="oracle.ide.model.Project" v="11.1.1.1.0;12.2.1.0.0;12.2.1.3.0"/>

And commented one will change back while migration.
<value n="oracle.mds.internal.dt.ide.migrator.MDSConfigMigratorHelper" v="11.1.1.0.5313"/>

Now you can compile all ADF projects and deploy them to the WebLogic server. Don’t forget to see for each ADF project if the deploy ends successfully.

Happy learning…. J

Saturday, December 14, 2013

JDeveloper Installation

This is an explanatory installation of JDeveloper, For developing J2EE, ADF, SOA, and other middleware projects are which developed JDeveloper IDE.

This article will provide quick and easy installation screens for Jdev.

This installation step starts with downloading the software. Download JDeveloper IDE from OTN.


  • Once JDeveloper is available open command prompt and extracts JDeveloper. Jar as shown below.



  • When it’s completed 100% that will open a wizard to install Jdev. On welcome wizard, click Next.



  • Create a middleware home to install JDeveloper and click Next.

  • Choose Install Type and click Next, usually, we need to install JDeveloper and ADF with Weblogic Server.

  • So this will provide the integrated Weblogic server to test the application (formally Java and ADF application)
  • Next step, select the JDK path, from browse and select from a system where JDK installed
  • Once JDK has selected, click Next

  • To confirm the developer installation, click on Next.

  • Click Next once observation on a summary of JDeveloper installation.

  •  Installations started and wait until it’s completed for 100% completion.

  • Once the installation is completed, below screen will show Uncheck Run Quickstart and Click Done. As soon as do the installation, the wizard will close and from the command prompt will exit from Jdev installation, close the command prompt.






Now you can open JDeveloper from the start(windows) menu and start work.

That’s it; hope this small article might be useful for beginners.

Happy Learning 😊…!