5 Replies Latest reply on Mar 10, 2005 2:55 PM by Rassin Lamak

    URL Pattern, how do I add to it ???

    rudebwoy Newbie


      I'm new to Jboss and java application servers in general. I'm try to set up Macromedia ColdFusion to work on top of a jboss installation. Took me a while but I got it to work. Now I'm just knocking out the kinks.

      The problem I'm currently addressing is one of URL patterns in the ColdFusion web.xml file. It has a section that maps "*.cfm" to the CFMServlet. This works great. However in addition to requesting a page like "index.cfm" or "about.cfm" we also would like to have URLs like so "http../index.cfm/123" and still have it so that index.cfm runs. (Using this method we can pass variables in the url but still have our site indexed by most search engines and having them treat each different url var as a separate entry versus indexing just index.cfm and ignoring the rest).

      When I try to access "http.../index.cfm/123" however I get a 500 error and index.cfm does not run.

      I've tried adding separate mappings to web.xml and seeing they work. I've tried replacing the "*.cfm" mapping with different variations but they do NOT work. I've tried adding another mapping section into the web.xml file with different URL patterns but they do NOT work either.

      Here are the patterns I've tried:


      Am I going about this the wrong way, I mean, is it not a matter or URL patterns?
      Am I modifying the wrong file (the web.xml file of the ColdFusion Application) ?
      Perhaps this setting should be done in one of the jboss files? If so, which one?
      Is this even possible?

      Please, any help would be appreciated. Many thanks in advance.

        • 1. Re: URL Pattern, how do I add to it ???
          Jon Barnett Master

          The problem is not so much the mapping but the interpretation of the URL. The slash implies a directory structure. The only way I know to address this issue is to put in a front end Apache web server and have it do URL rewriting. I haven't gotten around to writing the technote on it yet - maybe this weekend. You would need to use JK2 (I don't think Macromedia supports this) or proxy module to forward the rewritten URL. e.g Translate the last / into a proper query string and then pass that on to the ColdFusion server. Unless ColdFusion supports URL rewriting - I think the non-J2EE CF had some script magic for this.

          • 2. Re: URL Pattern, how do I add to it ???
            rudebwoy Newbie

            What if ColdFusion is the only application that I intend to run on jboss. Is there anyway then to send all requests to the CFMServlet? Wouldn't that allow my index.cfm/123 paths to work then?

            • 3. Re: URL Pattern, how do I add to it ???
              Jon Barnett Master

              I don't know enough about the CF port listener but I would assume that the CF port listener is receiving all your requests and trying to pass it to the correct CF servlet. However, due to the parsing rules for the received URL, the request router is having difficulty matching up a suitable servlet because of the implied directory value.

              I would check a CF forum because I would think this is more CF specific than JBoss specific.

              • 4. Re: URL Pattern, how do I add to it ???
                Raja Master

                Try commenting out
                <!-- The mapping for the default servlet -->

                this from ur web.xml and retain the cfm mapping.

                • 5. Re: URL Pattern, how do I add to it ???
                  Rassin Lamak Newbie

                  I was able to deploy ColdFusion MX 7.0 Enterprise as an .EAR onto JBoss 4.0.1. The context root of the ColdFusion application is /CFMX. What can I do to make ColdFusion the default?

                  Also, I created a test directory under the cfusion.war (which is under cfusionmx.ear) and placed a couple of cfm files and they work fine. However, when I placed a jsp file in the same directory, the JSP code does not get executed.

                  If anybody knows how to get this to work, please share it here.

                  Thanks in advance.