Substitute for org.apache.cocoon.Utils.encode

Posted on 2007-12-05
Last Modified: 2013-11-23
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
Question by:res_this
  • 2

Expert Comment

ID: 20463364
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):

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

Hope this helps


Author Comment

ID: 20467625
 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?

Accepted Solution

jcoombes earned 125 total points
ID: 20467761
You can probably write one very easily - all the information that you need in that format is there in the HttpServletRequest object....



Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTTPSessionBindingListernter not configured in deployment descriptor 2 54
expectj telnet failing 5 37
Tomcat: Unable to run tomcat service. 2 20
Problem to Alipay 10 24
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question