Friday, April 25, 2008

Get TWO Chances at Getting Sun Certified For the Price of One

This post is out of date.

Please visit http://javacertification.info/ for details regarding other Java/Sun Certification promotions.


Taken directly from Sun's email:
500,000 Have Done it and You Can Too!

Dear READER:

More than 500,000 IT Professionals are now Sun Certified. Are You Next?

With the purchase of any certification exam voucher through June 30, 2008, you will receive a second chance certification voucher to retake the exam, if you need it.

Here's how to take advantage of this offer:

1. Select the package or certification exam that you are interested in.
2. Use Priority Code WW48CX1 when you place your order.
3. Schedule Your Exam.
4. And if you don't pass the first time, schedule your retake exam for FREE.

Hurry! Offer Ends June 30, 2008.

More details along with recommended books can be found here.

Wednesday, April 23, 2008

Adobe AIR for JavaScript Developers Pocket Guide

This book has been released under Creative Commons License and is available for download...

Yes, for FREE!

0596518374 Adobe AIR for JavaScript Developers Pocket Guide

You can checkout Mike Chamber's blog for more details.

MyFaces 1.2 Error: No Factories configured for this Application

If you've received the "No Factories configured for this Application" error with MyFaces 1.2, then you're not alone.

Detailed message goes like this:
java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!

If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.

The weirdest thing is that I have the context listener declared in my web.xml!

[sourcecode language="xml"]

org.apache.myfaces.webapp.StartupServletContextListener


[/sourcecode]

From what I've gathered, changing the web.xml entry

from

[sourcecode language="xml"]


Faces Servlet
javax.faces.webapp.FacesServlet
1


[/sourcecode]

to

[sourcecode language="xml"]


Faces Servlet
org.apache.myfaces.webapp.MyFacesServlet
1


[/sourcecode]

should do the trick.

But then again, moving to 1.2.2 of MyFaces also makes the problem go away. (at least that was the case when I upgraded to 1.2.2).

So my suggestion is to just upgrade the version of your MyFaces jars instead of going with the rather "hacky" solution.

May 1 - Labor Day

To those of you who are wondering whether next Monday will be declared a non-working day because of the Holiday Economics Act and the upcoming Labor Day, the answer can be found here.

Labor Day will STILL be celebrated on May 1 (Thursday) and will not be moved to the nearest Monday.

They should probably update the ra9492.pdf file because it does not match the other announcement they have in their website.

Has .NET Leapfrogged Java?

Got this message from my Inbox this morning:

Our authors often have great insights. So when one recently told us that .NET technology--in particular C# combined with LINQ--has "leapfrogged Java," we took note. His evidence?




  • The new .NET library, LINQ*, provides a direct link between C# code and any data source, without the need for a persistence layer like Hibernate.


  • C# introduced generics, custom attributes, delegates, standardized foreach iterators, property syntax, and extensible value types before Java.


  • The .NET platform now includes Python, Ruby, and new languages like F#, and frameworks like WPF, WCF, and ASP.NET have become industrial-strength.



On the flipside, another of our authors tells us, a language lives in a developer community and Java's is more vibrant. Java-to-.NET ports like NAnt, NHibernate and NUnit abound, but there's been little movement in the other direction. And .NET still implies Windows.

Have the tables really turned? Join the discussion at www.manning.com/leapfrog

I'll leave it up to you guys to decide.

Tuesday, April 22, 2008

Swim For A Cause

Good day friends!

I'm trying to look for sponsors for an upcoming event this Saturday to help raise funds for our Church auditorium.

You can "pledge" at least 200 pesos for every lap (50 meters) that I will complete.

So for example, Person A pledges 2 laps @ 200 pesos each and Person B pledges 1 lap @ 500.

In order to receive all the pledges above, I need to complete all 3 laps. If I get to complete only 2 laps then I will only get 400 pesos (2 x 200) and the pledge from Person B gets forfeited.

But if I complete all 3 laps, then I should be able to get 900 pesos ((2 x 200 from Person A) + (1 x 500 from Person B)).

You can add a comment below the post to signify your interest. You can also indicate there the amount (per lap) and number of laps you want to pledge. The sequence of the pledges in the comments section will determine the order in which the pledges will be applied/claimed.

Don't worry, I'm not a professional swimmer. I can't even remember the last time I was able to swim in an Olympic-size pool!

Jake's First free


