Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Adding a WEB-INF jar to a webapp programmatically

Thanks, this is really useful. Is there a way to extract a parameter from web.xml so I could put ContainerIncludeJarPattern in web.xml itself?

I'm guessing that ContainerIncludeJarPattern has to be set before web.xml is processed, and you can only get at parameters after it has been processed, which would make it hard. I'm hoping that's not the case.

On 4/13/2013 6:25 PM, Jan Bartel wrote:
ccleve,

You can set the context attribute
org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern with a regexp
pattern of jars from the container's classpath to scan for annotations,
look for web-fragments etc etc.

Here's an example of setting it:

<Configure  class="org.eclipse.jetty.webapp.WebAppContext">

     <Call  name="setAttribute">
       <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
       <Arg>.*/.*javax.faces-[^/]*\.jar$|.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg>
     </Call>

</Configure>

Jan




On 13 April 2013 05:13, ccleve
<ccleve.tech@xxxxxxxxx
<mailto:ccleve.tech@xxxxxxxxx>> wrote:

    At development time our app doesn't have any jars in WEB-INF/lib,
    which means our webapps aren't scanning them for web-fragment.xml.
    The jars are on the main app's classpath.

    Is there any way to tell a WebAppContext programmatically to scan a
    particular jar?

    Ideally, I'd be able to set a context-param or an init-param in
    web.xml to specify the name or location of the jar.

    _________________________________________________
    jetty-users mailing list
    jetty-users@xxxxxxxxxxx
    <mailto:jetty-users@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/jetty-users
    <https://dev.eclipse.org/mailman/listinfo/jetty-users>




--
Jan Bartel <janb@xxxxxxxxxxx
<mailto:janb@xxxxxxxxxxx>>
www.webtide.com <http://www.webtide.com> – Developer advice, services
and support
from the Jetty & CometD experts.


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users





Back to the top