Search

Showing posts with label J2EE. Show all posts
Showing posts with label J2EE. Show all posts

Java EE6: Another major release from 2009

View Comments

There was a lot of eager and nervous anticipation from the Java developer committee about the release of Java Enterprise Edition 6. The focus of the nervousness has been Oracle's acquisition of Sun in April and how it would impact the future of Java. Java EE6 was finally released on December 10th but questions on the impact of Oracle buyout remain unanswered.



The key points made on this release are:

* Glassfish V3 is the reference implementation for EE6
* Java EE6 builds on the persistence and annotation features of EE5.
* This release is about right sizing:
Profiles:
In this release Sun introduces the concept of profiles. Instead of providing a single programming framework that may be used to build different architectures for different industry segments, this release will contain industry specific profiles.

Profiles may be licensed or created based on need. They will incorporate multiple technologies and will cater to different needs. The current release of EE6 contains a full profile and a web profile.

The web profile according to sun will be used to build 'modern apps' and will include security, transaction management and persistence tools. It includes a generic or 'plain vanilla api'.

The new technologies will include the following:
* Java Servlet 3.0
* EJB(Enterprise Java Beans) light 3.1
* Java Persistence Architecture 2.0
* JSP(Java Server Pages) 2.2
* Java Standard Template Library 1.2
* Java Transaction API 1.1
* Debugging for other languages(JSR 4.5)

* There is a lot of pruning of functionality in an effort to keep it light weight.
- The JSR-RPC modules had a lot of UDDI(Universal Data Discovery Functionality) functionality to discover web services. This has been pruned as it is clear now that industry is not heading that way.
In EJB 3.1, Container managed persistence beans are now replaced with the Java persistence API
This was done, according to Sun to keep the API simple and also have Java developers use a single standard API.

* Another goal of this release is to embrace open source frameworks.

* Another new feature introduced in Java EE6 is Webbeans to unify JSF, JPA and EJB 3.0 into a single unified platform.

* Zero configuration drag and drop web frameworks,

* Plugin library jars using web fragment: Here one may setup a framework and bootstrap it into a container. It is a mechanism to integrate 3rd party frameworks into a container. It is used in Glassfish v3.
e
* More use of extensions:
* EE6 will increase the use of extensions from EE5. It will eliminate the use of the deployment descriptor. Further the deployment descriptor has been eliminated and the @WebServices annotation is used instead.

* Another feature is the ability to package the ejb inside the war file. The old jar file is still supported.

Related Links
Java EE6 technologies
Rod Johnson: "Java EE 6 Gets it Right"
JSR 313
Apache votes no on Java EE 6
JEE 6: Extensibility, Profiles and Pruning


Read more...

I passed the J2EE WebServices Developer Cerification Exam.

View Comments

This has been one of the toughest Java exams that I've passed. With the growing popularity of Service Oriented Architectures, I felt this was a quick way to jump on the bandwagon. Here are my 'words of wisdom'.

This study guide was very useful. But you need a good grounding in Web Services before you you this guide. You'll get that from the book below.

Study the Basic Profile 1.0 well. Quite a few questions came from here.

The Java Ranch forum on this exam also proved quite useful

I also studied extensively from Richard Monson-Haefel's book, J2EE Web Services shown below.This book is a must have for anyone planning to develop web Services in Java






A few more tips,
1. Richard who designed parts of the exam says that UDDI is boring. Take the clue and just know the basics and definitions. Do not get lost with the details.

2. This book does not cover the details of Web Service security like SAML, ACL, etc. The guide mentioned above does that.

3. Know the uses of SAX, DOM, JAXB, TraX.


Read more...

Jakarta Struts II: Configuring Struts Applications

View Comments

  • Configure a struts servlet just like a normal servlet in the web.xml file
  • Configure Tag libraries in the web.xml
    • taglib
      • taglib-uri
      • taglib-location
  • Configure the Struts Configuration File
    • struts-config
      • data-sources
        • autoCommit
        • description
        • driverClass
        • maxcount
        • minCount
        • user
        • password
        • url
      • form-beans
        • Elements
          • icon
          • display-name
          • description
          • set-property
          • form-property*
              • className
              • initial
              • name
              • type
        • Attributes
          • className
          • dynamic true/false
          • name
          • type
      • global-exceptions
        • className -decendant of org.apache.struts.config.ExceptionConfig
        • handler-decendant of org.apache.struts.action.ExceptionHandler
        • key
        • path
        • scope-request/session
        • type
        • bundle
      • global-forwards
        • className
        • contextRelative
        • name
        • path
        • redirect
      • action-mappings
        • action
          • attribute
          • className
          • forward
          • include
          • name
          • path
          • parameter
          • prefix
          • roles
          • scope
          • suffix
          • type
          • unknown true/false
          • validate
      • controller
        • bufferSize
        • className
        • contentType
        • debug
        • forwardPattern
        • input forward
        • locale
        • maxFileSize
        • mulitipartClass
        • nocache
        • pagePattern
        • processorClass
        • tempDir
      • message-resources
        • className -decendant of org.apche.struts.config.MessageResourceConfig
        • factory
        • key
        • null
        • parameter
      • plug-in*
        • setProperty*