No that's not me in the picture. I just got it by doing a web search. But that should at least give you an idea of what the event would be like.

A million thanks to you guys!

JSF vs Flex Components

When developing JSF applications, I rely heavily on these two sites as reference for the Tag syntax.

With Flex, there's a similar tool where you can see Flex 3 components in action.

Try visiting and comparing the mentioned sites and you'll probably have an idea why I'm really excited about developing applications in Flex.

Friday, April 18, 2008

Flex, BlazeDS and JPA

After several days of playing with Flex, I've managed to create a simple Java-based backend using BlazeDS and the Java Persistence API (JPA).

In this post, we will try to implement what used to be a very popular application (during the early days of the Internet), the "Guest Book".

What you'll need:

The assumption here is that you are already comfortable with Java and databases, and you just want to know how to make your Flex application communicate to your Java backend.

We now proceed to creating our form Using Flex Builder.

guestbook.mxml

[sourcecode language="xml"]

layout="absolute" xmlns:local="*">












[/sourcecode]

Switching to "Design" view should show us the form that we just created.



Look how nice and easy it was to create the form.

But wait, this application doesn't do anything yet, so let's move on to adding some logic.

Let's try to modify the submit button to call our remote object:

[sourcecode language="xml"]
click="guestBookService.add(guestBookEntry)"/>
[/sourcecode]

Adding this line alone will cause a compile error because we haven't told Flex what the guestBookService and guestBookEntry objects are all about.

First we need to create an ActionScript class named GuestBookEntry.as which will correspond to our remote JPA entity named GuestBookEntry.java (located under the guestbook package).

[sourcecode language="javascript"]
package
{
[Bindable]
[RemoteClass(alias="guestbook.GuestBookEntry")]
public class GuestBookEntry
{
public function GuestBookEntry()
{
}

private var _guestName:String;
private var _guestMessage:String;

public function get guestName():String {
return _guestName;
}

public function set guestName(guestName:String):void {
_guestName=guestName;
}

public function get guestMessage():String {
return _guestMessage;
}

public function set guestMessage(guestMessage:String):void {
_guestMessage=guestMessage;
}
}
}
[/sourcecode]

Notice how the constructor, setters and getters are different from how you would normally do it in Java.

We now update guestbook.mxml to include a reference to our guestBookEntry object (also called a custom component). This should be added as a child of the Application element.

[sourcecode language="xml"]
guestName="{guestname.text}"
guestMessage="{guestmessage.text}" />
[/sourcecode]

The curly braces mean that any changes to the text values of the form elements in guestbook.mxml would be directly applied to the guestBookEntry instance.

That should leave us with one more compile error to deal with, which is that of the missing reference to guestBookService.

Just add the fragment below as a child to Application and we're all done! At least with the Flex part.

[sourcecode language="xml"]
destination="guestBookService"
source="guestbook.GuestBookService"
channelSet="{cset}"/>


uri="http://localhost:8400/guestbook/messagebroker/amf"/>


[/sourcecode]

I'm sorry if I cannot explain the ChannelSet details as of now, because I'm as clueless as you are. We just need to make sure that they match the values in our BlazeDs backend and we're good to go.

From your turnkey download, locate a file named blazeds.war, if you've done some Struts programming before, this is the same as the struts-blank.war which can serve as a template for new projects.

Import this war as a project in Eclipse WTP, and name this project guestbook (remember that our backend needs to match the entries we added for the RemoteObject and ChannelSet).

When you're done setting up the project in Eclipse, navigate to "WEB-INF\flex\". At this point we are only interested in "remoting-config.xml" where we should be defining a reference to our remote object.

Add these lines in between the adapters and default-channels:

[sourcecode language="xml"]


guestbook.GuestBookService


[/sourcecode]

To setup JPA, we need to create a folder named META-INF under src and create a file named persistence.xml. Also, make sure to add TopLink JPA jars and your JDBC driver to WEB-INF\lib.

[sourcecode language="xml"]

xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">


oracle.toplink.essentials.PersistenceProvider

guestbook.GuestBookEntry









[/sourcecode]

We now create the Java objects GuestBookService and GuestBookEntry:

[sourcecode language="java"]
@Entity
public class GuestBookEntry {

@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private long id;

private String guestName;
private String guestMessage;

public GuestBookEntry() {}

// getters and setters
}
[/sourcecode]

