1 Reply Latest reply on Feb 5, 2007 11:05 PM by smokingapipe

    Resource loading in Seam - ideas

    pmuir

      There have been a few threads discussing resource loading recently, and I thought it would be worth summarising them (to the best of my ability/memory here). Please contribute your ideas and requests!

      The often asked questions normally fall into one of two camps:

      1. How can I provide access to a resource that I'm bundling into a component jar file (for example the s:selectDate component currently requires you add the css to your css file)
      2. How can I provide access to a resource that isn't available as a file on the disk (often loaded from a persistence context, but possibly created on the fly)

        There are some solutions already existing:



        • 1. Re: Resource loading in Seam - ideas
          smokingapipe

          There are three classes of problem that come up.

          1. Independent external resources: Something like an image. This isn't part of anything else and can be generated and served all by itself.

          2. A piece that needs to go into some other external file. Like I might need to insert a little piece into a CSS file or a JavaScript file. I need to be able to register a callback that says, "hey when you're generating that JS file, don't forget me."

          3. Non-local modifications to the HTML output. If I have a button that requires some JS, that JS needs to modify the header of the HTML output to either have the code embedded or have a reference to the external resource. Same with CSS. Right now I know that JS gets embedded all over the place but this is not correct.

          Each of these problems may have different solutions.