Expressive with experience,Correction and goal is always in mind

Very recently I started blogging wanted to share my own experience to make my self better and better

Monday, August 27, 2012

JSF 1.1 vs JSF 1.2

And after a long time,I thought of writing new blog on JSF.

Very recently,I have been involved with JSF 1.2 migration with Websphere portal server.If some one will ask me why can't we migrate to 2.0,it is all due to budget and business does not want pay any money on migration.

Here are some of major finding,you should watch out for JSF 1.2 components :

  • Very strict life cycle : JSF 1.1 components are not rigid with JSF life cycle where as JSF 1.2 containers are strict about maintaining life cycle of JSF components. For example, you can not manipulate managed bean properties in render response phase, properties managed during render response phase will initialized to default values once rendering is over.
  • Nested form  : JSF 1.1 components allows nested form where as JSF 1.2 components having nested forms can result in page freeze mean actions can not be invoked from JSP page.
  • JSF Form attributes : JSF 1.1 accepts form elements containing no values where as JSF 1.2 can result in syntax error. For example, <h:inputHidden id="myHiddenField"/> will not work with JSF 1.2 and can result in syntax error.
JSF Best Practices:

You also need to be careful with getter methods of managed bean,avoid writing any logic in getter methods since getter methods are being called many times by web container.

Managed beans and backing beans are thread safe where as render response listener and phase listener are not thread safe.Please ensure that don't write any business logic which may run into thread safety issues.

Friday, May 20, 2011

Debugging SSL

Well very recently I took pain of debugging ssl certificates in java environment and thought of keeping something in my blog to make some one's life easy.very often we run into problems of bad certificate errors on SSL clients(java,.Net etc)..This guide will help you to debug certificates errors using open ssl utility.
So here is what I went through to debug ssl connection :

So what you require :

So what you need to configure :
  • Create a OPENSSL_HOME environment variable and set it's value to installable directory.
  • Append OPENSSL_HOME/bin to System Path Variable.
  • To Test your Installation go to command prompt and type openssl --help

All set now real magic starts....

Certificate Installation :
  • Copy signed / self signed certificate into local drive
  • If signed certificate in pfx(.p12,.pfx) format convert to pem format using following commands :
    • openssl pkcs12 -in %local_drive%/xxx.yyy.p12 -out client_certs.pem
  • Enter Import password provided by certificate provider.
  • Extract private key contents from client_certs.pem by copying contents ends till END ENCRYPTED      PRIVATE KEY--- and save it into client.key fille
  • If signed certificate in pem format(.pem,.crt,.cer,)
    • Extract private key contents from client_certs.pem by copying contents ends till END ENCRYPTED PRIVATE KEY--- and save it into client.key file

