my dog learned polymorphism
The moose likes Servlets and the fly likes Converting data to Uppercase before passing it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Converting data to Uppercase before passing it" Watch "Converting data to Uppercase before passing it" New topic

Converting data to Uppercase before passing it

Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
I am not sure where exactly to post this but here goes--
We are using JSP pages on the frontend to collect data and pass to backend CICS systems via servlets and command classes in VA JAVA. After finishing about 15 screens, we realised that all data going back to the CICS system needs to be in UPPERCASE. At this time, it is too tedious to go back to the JSP page and include Javascript tags(toUppercase()) on each of the fields in order to convert the data. Is there an easier way to make this change globally on the servlet side where it chnages all the data to uppercase before passing it on to CICS??? Looking for a global change solution. Any help would be appreciated.
Thanks in Advance!
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Have you tried String.toUpperCase()?
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at for other WebSphere information.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Gerry Giese
Ranch Hand

Joined: Aug 02, 2001
Posts: 247
I've never used CICS or even heard of VA JAVA, but if you have 'command' classes that are your interface to CICS, why not just write a wrapper class around those? It would have the same exact API, but in each method you would toUpperCase() the String data before calling the 'real' command class. If you have a lot of command classes, it might not save any more time than fixing the JSPs.
If you always post from JSPs to Servlets, it shouldn't be hard to write a generic function you call at the start of doPost() that loops through the parameters and uppercases them and stores them into a params Hashtable. Then change all your calls to getParameter() to (String)params.get() on the hashtable. Ex:

No guarantees the code will run, but this is the general idea. Hope this is of some help. Your only other hope is that VA JAVA has a function you haven't read about that will take care of the upper-casing.

CJP (Certifiable Java Programmer), AMSE (Anti-Microsoft Software Engineer)
Author of Posts in the Saloon
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

VA JAVA = Visual Age for Java, I'm thinking
I agree. Here's the link:
subject: Converting data to Uppercase before passing it
It's not a secret anymore!