Using Multiple Application Modules
  • init-param of Servelt must be modified
    • param-name
    • param-value - File path


Read more...

Weblogic Notes III

View Comments

Portlet

  • Associates files, XML and JPSs
  • Editable in design view/Source editor

  • Create/Open a Portal file in IDE
    • Answer yes when prompted if you want to create portlet
    • Wizard opens up
    • Title, Content URI, Error page
  • Alternatively right click on Portal web project,
    • New->Portlet
    • Select Portlet Type: Jsp, Struts, Java, remote,Page flow
  • Can use portlets from Portlet Library
    • Annual reports
    • Business publications
    • Company News
    • Company Performance
    • Discussion Forums
    • Login Director
    • Login To Portal
    • Market Summary
    • My Calendar
    • My Contacts
    • My Contents
    • RSS News feed
    • Targeted menu
    • Tutorial
    • Yahoo Mail
    • Yahoo Search
    • Steps
      • Copy .portlet file into /project/portlets/includes
      • Copy >=1 JSP files to /project/portlets/
      • //portlets folder.
      • In some cases, copying a *.java backing file to your //
        WEB-INF/src//... folder.
      • In some cases, copying a JAR used by the portlet to your //WEB-INF/lib folder.
Customizing a Portlet
  • Modes
    • Edit-Custom File to let users modify content
    • Help
    • Float-Portlet displayed in a Popup
  • States
    • Maximize
    • Minimise
    • Delete
    • Modified in properties editor
  • Icons are stored in /images directory
  • Modify in Property Editor
    • Insert-> EditMode or Insert->HelpMode
  • Floatable
    • .portlet file



Read more...

Weblogic Notes II

