> Unfortunately, significant legal issues can arise when you use code
> without
> a clear license or some similar provenance, if you put that code into
> your
> client's application. These issues are unlikely to arise, but
> unpleasant
> when they do, from what I've seen and heard. On the bright side, these
> issues are resolved through civil courts rather than criminal, so you
> don't
> end up with mates named "Bubba", if you know what I mean.
>
Thanks Dave for clarifying why it is not a good idea to use unlicensed
code. For the sake of completeness though, let me provide the contents
of my last email on the subject of SES URLs, which contains source code
for an example Servlet. Again, the below code is public domain.

The best solution I have found to handling SES URLs is to use a Servlet
request dispatcher. Here is the idea...

Create a Servlet that will transform directories in a URL to query
parameters and then forward the request to a CFM for processing. You
then create a Servlet mapping that allows that servlet to respond to
all URLs that match the pattern you use for SES. For example, let's say
you want your URLs to look like the following.

http://www.domain.com/ses/foo/true/bar/1

You would then deploy your servlet with a mapping of /ses/* and the
above URL would be transformed into the following.

http://www.domain.com/ses.cfm?foo=true&bar=1

Below is the source code to a quick and dirty Servlet that handles the
above.

import java.util.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class SES extends HttpServlet
{
         public void doGet (HttpServletRequest request,
HttpServletResponse response)
                 throws ServletException, java.io.IOException
         {
                 String query = request.getQueryString();
                 StringTokenizer st = new
StringTokenizer(request.getPathInfo(), "/");
                 Vector tokens = new Vector();
                 while(st.hasMoreTokens())
                         tokens.add(st.nextToken());

                 //the first token is always "ses"
                 if(tokens.size() > 1)
                 {
                         for(int itr = 1; itr < tokens.size(); itr += 2)
                                 query += "&" + tokens.get(itr) + "=" +
tokens.get(itr + 1);
                 }
                 
this.getServletContext().getRequestDispatcher("/ses.cfm?" +
query).forward(request, response);
         }
}

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com
(888) 408-0900 x901

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to