Certificate Configuration :
  • Extract each certificate from client_certs.pem ends with ---END CERTIFICATE-- in separate pem file.(remember self signed certificate comes with many certificate in it.
  • Check the modulus of private key using command : openssl rsa -in client.key -noout --modulus
  • Check the modulus of pem file using following command : openssl x509 -in *.pem -noout --modulus 
  • Pick only pem file which has the same modulus as private key for making connection with openssl and save it as client.pem

Certificate Verification :
  • Run following command to make an ssl connection with message bus :
    • openssl s_client -connect mqurl:mqport -cert client.pem -key client.key

So now you have debugged SSL connection and ready to set for making connection with any clients.HORRAY!!!!!!!

Wednesday, February 2, 2011

Struts wild card search in URL

I have been completely offline with my blogs as travelling keep me busy between Pune and Mumbai..Of course I can't miss out time with my family on weekend for sure.

Recently One of my friend requested to how to perform wild card search in struts2 when search parameter is included in URL.say for example user can search on so now for application should search on search parameters.

So here is the easy solution :

Include following lines in struts.xml :

  <"struts.enable.SlashesInActionNames" value="true"/>
 <"struts.mapper.alwaysSelectFullNamespace" value="false"/>

Now include an action in struts.xml :

<package name="catalog" extends="struts-default" namespace="/catalog"/>
    <action name="/catalog/*" class="com.project.view.action.CatalogAction"/>
        <param name="search">{1}>

Now make new Action named CatalogAction :
public class CatalogAction {
   private String search ;
  public void execute(){
     //this.getSearch() will return search param from URL
  //inclde getter / setter method for search
That is it u r done need to extend any Action classes from struts extends="struts-default" does the work for u.
I have been working on spring mvc a lot but struts-2 looks promising for sure....easing out developer's life:-)

Thursday, October 28, 2010

?? Cloud Computing ??

It has been a buzz now almost everywhere about cloud computing in technical world so thought about writing some explanation on cloud computing in layman language.

Cloud computing for me is about sharing resources, software,information to others. It can be infrastructure, platform OR software as a service.

Cloud can belong to private OR public. I think one of the most important aspect of cloud computing is scalability where It can accommodate more number of users without degrading performance. For me my blog is just like a cloud which is running on public space.

Now If I want to make some one understands about cloud computing who is not into technical world how do I do that? Let me do some rumination around my childhood days in which I used to watch movies on VCR(Video Cassette Recorder) and VCP(Video Cassette Player).

Just sharing couple of incidents going around in my childhood :

I still remember days where my parents used to rent a VCR Player from Video Library and we used to watch movies for some hrs.All the infrastructure has been provided by Video Library and we just need to pay rent for VCR and Video Cassette on hourly basis for me this is class example of Infrastructure as a service running on public space.

Then We had days where we had VCR at home we just used to rent video cassettes from video library. This is just classic example of software as a service where VCR was installed in private space and services has been taken from video library.

Now let’s get into modern days where we all are having DTH(Disk To Home) all the necessary infrastructure pertaining to DTH such as set top box,Antenas and required necessary stuff has been installed at home which can give us classic user experience about digital TVs. For me this has been categorized into platform as a service again one type of cloud computing which is running on private space.

Now let me give u some real-time example of cloud computing which are as follows :

  • Platform-as-a Service like GoogleApps (set of applications which are part of our day2day life).
  • Infrastructure-as-a-Service like Amazon Web Services provides virtual server instances with unique IP addresses and blocks of storage on demand. Customers use the provider's application program interface (API) to start, stop, access and configure their virtual servers and storage.
  • Software-as-a-Service can be anything from web based mail to database processing. Google mail OR google docs can be classic example of SaaS.

I think cloud could be useful in developer community where we all take an ache of setting up development environment for project and goes through all pain..Can't we have one cloud among developer community ?

Well researched on Internet again and found couple of links which are as follows :

Just imagine Technical guy wants to learn new technology, he can log into cloud(Learning based cloud) pays something for it If require and can do hands on in the cloud without worrying much about installation, configuration and infrastructure. This will be classic application of cloud computing If it happens.

PS: I am not an expert in this area but this is what I have learned.

Sunday, October 3, 2010

Leisure time with Family

I have been waiting for this but did not get much time and decided to have a vacation in month of October.It was now about deciding place where to go couple of places I had it in my mind either South India OR Beaches (Goa and Andaman Nicobar Island).October started with heat over here in Mumbai, temperature is touching around 35 c so did want to take chance for trip around beaches.Well I think October is hottest month since last 30 years.So decided to go for south India ,now choices has been narrow down to either Kerala OR Banglore . Finally decision made and decided to go for places around Banglore .I have decided to have trip for 7 nights 8 days and places were Mysore,Ooty,Kodaikanal and Banglore.
So now as I have decided places for vacation now how do I plan my journey should I buy package for my entire trip OR I planned my self...I and my wife decided to have planned entire trip on our what do I need to do ?
  • Flight tickets
  • Rent a car
  • Booking of hotels in each city
  • Places to visit
Now booking of flight tickets I decided to find out various option from couple of airlines and I went with Indigo airlines It was quite cheap :-)..I started looking for car rental companies in Banglore and went with company called SLS Car Rental.Booking of hotels again done with the help of Internet which is as follows :
  • Mysore :: Peridot INN 2 Nights
  • Ooty :: Sunshine Inn 2 Nights
  • KodaiKanal :: Hotel Grand Palace 2 nights
  • Banglore :: Hotel Grand Residency 1 night
About places I have taken all the information from Internet .

So now It looks like I am all set for my vacation ...My vacation will start from 10th October and ends at 17th October.I have kept my budget 50K let us see If I can make it with in that.

Sunday, September 19, 2010

Interview with Thoughtworks

Well It started  when one of Thoughtworks recruiter got in touch with me some how I was not convinced about accepting any new opportunity.

I have received mail about 2 coding problems which I need to solve.
Problem 1 :
Mars Rover
problem 2 :
Sales tax

I choose to solve sales tax problem as I found it quite relates to real world project.Attaching my design diagram.

I received call from recruiter that I have cleared coding round and now they want to see me for next interview rounds.

Interview process started with one of the Thoughtworker .It started with discussion about what I have done to solve a problem OO Design OO Concepts .It went OK.
We have implemented very small extension on my assignment without changing much code.But I must admit she was very good listener and have shown very good attitude during our conversation.

I thought It ended well.I got amazed with entire environment It was so live table tennis,Carom board and some are hooked on to PC.

Technical inerview with other Thoughtworkers followed by my code pairing round.Interview was more about on algorithms,OO design,SOA ,Restful Services .It went OK and now I need to write some tests It has been never easy where u told to write some tests after having 10 yrs spend in IT Industry.First test was about speed vs accuracy I managed to answer 35 questions I think It is quite simple.Now I need to write logical test It was brain storming kind of a test I got tired and exhausted at the end of it.I felt I could have done better with logical test.It still floating in my mind.

Now I need to go through one more technical round with other Thoughtworkers.I was not quite prepared for it as I felt I can not speak more but still I went through with that. From my preservative It went OK but recruiters have told me they want to grill me more on my technical skills.

I have received a call from Thoughtworks recruitment team about my next technical round.
I went through with one more technical round in which they grilled me on J2EE,My projects SOA and Restful Services.It went OK.

One of the good thing about thoughtworkers are that they are very good in attitude and very good listeners.

Final round was just about formalities about what passion I carry for programing what I do in my day 2 day life some thing about projects...

SCEA Preparation

Well I started this entire certification to make my self updated with J2EE version and utilizing my travel time Now segregating my preparation into 3 parts :

Pre Exam Preparation :

I bought vouchers for SCEA and I bought all three my voucher at once shot though it is not needed don't make that mistake which I did ...I did not started preparation from very next day I was just relaxing as I went through my 2nd surgery for Gallbladder.

Part-1 :
It started on April 10th where first time I started collecting material for SCEA part-1 preparation. Just gone through EJB3 in Action,JSF in Action(couple of times) which was new topic for me otherwise rest of the topics were easy to deal ..dont forget to read Cade and Sheil book(Sun Certified Enterprise Architect for Java™ EE Study Guide) will give u over view on architect exam.Couple of mock exams and I am sure all can clear part-1 exam preparation time was around 3 hrs for month and most of my time in traveling ..I was quite eager about further exams so for me scoring was not important ...I felt quite easy of course once I cleared part-1 exam on 10th May 2010..

Now came a break for me where I was working on mission critical software project (software projects are mission critical don't know why ?)though I downloaded my assignment on 10th May (very same day on which I cleared my part-1 exam)again used my traveling time for rough design but never put in execution as I was tired and exhausted almost every day.25th June was the delivery day for my project and It was on time dude....relaxed for a week but wanted to start my part-2 preparation.

I started preparation on 1st July .My assignment was Big Smoke Cigar company who want to go online and expand their line of business.During that my experience on EJB2 helped as well I did some prototyping on EJB3 JSF Components and JPA using GlassFish and Netbeans IDE.I used J2EE5 tutorial for all my prototyping.POC went well with glassfish and NetBeans IDE and now I was quite ready with my technology choice.

Now I came onto tiers and layers It was quite obvious choice for me multi tier / and usual set of tiers (Presentation,Business,Integration and Resource)Don't we have this in all web application ? So for me It was not a big effort justifying each and every decision is very important and documenting it.Now I came onto domain modeling I did not alter any domain objects just used as it was described in assignment.

Here are my list of documents :

Risk & Mitigation : Described top 3 risk and mitigation
Assumptions : One page assumption described as much as u can don't back off
Big Smoke Cigar Component Diagram : Refereed to Cade and Sheil book(Sun Certified Enterprise Architect for Java™ EE Study Guide)
Big Smoke Cigar Class Diagram : Described domain modeling ,important managers and controllers (If Any)
Big Smoke Cigar Sequence Diagram : Spilled into six diagrams described flows from presentation to resource tier.
Big Smoke Cigar Deployment Diagram : Very simple just used all my experiences.Described UAT environment as well.

Re factoring on contents and presentation but only couple of time ...

And was on time I was quite ready on 31st July..

Part-3 exam :

It was quite easy just think about what u did and why u did in 2nd part.It was 2 hr exam in pro metric center.Questions were quite simple as follows :

Why have u chosen framework If any If not why not ?
What technology u have used in presentation and business tier why ?
Set of design patterns on which layer and why ?
Security (network security and application security)

Not remember all the questions now but It was in line with your part-2 preparation...

I think I wanted to write so many stuff in exams but was not having much of time.

I mailed my assignment to after writing my part-3 exam.

Here are the important links you all would like to follow :

I think If you are not well versed with UML get familiar with UML.

My result got announced on 21st August It was just a mail that I have cleared SCEA exam.