Joose Vettenranta dijo:
> Hi,
>
> I'm trying to create md5-chechsum in XSP.
>
> I already have like this:
>
>      java.security.MessageDigest md =
> java.security.MessageDigest.getInstance("MD5");
>      byte[] array = md.digest(password.getBytes());
>
> And it seems to work OK. But problem is, howto get that byte-array to
> hex-string?
>
> I found that in catalina there is org.apache.catalina.util.MD5Encoder
> which seems to do what I want, but I can't use that in XSP.
>
> I've tried
> <xsp:structure>
>   <xsp:include>org.apache.catalina.util.MD5Encoder</xsp:include>
> </xsp:structure>
>
> but it won't even compile.
>
> So, how to get that working?

Because you need to have the jar in the servlet classpath (WEB-INF/lib).

BTW, try to look into o.a.c.utils.* and in commons-lang-2.0.jar, I thought
I saw something like a hexconverter somewhere. Look also in http related
libs as commons-httpclient-2.0-final.jar.

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to