Solved

Substitute for org.apache.cocoon.Utils.encode

Posted on 2007-12-05
3
187 Views
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
0
Comment
Question by:res_this
  • 2
3 Comments
 
LVL 4

Expert Comment

by:jcoombes
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):

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
 

Author Comment

by:res_this
ID: 20467625
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
 
LVL 4

Accepted Solution

by:
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....

Cheers


JC
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Core Java. What output will be and why ? 6 64
Java asynchronous logging 4 50
map related example 6 29
xampp tool 12 23
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now