This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I think if you don't concentrate quite as much on what you want to happen, it should become quite obvious why you get the result you do.
You split on the ":" character. There are three such characters in the string and therefore you get four strings as the output. So clearly it was a really bad choice to use that character as the separator between the two strings you actually want as the output. I would suggest going back and fixing that bad choice. Use a separator character which isn't going to appear in the strings you want to be separated.
Joined: Mar 24, 2005
The bean's attribute value is retrieved from database which in the form of "http:website1.com : http:website2.com"
i.e urls seperated by "space colan space"
Since it is a legacy system, I cannot do anything about it.
I could have used scriptlets to split them but would like to do it in a cleaner way.