How do I parse hex integer Color codes passed as parameters to my servlet?
Created: Sep 7, 2001 Author: Bogdan Sheptunov (http://www.jguru.com/guru/viewbio.jsp?EID=310126) [ I am trying to pass Color values like 0xeeeeee or 0xEEEEEE as values to parameters from a get post (in the header). However I am unable to process the value into an integer value which is a requirement for the Color(int) constructor I will use to create the new color based on this passed value, I have tried int colorvalue=Integer.parseInt(req.getParameterValue(“ColorParameter”)); It is throwing an NumberFormatException which I am printing displaying the actual value of the parameter e.g Could anyone kindly tell me how to process this value of the parameter into an integer value so I may pass it to the Color(int) constructor. Thanks. ] The keyword for you is Integer.decode().