2 Replies Latest reply on Sep 16, 2008 9:21 AM by monkeyden

    Getting the ".seam" url-pattern dynamically

    monkeyden

      Using Seam 2.0.2 sp1, RichFaces 3.2.2


      I need to print out a Seam URL in a call to a JavaScript function:


      onclick="createFoo('/foo/bar/foobar.seam');"




      I'd like to avoid having to put .seam in the URL itself, in the event that the url-pattern in web.xml changes.  Has anyone done something similar?

        • 1. Re: Getting the ".seam" url-pattern dynamically
          nickarls

          Ummm. I'm not sure you can read the servlet mapping info. At least from JavaScript. And even if you could, you'd have a hard time finding someone who has actually had to change the pattern in a project ;-) Besides, you could always isolate the .seam into one place in JavaScript. Just add a CONSTANT and add that.

          • 2. Re: Getting the ".seam" url-pattern dynamically
            monkeyden

            Thanks Nick.  I knew all that.  I just wondered if someone thought of a workaround I hadn't. 


            I also have a #{serverBasePath} in components.xml, for inclusion of static resources.  I'll likely just add a factory for the extension as well.