Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I parse hex integer Color codes passed as parameters to my servlet?

0
Posted

How do I parse hex integer Color codes passed as parameters to my servlet?

0

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 NumberFormatException : 0xEEEEEE 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().

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123