I need to be able to parse and retrieve the info (device profile) in my x-wap-profile header.

How can I do this on my server side (Servlet) with java apis?

I will appreciate if I can get how to evoke the URL (the x-wap-profile value) and parse it to extract the necessary parameters (e.g bitsperpixel, screen size et al)

Is there any java library doing this, if yes can u show me an example of ow it works

May be something like:
string wap_profile = request.getHeader("x-wap-profile);
Profile profile = p.getProfileFromFile(servlet.getServletContext().getResource(wap_profile));