Hobione's Weblog

Living & Breathing in Web 2.0 Era

JavaOne 2009: Day two

I was lazy this morning so I skipped the General Session.  They had a big announcement on Java 7 and JEE 6.  Oh well, I was tired.   So anyway, here are some of my favorite sessions of the day.

1. Maven:  Took this session with John F Smart, a New Zealand java geek.  It was very helpful session.  He talked about <exclusion> tag in maven and showed pom.xml in gui view.  He mentioned about project inheritance  in Maven.  Super pom file –> Child pom file.  So what kind of stuff can you put in super pom file?  Answer was, stuff you share across and easy to maintain.  He mentioned about centralize reporting and also talked about Inheritance: Bottom up and Aggregation: Up down.

Word of advice:  If you want to make it standard, you want to make it available everywhere.

2. Resfull Webservices:  Took this session with Marc Hadley and Paul Sandoz.  They have touched in various area using JAX-RS includes:

  • Mapping URLs to java class files and methods
  • Handling HTTP request for common HTTP methods
  • Obtaining parameters from the HTP request
  • Using MIME media types and mapping representations to MIME media types and Java Programming language types

Marc mentioned to be careful with regular expression.  He showed a sweet command for Firefox browser: about:config.
Future: Restful 2.0 is underway.  Mime multipart, templating and more integration with JSF 2.0.  Here is the slide show.

3. HtmlUnit: Testing Web app: Daniel Gredler and Ahmed Ashour explained how a top-to-bottom integration testing works and ensuring Web application quality.   HtmlUnit is a 7 years old product, 100% java, open source.  It runs inside the JVM.  It does integration testing, screen scrapting.  They also explained,

  • The two approaches to Web app integration testing: browser simulation and browser driving.
  • The cons of the browser simulation approach.
  • The pros of the browser simulation approach.
  • Key extension points provided by HtmUnit.

Daniel also mentioned about JSF Unit as well.


4. Coding Soap and Rest together (TS-4883): Martin Grebac and Jakub Podlesak explained when you need soap and when you need rest.

Why SOAP:

  • Contract already known
  • Security
  • QoS: No functionl requirement

Why Rest:

  • Simplicity
  • Scalability
  • Serendipity

They also mentioned about not to fall into RPC over HTTP and annotation.  He indicated Rest-RPC hybrid and gave a demo with JavaFX with webservices (soap).
Link: metro.dev.java.net

Java EE 6, Glashfish V3 and Hudson demo:  I have attended to a GlassFish 2009 unconference party at the Hotel St. Regis where they have a demo setup for all upcoming products.  I talked and networked with several Sun employees and product managers about their products.  It was very nice to meet them in person and discuss  as well.  I have brought up our Glassfish support issue with Glassfish product manager, Abijit and Nazrul.  Kohsuke Kawaguchi gave me a brief introduction on Hudson continuous integration and how to set up a test automation environment.  It was very informative.  BTW, Hudson has a plugin for CA Harvest as well.

Good News:  A hot development can be done with JavaEE with Glassfish V3 and light Ejb3 also available as well. *

Glassfish Unconference EE 6 Java = Everywhere

5. BOF: JavaServer Faces Platform and Ajax: State of Union:  This was my first Bird of Feather in this year.

  1. Ted Goddard (ICEfaces Framework)
  2. Andy Schwartz (Oracle ADF Faces / Trinidad)
  3. Alexandr Smirnov (RichFaces [Ajax4JSF])

Ted Godder-ICEFaces

Each of these individuals is a JavaServer Faces 2.0 Expert Group member who has contributed to the specification.  It was a demo and Q&A session.

6. BOF: Writing a JavaServer Faces 2.0 Compoenent:  Jim Driscoll and Ryan Lubke showed how easy to write fully reusable JSF composite component using Facelets, XHTML tags.

7.  BOF: SOA: Aaron Mulder* from Chariotsolutions explained many of the key open-source options: Java Architecture for XML binding (JAXB), SOAP and REST (CXF, Axis), ESBs (OpenESB, Mule, ServiceMix, JBossESB), messaging (ActiveMZ), goverance (Galaxy), BPEL (ActiveBPEL, ODE) and more.  Arron gave a big-picutre view of how you can start building an SOA with low-cost tools.  Click here for the slide.  I have discussed Arron with our current iDMS architecture and he suggested that adding web services in our service layer make things slow down unless we have a reason to have web services in place.  He also mentioned about Spring Web Services as well since we are already using Spring for our Service layer in iDMS.

Advertisements

June 2, 2009 Posted by | Java core | Leave a comment

Java regular expression, replace slashes

In my ui I had this line:

<f:param name="fullPath" value="#{model.folderObject.folder.fullPath}"/>

So, fullPath contains “\Electronic Project Folders\AJW-148\AMASS-2005-000181-A\CIF Replacement 234-2005X546A\CCA, AMASS CIM”
I needed to replace singe slash with double slashes

FacesContext context = FacesContext.getCurrentInstance();
Map<String, String> params = context.getExternalContext().getRequestParameterMap();
String fullPath = URLDecoder.decode(params.get("fullPath"));
String fullPath2 = fullPath.replaceAll("\\\\", "\\\\" );

Thanks to Jason Lee.

June 9, 2008 Posted by | Java core | Leave a comment