Link to home
Start Free TrialLog in
Avatar of res_this
res_this

asked on

Substitute for org.apache.cocoon.Utils.encode

Is there any known substitute for the org.apache.cocoon Utils encode method .I am planning to remove cocoon and hence need a method which will do the same function
Avatar of jcoombes
jcoombes
Flag of United Kingdom of Great Britain and Northern Ireland image

Not sure what this encoding utility does, but if it's for URL encoding then you might want to look at using URLEncoder directly (there's some stuff in Cocoon that just wraps this):

http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html


Alternatively, if it's more of a Base64 encoding or similar then try looking at the encoders provided along with Bouncy Castle.

http://www.bouncycastle.org/docs/docs1.4/org/bouncycastle/util/encoders/Base64.html

Hope this helps


JC
Avatar of res_this
res_this

ASKER

Hi,
 I found that the encode function encode(javax.servlet.http.HttpServletRequest req, boolean agent)
encodes the given request into a string using the format userAgent:method:protocol://serverName:serverPort/requestURI?query with the agent flag controlling the presence of the userAgent field.

Is there any non-cocoon API which does this?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of jcoombes
jcoombes
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial