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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 104
web services creation SOAP vs REST 5 56
fibonacci ten numbers 4 45
hibernate example issues from command prompt 10 50
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

807 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