[sourcecode language="java"]
public class GuestBookService {

private EntityManagerFactory emf = null;

public EntityManagerFactory getEMF() {
if (emf == null) {
emf = Persistence.createEntityManagerFactory("guestbook");
}
return emf;
}

public void add(GuestBookEntry guestBookEntry) {
EntityManager em = getEMF().createEntityManager();
try {
em.getTransaction().begin();
em.persist(guestBookEntry);
em.getTransaction().commit();
} catch (Exception e) {
em.getTransaction().rollback();
e.printStackTrace();
} finally {
em.close();
}
}

}
[/sourcecode]

The guestbook.war can be downloaded from this location. The file uses an odt extension because of hosting limitations. Please rename to .war accordingly.

Also, JAR files from BlazeDS, TopLink and MySQL driver were not included in the distribution.

Let me know if you encounter any problems while running the application.

Recommended books:

1933988746 1933988347

Win a Free Ebook

We (Manning) will hold a random drawing every day from April 17 to April 30. Two winners will be chosen each day. Winners can choose from any ebook available on Manning.com. We will contact you by email if you are one of the lucky winners. No purchase is necessary and you only need to enter once (duplicate entries will be deleted). If your name isn't pulled as a winner one day, it is still eligible to be drawn on subsequent days. A random number generator will be used to choose each day's winners. After April 30 we will send all participants the list of the winners and their ebook choices.

Visit http://www.manning.com/free/ for more details.

Thursday, April 17, 2008

Flex Memory Usage

I was trying to modify a stock ticker example to work with Flex 3 when I came upon a surprising conclusion.

"With great power comes great responsibility."

B0002XK190 Spider-Man / Spider-Man 2

Yes, I'm 100% convinced that Flex is the way to go if you want rich interactive user interfaces.

But that does not come without a cost. I think I accidentally turned the method invocation rate too high using the setInterval() function.

The result, a whopping 1GB memory consumption for firefox. It brought most of my running applications to a crawl.


Is there a way to prevent such conditions? Like running Flex in a sandbox model?

PHP 101: A Simple Seat Reservation System

I would like to share a little application I developed last year for a simple concert that our church sponsored.

The requirement was to develop a seat/ticket reservation system which will be accessed from two different locations.

The application will be used by administrators only to check the available seats and will not be accessible to end users.

UPDATE: 8/1/2008
In response to visitor requests, a live demo of the script is now available at http://music.slingandstoneweb.com/seats/seats.php.



Download link (make sure to rename the downloaded file to .zip instead of .odt)

Database Design:
[sourcecode language="sql"]

CREATE TABLE seats (
rowId varchar(1) not null,
columnId int not null,
status int,
updatedby varchar(10),
PRIMARY KEY (rowId,columnId)
);

CREATE TABLE userauth (
rowID TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
commonname VARCHAR(35) NOT NULL,
username VARCHAR(8) NOT NULL,
pswd VARCHAR(32) NOT NULL,
PRIMARY KEY(rowID)
);

[/sourcecode]

I tried to make the tables as simple as possible.

For the seats table, I used the rowId and columnId columns as the PK. The status column represent the state of a particular seat (0-available, 1-reserved, 2-confirmed). The updatedby column is for storing the name of the user who last updated the record (importance of this column will be discussed later).

I also needed some form of authentication which is contained in the userauth table. I think the columns for this table are self-explanatory, so there's really no need to go into more detail about that.

I created a login.php page for authentication. I had to embed this page to all the other pages which I wanted to protect from unauthorized access.
[sourcecode language="php"]

function authenticate_user() {
header('WWW-Authenticate: Basic realm="Tickets"');
header("HTTP/1.0 401 Unauthorized");
exit;
}

[/sourcecode]

If you try to access a page which invokes the fragment above then you will be presented with a screen similar to what is shown below:



A word of caution from the Beginning PHP and MySQL 5 book:
Note that unless output buffering is enabled, these commands must be executed before
any output is returned. Neglecting this rule will result in a server error, because of the violation
of the HTTP specification.

You can retrieve the values entered into this form through the following scripts:
[sourcecode language="php"]

$_SERVER[PHP_AUTH_USER] // for retrieving username
$_SERVER[PHP_AUTH_PW] // for retrieving password

[/sourcecode]

The values retrieved from the form are then compared to the entries in the userauth table. And if no match is found, the login form is re-displayed to the user.
[sourcecode language="php"]

