Most helpful links I found

JSFClearing the FUD(Fear, Uncertainty, Doubt) about JSF
JSF Application Life Cycle
JSF Conversion and Validation
JSF Component Development
Developing Web Applications for WebLogic Server
More specificallyweb.xml Deployment Descriptor Elements
ADF FACES Tag library information
Writing Web Application Deployment Descriptors
Hibernate Tutorial
Java Design Patterns
Good tutorials on all subjects can be found at
More on Taglibs
Links to prepare for SCWCD

Converting a date String and time String to a Calendar object and vice versa

In a scenario where the date is selected using a date selector dropdown, and time through a time textfield the date and time strings from the UI may need to be converted to a Calendar object.

Here is sample code how this can be done:

//converts date and time Strings to calendar object from UI inputs

public Calendar setDateAndTime(String strDate, String strTime) {
		Calendar calendar = Calendar.getInstance();
		Calendar calendar2 = Calendar.getInstance();
		try {
			DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
			Date date = dateFormat.parse(strDate);
			if (strTime != null) {
				dateFormat = new SimpleDateFormat("kk:mm");
				date = dateFormat.parse(strTime);
				calendar.set(Calendar.MINUTE, calendar2.get(Calendar.MINUTE));
		} catch (ParseException e) {
			// todo - handle exception....
		return calendar;

//converts Calendar object to String date to display on UI

public String formatTime(Calendar calendar) {
		String strTime = null;
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("kk:mm");
		strTime = simpleDateFormat.format(calendar.getTime());
		return strTime;

//converts Calendar object to String time to display on UI

	public String formatDate(Calendar calendar) {
		String strDate = null;
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy");
		strDate = simpleDateFormat.format(calendar.getTime());
		return strDate;

How to shoot yourself in the foot in any programming language

Build the Gun class, build the Foot class, create a relation between Gun and Foot classes, compile Gun, load Gun and shoot yourself in Foot. Only to realize that there is another Gun packaged in a jar shooting at same Foot giving you Gun loader errors.

Create required functions and point Gun to shoot yourself in Foot. When you shoot you find that the gun was pointing to someone else’s foot.

Create Gun and Foot functions, create a nice interface to shoot yourself in foot. But you get runtime error saying error in line 20007. After hectic bug fixing, you correct line 150 only to find that the bullets are disabled in MS IE Gun, so that you cannot shoot.

Find a Gun, it falls apart. Put it back together, it falls apart again. You try using the .GUN Framework, it falls apart. You stab yourself in the foot instead.

You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you.

You shoot your right foot with one hand, then switch hands to shoot your left foot but you realize that the gun has turned into a banana.

You create Gun and Foot instances, fire action events with Gun, only to realise that you could have done better and saved more time with a simple FLASH Gun.

You attempt to create Gun and Foot instances, create the GunHandler classs, create the GunAction class, create the Delegate, SessionFacade, DAO, Value object etc. You are too tired now to shoot yourself in the foot. The boss shoots you in the foot instead.

You create Gun and Foot instances, compare them with the one you made using Struts, feel better about it, only to find there’s a JSF bug which stops your Gun from working.

You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your foot. After that’s done, you pull the trigger, the gun beeps several times, then crashes.

Microsoft accidentally shoots you in foot. Promises service pack to reattach your foot sometime in the next year. 18 months later you get service pack that removes your colon along with the rest of your foot.

You try to shoot your left foot, you miss 2 pixels. You try to shoot your right foot, you miss 1 pixel. Finally you try to shoot your head, you miss 10 pixels. Then you realize you’re using MS IE gun.

-Define a Foot interface
– Define a FootHome
– Define a FootImpl
– Define a Bullet interface
– Define a BulletHome
– Define a BulletImpl
– Define a Gun interface
– Define a GunHome
– Define a GunImpl
– Get the FootHome from the context
– Catch NamingException because you JNDI isn’t setup
– Get existing Foot from FootHome
– Fix error because you forgot to narrow the instance
– Create new Gun
– Be shocked that it actually worked successfully
– Create new Bullet instance
– gun.shoot(bullet, foot);
– Catch RemoteException
– Check the stack trace, find the actual problem
– Decide to go for Hibernate instead
– rm -rf *.java *.class

Enterprise Java
You build Gun and Foot objects in JSP/ Servlet model, you are asked to re-create Gun using Struts, then re-engineer it with JSF and later on asked to add Spring/ Hibernate capabilities. The gun which originally could shoot your foot now takes ages to load and shoot so that the bullet now comes out in slow motion.