View Comments

    <>What is a Portal
  • Single point of access for apps and info
  • May be one of many hosted on a Single weblogic Server
  • End User sees portal as a website with pages organized by tabs/other Nav mechanism
  • Each page has a nesting of pages and one or more portlets
  • J2EE perspective - Portal is a collection of EJBs and Webapps(Servlets, JSps taglibs, Java Classes


Portal Components
  • Desktop
  • Shell-.shell file, above and below main body
  • Book
  • Page
  • Layout/Placeholder
  • Portlet
  • Portal Rendering andLook and Feel Components
  • Skins-Colors, graphics, style

  • Skeletons


Portal Development Tools and Services
  • Designers and Samples
  • Java Controls
  • JSP Tags
  • Content Management
  • Personalization, Interaction and Behavior Tracking
  • Apis


Read more...

Weblogic Notes I

View Comments

  • Portal
    • Powerful website
    • Single Point of access- Applications, Info in a unified interface
    • Each app has ints own window-Portlet,
    • Single browser window can contain many portlets
  • WebLogic Portals
    • Powerful portals can be quickly created independant of Application
    • Weblogic workshop
    • Weblogic portal framework
    • tools
  • Anatomy of a Portal
    • Resource collection assembled in different views- Desktops
    • Desktop- user view of a portal
    • Portal can have several desktops
  • Properties of a Portal Desktop
    1. Desktop look and feel
      • Skins : graphics, style and javascrip
      • <>Skeletons: Physical boundary rendering of all component
2. Header and Footer(Shell): XML file that points to JSPs /HTML files
3. Top Level Book, menus, themes: -Initial navigation style
4. Pages and Books and Menu Themes-naviagble containers for organizing portlets 5. Layout and Placeholders: Book and portlet positioning on pages- XML file
6. Portlets and Themes- Containers that surface contents and applications in a desktop
7. Property Editor Window
  • Multiple portals and desktops in a Single application
  • Security-Delegated administration and Entitlements
    • Dynamic configurable polices-delegated administration
    • Customizable content
  • Weblogic Portal tools and Services
    • Multichannel support-fast flexible development for mobile devices
    • Content Management
    • Interaction Management-Track User behavior
    • Search-buily in Search- File Systems, HTTP and ODBC searches
    • Collaboration-My Mail, My tasklist, My Calendar, My Contacts Discussion forums
    • My Yahoo! enterprize edition Portlets: Headline news, Company news, Stock Portfolio, Market Sumary, Weather, Sports, Maps, Travel Notepad, PAckage tracker,etc.
    • Prebuilt Java Controls -Add Java code for authentication,user creation,property set management
    • Weblogic Portal Visitor tools-Customizable portal desktops
    • Commerce
    • APIs
    • Open Standards Support
  • Portal Development Lifecycle:
    • Development
    • Administration
      • Entitlements
References:
http://e-docs.bea.com/wlp/docs81/overview/overview_wlp.html#998960
http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html


Read more...

Notes from a Study of Jakarta Struts

View Comments

Struts

  • Uses the Servlet MVC framework
  • Tailored for web appilcations
Top Level Struts Packages

  • action: eg: Actionform, action messages- Controller classes
  • actions: -Out of box Action classes eg: Dispatcher action
  • config-configuration file
  • taglib
  • Tiles
  • upload- uploading/downloading from a browser
  • util-General purpose utility classes
  • validator: Struts specific extension classes when deploying the validator
Controller Components
  • Receive a client request,invoke a business operation, coordinate view to return to client
  • Many struts controller components
  • example: org.apache. struts. action. ActionServlet


    ActionServlet
    • extends javax.servlet.http:HttpServlet
    • not abstract
    • Configured in deployment descriptor
    • All controller requests processed by helper classes- decendants of Action class
  • Request Processor
    • org.apache. struts. action. RequestProcessor
    • Version 1.1 onwards
    • Together with ActionServlet called Controller
  • Struts Action Classes
    • org.apache. struts. action. Action
    • Not abstract
    • Extension of Controller component
    • bridge or decoupler-client-user action, business operation
    • Allows more than One to one action between user action and business action
    • execute() menthod-
      public ActionForward execute(ActionMapping mapping, ActionForm form,HttpRequest req, HttpResponse res) throws Exception
      • Called by controller upon client request
      • One instance of each action class in an application
      • Developer must ensure thread safety of action class
      • Developer must overide method execute()
      • Each action class extends Action and overrides method execute().
      • No try/catch or InvalidLoginException
      • Struts uses declarative exception handling
      • Exceptions for actions are specfied in Struts configuration file
      • Action instances are invoked by the Struts framework from mappings specified in Action Mapping files that use URIs with a path attribute.
      • Returned View from an Action is specified by ActionForward return object.
        • Specifies destination after an Action has completed.
        • Declaritively specify action mapping with JSP and ActionForward in Application
        • Specify if it is a redirect with a flag
Using Data Transfer Objects (DTOs)
  • Course-grained view of remote fine-grained data.
  • Only data, no business logic
  • reduces network bandwidth and improves response times
  • Decouples business logic from presentation
  • maintenance and making enhancements is easier.
  • Collocation- Objects deployed in the same JVM
Struts View Componets
  • HTML, DTOs, ActionForms, JSPs, Custom Tags, Java Resource Bundles
Framework use of Action Forms for a Request
  • Check mapping to see if ActionForm is configured
  • If present, use action name to look up bean configuration
  • Check if action form created
  • Reuse if action form is created
  • Otherwise create new instance, store in appropriate scope as specified in action element.
  • Call reset()
  • Iterate request parameters , populate every param with Action form with action parameter
  • If validate is 'true' invoke validate.
  • Two important methods of Action form: reset() and validate()
  • reset() called by controller before populating ActionForm with request values.
  • Action form can reset its values back to default state.
  • Probably not to be used with multiple pages as values are not reset until an instance is destroyed.
  • Validate called after request values are inserted into ActionForm.
  • Must not be used for business operations- These are done in business objects only.
  • Validation is used for Presentation Validation only.
  • All ActionForms of application configued in form-beans section on Config File.
    • Configure Action forms
    • use form-bean names with one or more action elements.
    • DynaActionForm
      • New in Struts 1.1
      • org.apache.struts.action.DynaAction
  • JSP disadvantages
    • Developers may embed business logic in JSP
    • Learning curve
    • Container must recompile JSP when a change is made to a page.
  • Using Tag Libraries
      • Need to be registered in web.xml
      • Include taglib elements in JSP
      • <%@ taglib uri ="/...." prefix="bean">
      • No Java code, only HTML
  • Resource Bundles
    • Set on java.util.ResourceBundle
    • org.apache.struts.utils.MessageResources
  • Multiple App Support
    • Pre 1.1 versions- Only one struts-config.xml
    • 1.1 Many config files possible- developers may work in parallel.
    • Now called Application Modules


Read more...

Notes from a Java 5.0 Presentation

View Comments

Java 1.4.1

  • the focus was on quality
  • more than 2000 bug fixes
  • Garbage Collection(GC) Mark sweep and parallel going space
Java 1.4.2

Java 5.0
  • Community Development
  • 15 JSRs
  • Bug fixes
  • Performance
  • JMX, Decimal Arithmetic, Generic types...
Tiger(Java 5.0) Themes
  • Quality
  • Performance
  • Monitoring
  • Desktop Client
  • Easy development
Quality
  • Tighter control
  • Bug fixes
  • Compatibility
  • Reliability
  • Scalability
  • Big Heap support- Concurrent and Parallel GC
  • Hotspot virtual support
  • Chipset optimizations
  • AMD4 native compilers
  • Hyper Threading
  • Faster startup: Especially desktop apps-AWT, Swing
Class Data Sharing
  • Generated at install time'
  • Originally developed on Apple
  • Minimum memory footprint
  • Reduced startup time
Performance
  • Less reliance on command line tools
  • More support for Adaptive fine tuning
  • Tools: Jstat,Jvmstat
  • (In 1.4.2)2 different compilers: Client and Server
  • (in 1.4.2)Hot Spot client-default
  • In 5.0 Good out of box performace without fine tuning.
Server
  • Parallel GC
  • Server Hot Spot VM
  • Max heap 1/4, Max Memory 1.6
  • Initial heap 1/64 Max mem or max heap
Client
  • Minimum heap,
  • Serial GC,
  • Client Compiler
  • Visual GC - Graphical view of VM
Monitoring Manageability JSR 1.4
  • Low memory detection
  • Allow access of internal VM status
  • Heap size, GC info, Threads, etc
  • SNMP, JMX based
  • Plugs into JMX console
  • JMX Api JSR003
  • MBean Server part of JMX
  • Easy to configure
Profiling JSR 163
  • Improved performance analysis
  • JVMTI replaces JVMPi
  • Bytecode instrumentation
  • HProf updated to JVMPi

Improved Diagnostic Ability
  • Static trace Api
  • Fatal error handler
  • Start JVM with OnError Options
  • Java debug interface SA Connector
  • Attach connector to code file
Desktop
  • Java Webstart- Unified Console plugin and console
  • Continued quality and performance
  • Gnome skins
  • Synth Skinnable API
  • Ocean
Easy Development
  • Concurrent Library (JSR 166)- Dough LEA
  • XML, Webservices support
  • Language Changes.
  • Locking API, Higher level abstractions
    • Atomic variables
    • Thread executors and pools

JSR 206 JAXP 1.3
Java Web Services Standards
  • XML 1.1 and namespace
  • XML Schema
  • DOM, SAX
  • JAXRPC
  • SAAJ
  • JAXB
  • XML Security
    • Encryption and Digital Signatures
  • JAXR

Language Changes
  • Generics
  • Loop- For Each
  • Autoboxing/unboxing
  • Typesafe enums-Complie time
  • Varargs
  • Static imports
  • METADATA
  • easy to code
  • Simpler to Visualize, Readable
  • Minimize compatibility Issues
Generics
  • Abstract over types
  • Casting is a pain
  • Casting is unsafe
  • Casting may fail at runtime
  • Nice to Tell compiler type of Casting
  • Signature changes
  • List{
void add(E,x)
List mylist;
Copy (List dest, List src)
}
Generics vs Template
  • Generics- type checked
  • Generics-coded once and for all
  • Generics-no code bloating
  • Generic code not exposed to user
  • No hideous complexity
  • Common cut and paste error
Enhanced For loop
  • Painful iteration over collector
  • Iterators are error prone.
  • for (Object o:c)
    {
    ((TimerTask)o)Cancel();
    }
  • Cleaner, safer shorter
  • no iterator related clutter
  • Eliminates array index
  • nested iterators are tricky

  • Autoboxing/Unboxing
  • Cannot put an Integer in a collection
  • Must use Integer
  • Pain to convert back and forth
  • It would be nice if the compiler did it.
  • Map m =new TreeMap();

    Typesafe Enum Pattern
    Consider:
    int enum pattern
    public static final int SEASON_WINTER=1


  • Not type safe
  • No namespace, must prefix constants
  • Typesafe Enum pattern- Compiler supported


  • enum color("blue", "green", "red");
  • Use in switch

  • enum Suit ("club", "Spade", "Diamond", "Heart");
    enum rank("ace","two"..):
    for (Suit suit:Suit.Values)
    for(Rank rank: Rank.Values)

    VArgs
  • Methods with VArgs:Var
  • Must use array
  • Methods like printf

  • public static String format(pattern, Objects ...arguments);


    Static Imports
  • Classes import constants
  • Interface abuse
  • Analogous to package imports
  • Imports static members from a List
  • import static org.iso.Physics.*

  • Works with Enums

  • import static ...enum.*


    Metadata
  • Annotate code
  • Maintain side files
  • Function in EJBs occurs 5 times

  • import javax.xml.rpc.*
    public class CoffeeOrder{

    @remote public coffee[] getPriceList(){
    }
    }
  • Compatible

  • JAXRPC
  • EJB 3.0

  • Tiger rectifies collisions
  • New language to rectify collisions
  • Websites

  • java.sun.com/j2se/5.0
  • jcp.org/en/jsp/detail?id176
  • java.sun.com/features/2003/05/bloc-qu.html

  • Read more...