// Connect to the MySQL database
mysql_pconnect("localhost", "tickets", "tickets")
or die("Can't connect to database server!");
mysql_select_db("tickets") or die("Can't select database!");

// Check for matching users
$query = "SELECT username, pswd FROM userauth"
. " WHERE username='$_SERVER[PHP_AUTH_USER]'"
. " AND pswd='$_SERVER[PHP_AUTH_PW]'";
$result = mysql_query($query);

// Re-display login form
if (mysql_num_rows($result) == 0) {
authenticate_user();
}
[/sourcecode]

I do hope all these snippets still make sense to you because we are just about to proceed to the more complicated stuff.

Given the seat layout of the concert hall, I decided to represent the rows using letters and the columns as numbers. The tricky part was how to dynamically generate the seat layout based on the rows retrieved from the seats DB table.


The next fragments were taken from seats.php
[sourcecode language="php"]

// Select all the seats in the venue
// The seat numbers in the concert hall were read from right to left
// (which is why columnId is sorted as desc)
$query = "SELECT * from seats order by rowId, columnId desc";
$result = mysql_query($query);

// Iterate through results, assign values to rowId, columnId,
// status and updatedBy variables
while (list($rowId, $columnId, $status, $updatedby)
= mysql_fetch_row($result))
[/sourcecode]

We now begin with the fun part, for every seat, which is still available, create a checkbox. For every seat which is reserved, also create a checkbox only if the user currently logged in is also the same user who reserved the seat. You may be wondering, why do I need to create a checkbox for a seat that's already reserved? This is because, in this application, the reserved state is not the final state for a seat. A reserved seat can still be canceled or confirmed. But once a reserved seat is confirmed, no further modifications can be made to that seat.
[sourcecode language="php"]
echo "";
echo "$rowId$columnId";

