• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

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
0
res_this
Asked:
res_this
  • 2
1 Solution
 
jcoombesCommented:
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
0
 
res_thisAuthor Commented:
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
0
 
jcoombesCommented:
You can probably write one very easily - all the information that you need in that format is there in the HttpServletRequest object....

Cheers


JC
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now