• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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