if ($status == 0
|| ($status == 1
&& $updatedby == $_SERVER['PHP_AUTH_USER'])) {
echo " . " value='$rowId$columnId' />";
[/sourcecode]


From PHP, we step back a bit and discuss the JavaScript part of the code which is as important as the PHP scripts.
[sourcecode language="javascript"]
function reserveSeats() {

var selectedList = getSelectedList('Reserve Seats');

if (selectedList) {
if (confirm('Do you want to reserve selected seat/s ' + selectedList + '?')) {
document.forms[0].oldStatusCode.value=0;
document.forms[0].newStatusCode.value=1;
document.forms[0].action='bookseats.php';
document.forms[0].submit();
} else {
clearSelection();
}
}
}

function cancelSeats() {

var selectedList = getSelectedList('Cancel Reservation');

if (selectedList) {
if (confirm('Do you want to cancel reserved seat/s ' + selectedList + '?')) {
document.forms[0].oldStatusCode.value=1;
document.forms[0].newStatusCode.value=0;
document.forms[0].action='bookseats.php';
document.forms[0].submit();
} else {
clearSelection();
}
}
}

function confirmSeats() {

var selectedList = getSelectedList('Confirm Reservation');

if (selectedList) {
if (confirm('Do you want to confirm reserved seat/s ' + selectedList + '?')) {
document.forms[0].oldStatusCode.value=1;
document.forms[0].newStatusCode.value=2;
document.forms[0].action='bookseats.php';
document.forms[0].submit();
} else {
clearSelection();
}
}
}
[/sourcecode]

You will notice that there are three main functions (reserveSeats(), cancelSeats() and confirmSeats()) for modifying a seat's status.

These scripts submit the values of the HTML FORM in seats.php to another PHP page named bookseats.php. This bookseats page is particularly interested in three FORM parameters from the seats page namely, oldStatusCode, newStatusCode and the seats array generated by the checkboxes.

An example of the request would be:

oldStatusCode=0
newStatusCode=1
seats[A1,A2,B3]

Which means Reserve the currently Available A1, A2 and B3 seats.

It is important to note the behavior of checkboxes in HTML. Only the values of "selected" checkboxes get submitted when you make a POST request. You can retrieve request parameters in PHP using $_GET for GET requests and$_POST for POST requests.

The bookseats page is divided into two parts. The first part checks whether the seats are still in the same state (no changes were done to the seats by another user while we were busy doing something else) prior to making any updates.
[sourcecode language="php"]

// dynamically build select statement

$selectQuery = "SELECT rowId, columnId from seats where (";
$count = 0;
foreach($_POST['seats'] AS $seat) {
if ($count > 0) {
$selectQuery .= " || ";
}
$selectQuery .= " ( rowId = '" . substr($seat, 0, 1) . "'";
$selectQuery .= " and columnId = " . substr($seat, 1) . " ) ";
$count++;
}

$selectQuery .= " ) and status = $oldStatusCode";
if ($oldStatusCode == 1) {
$selectQuery .= " and updatedby = '$user'";
}

// execute select statement
$result = mysql_query($selectQuery);

$selectedSeats = mysql_num_rows($result);
if ($selectedSeats != $count) {
$problem = "

There was a problem executing your request. No seat/s were updated.


";
die ($problem);
}
[/sourcecode]

If the system detects any concurrent updates then it stops with step 1, displays an error message to the user and does not proceed with step 2.

The second part performs the actual database update after necessary checks from step 1 have been processed.
[sourcecode language="php"]

// prepare update statement
$newStatusCode = $_POST['newStatusCode'];
$oldStatusCode = $_POST['oldStatusCode'];

$updateQuery = "UPDATE seats set status=$newStatusCode, updatedby='$user' where ( ";
$count = 0;
foreach($_POST['seats'] AS $seat) {
if ($count > 0) {
$updateQuery .= " || ";
}
$updateQuery .= " ( rowId = '" . substr($seat, 0, 1) . "'";
$updateQuery .= " and columnId = " . substr($seat, 1) . " ) ";
$count++;
}
$updateQuery .= " ) and status = $oldStatusCode";
if ($oldStatusCode == 1) {
$updateQuery .= " and updatedby = '$user'";
}

// perform update
$result = mysql_query($updateQuery);
$updatedSeats = mysql_affected_rows();

if ($result && $updatedSeats == $count) {
echo "

"
echo "You have successfully updated $updatedSeats seat/s: ";
echo "[";
foreach($_POST['seats'] AS $seat) {
$rowId = substr($seat, 0, 1);
$columnId = substr($seat, 1);
echo $rowId . $columnId . ", ";
}
echo "]";
echo "...

";
}
[/sourcecode]

This application represents my first attempt into the PHP world and I must say that there are still a lot of improvements that can be added to this quick and dirty solution.

For one, the user can create his own login form instead of relying in the browser's basic login form (shown earlier).

A logout option would be a very worthy addition and can be achieved by simply adding a link which calls the session_destroy() directive.

Styles and scripts can also be moved to external CSS and external JavaScript files.

Anyway, I still hope I was able to provide you enough details about PHP to serve as starting point.

Feel free to download (and rename to .zip) the application and modify to your own liking.

Recommended books:

1590598628 05960097630596101996

Wednesday, April 16, 2008

Books for Sale

I'm having a hard time keeping up with reading my NEW books. So instead of just letting them gather dust in my shelf, I'm thinking of selling some of them (those which I do not need for my current projects).

0321193687 UML Distilled (for 1k Php)

1590595165 SCJD Exam with J2SE 5, Second Edition (for 1.2k Php)

0321349601 Java Concurrency in Practice (for 1.2k Php)

1590594681 Beginning ASP .NET 2.0 E-Commerce in C# 2005 (for 1.2k Php)

1590598733 Accelerated C# 2008 (for 1k Php)

The tag prices attached are based on Amazon's base price (converted to pesos). I already paid for shipping (to Phils.) and customs taxes so in effect you are really getting a HUGE discount.

You can drop me a line here or email me at dayg77 AT gmail DOT com if you're interested.

Thanks.

Update 4/22: Proceeds will go to the same fund raising event as described here.

Sponsor a Child

A few months ago, I was reading the blog of Cay Horstmann (author of Core Java, Core JSF and many others) and came across his The OLPC and Java post.
I got an OLPC for the holiday season. No, it wasn't for the Horstmann twins—after all, it is one laptop per child, so the child must be myself. I got it through the “give one, get one program”. For $400, I got mine and a much more deserving kid somewhere out there got one as well. (Hurry if you want to get yours—the program ends today.)

It was nice to see the BIG guys participate in such a worthy cause. And if they can do it, why can't we?

In line with this, I would like to invite YOU (Yes you! The person reading this post) guys to participate in a similar project from World Vision. But instead of giving away laptops, you help underprivileged children get the education they have been dreaming for.

But what do you get in return? You hopefully get a BIG smile on your face whenever these little kids try to send you back a letter saying even the simplest "THANK YOU".

PS: If you're from the Philippines, you can also visit this alternate link.

Tuesday, April 15, 2008

Hero Hack Pack

Order your own Hero Hack Pack and get started with Open Source and Microsoft technology.

Each Hero Hack Pack contains free evaluation editions of Windows Server 2008 and Visual Studio 2008, plus resources for getting started with Open Source development.

Looking for more? We’ve randomly hidden vouchers for free passes to the 2008 Open Source Convention (OSCON) this summer, held in Portland, OR. Each Pack gives you a chance to win a free pass to one of the world’s largest gatherings of the Open Source community.

Taken from: http://www.microsoft.com/opensource/heroes/default.mspx

Update: 2:30PM, I already received an email confirmation from Microsoft. Excited to get my Hack Pack copy!

Thank you for placing your order for the Hero Hack Pack with Microsoft.


You'll receive your Hero Hack Pack in 4-6 weeks.


Friday, April 11, 2008

Globe 3G - New Mobile Browsing Rates

Great news for Globe subscribers! Globe has announced a new time-based pricing model (5 pesos for every 15 minutes) for mobile browsing.

This looks better than Smart's (10 pesos for every 30 minutes) current offering if you're the type of person who just use this facility to download your emails (and read them offline) which would normally just take you less than 5 minutes.

Check out this page to see how to setup your phone for mobile browsing.

Related post:

SCEA 5 Part I Study Guide Mind Map

As promised, here's the long overdue Mind Map for SCEA 5 Part I. This file builds on top of the OLD SCEA Part I Study Guide Mind Map. This file contain the references I used for SCEA 5 BETA Part I preparation last year which is just an addition to the resources already mentioned in the OLD SCEA mind map.

SCEA 5 Part I Mind Map Screenshot

You will notice that this mind map is not as elaborate as the first one as we only had a few weeks of preparation for the BETA exam. I still hope you find it useful for your own preparations.

Reminder: Please rename the file to a .mm (Freemind) extension after downloading. Do not use Open Office to view this file.

Thursday, April 10, 2008

CSS Naked Day

Did you know that there's such a thing as "CSS Naked Day"? Yes there is!

It's celebrated on the 9th of April each year.
The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good 'ol play on words. It's time to show off your <body>.

You should probably check out this site I visited earlier to see how a NAKED website looks like.

PS: If you want to know more about HTML and CSS (the FUN way) I suggest you GRAB a copy of Head First HTML with CSS and XHTML, it is HIGHLY recommended.

UPDATE 4/11: Their CSS is back on, you will need to wait for April 9 next year to see the site NAKED again.

Java 5 EOL Announcement

How time flies! Just when most people have started using Java 5, you get this announcement from SUN.
Java SE 5.0 is in its Java Technology End of Life (EOL) transition period. The EOL transition period began April 8th, 2007 and will complete October 8th, 2009, when Java SE 5.0 will have reached its End of Service Life (EOSL). Customers interested in learning more about Sun's Java Technology Support and EOL policy »Read More

Customers interested in continuing to receive critical fixes, are encouraged to consider the following options:

  • Migrate to the latest Java SE release »Read More

  • Migrate to Java SE for Business 5.0 »Read More


During this EOL transition period, the products will continue to be supported per existing customer support agreements.

For developer needs, all products that have completed the EOL transition period will be moved to the Archive area.

Taken from: http://java.sun.com/javase/downloads/index_jdk5.jsp

Makes me excited to see Java 6 go mainstream. But I guess the people from Apple has a little catching up to do, because up to until now, Java SE 6 for Mac OS X 10.5 is still in Developer Preview.

Related Post:

Wednesday, April 9, 2008

Flex-ing Your Way to RIA Land

I've had the privilege to work on some proof of concept pages using Flex since last week. Yes, I've heard the buzz around RIA and Flex before but I didn't have the time to play around with the application until now.

I originally thought that it was somehow expensive to develop applications using Flex, but looking at the new pricing models, it seems that the entry barrier to Flex has been lowered down. You can even develop Flex applications for FREE using just the open source SDK and your old IDE but you lose all the design time capabilities the Flex Builder IDE has to offer.

I downloaded the 60 day trial and since the Flex Builder IDE was built on top of Eclipse (which I have been using for Java for a couple of years already), I immediately became very comfortable with the controls.

Coming from a Java background, I wanted to know how developing in Flex was different from what I would normally do in Java, create some JSPs and corresponding JSF Managed Beans for the UI and probably add some pretty cool JavaScript libraries like JQuery or Scriptaculous for some really nice effects.

I did some web search on Flex and found some interesting articles/links which caught my attention:

I wanted to try out writing some Flex applications but our intermittent internet connection last week prevented me from running the online tutorials.

So I just opted with buying the Early Access e-book copy of Flex 3 In Action from Manning.

After reading chapter 1 which can be downloaded freely from the site, I said to myself, "now why didn't I try Flex earlier?" The argument there about the lack of user interactivity from pure HTML pages made a lot of sense.

I'm still in the early part of exploring Flex, but I must say that I'm really enjoying it and excited about all the new possibilities with regards to what the UI can offer.

Now all I need to do is to connect this to my Java backend and I'm ready to go.

Sounds easy? We'll see...

Saturday, April 5, 2008

Trusting God

A few weeks ago I was able to attend again our church's midweek service. In spite of being very late for it, I learned a valuable lesson from our pastor about "Trusting God".
He said that "as Christians we only have two choices: either we trust God with our all or not trust him at all."

He also gave an interesting analogy about a tightrope walker who did his stunts blindfolded while carrying a wheelbarrow. The tightrope walker had a critic who said that the trick was only made possible because of familiarization with the environment and cannot be pulled off elsewhere.

So the tightrope walker accepted the challenge and decided to perform the trick across the Niagara falls which he was able to complete successfully. The critic was humbled by this turnout of events and said to the tightrope walker that he now believes that the tightrope walker can pull it off wherever he wishes.

The tightrope walker said, "Do you really believe that I can do it?". The critic responded, "Yes, I really believe!" The tight walker replied, "No you don't understand what you're saying, "Do you really believe?" to which the critic answered, "Yes 100%!".

Then with a big smile, the tightrope walker said to the critic, "Then climb up the wheelbarrow, and let's do the trick again."

Have a nice day everyone!

Tuesday, April 1, 2008

EJB Injection in JSF Managed Beans

While trying to create a simple prototype for an application which uses JSF, EJB 3 and JPA, I decided to implement the suggestions from the article: Using an EJB Session Bean as a Model Facade.

I was particularly interested in injecting my EJBs to my JSF Managed Beans (the article mentioned that it should be possible to do this kind of injection with JSF Managed Beans and Servlets).

[sourcecode language="java"]
public class CatalogServlet extends HttpServlet {

@EJB private CatalogFacade cf;

// some variables and methods
}[/sourcecode]

I tried using JBoss 4 since it already had lots of available documentation regarding EJB 3 only to find out that this feature is not yet supported.

I tried switching to JBoss 5 Beta 4 but the error was the same.
16:16:31,765 ERROR [JBossInjectionProvider] Injection failed on managed bean.
javax.naming.NameNotFoundException: "Name of your Managed Bean goes here" not bound

Hmm, I should probably try this with GlassFish one of these days.

Recommended books:

0131738860 1933988347 1847192602

Luntian Bags

I was watching a local TV program last weekend and they talked about being "earth friendly".

I wanted to do my part in promoting environment awareness so I'm blogging about a website which I was able to note down, that of Luntian Bags.
Luntian Bags are reusable bags made of canvas that come in different designs and sizes. The purpose of the bags is to help reduce plastic bag pollution by using reusable bags instead of wasting plastic ones. These bags are stylish, earth-friendly and carry a message. So for your next trip to the grocery or mall, BYOB.

The owner of the site (as mentioned in her blog) said that she was inspired by the Just Say No to Plastic Bags post from the 51 Things We Can Do to Save the Environment article (Time magazine's website).

I first heard about the concept of bringing your own reusable bags from a local supermarket (Rustan's). I'm just not sure if the bags they have there are from the same source.

Anyway, I'm glad this thing is gaining momentum.

Great work you guys!

Introducing SulitPay

Sounds like a real competitor to PayPal (but limited to the Philippine market).

I'm still not sure though how easy it would be for other sites to integrate this service (or if it's even allowed at all).

You can just probably checkout the site: http://www.sulitpay.com/ for more details.

UPDATE 4/2: It's confirmed. It was just an April Fool's joke.