You can configure WebAppContext in the Jetty Deployment Descriptor XML as you 
did for the resource handler. Then, you can use DefaultServlet in web.xml to 
serve your static files and you can put your CORS filter into web.xml too.

 

The documentation seems to indicate that DefaultServlet should be used for 
advanced static deployment:

https://www.eclipse.org/jetty/documentation/current/static-content-deployment.html

 

This is my example in my latest project:

WebAppContext

https://sourceforge.net/p/red-feed-aggregator/code/ci/master/tree/red-feed-aggregator.xml

CORS filter

https://sourceforge.net/p/red-feed-aggregator/code/ci/master/tree/src/main/webapp/WEB-INF/web.xml#l397

 

In your case, you may have to modify the resource base.

 

I hope that it helps.

 

It seems to work:

http://80.13.94.99/feed/

> Message du 23/08/20 17:48
> De : "Kara McElwrath" 
> A : [email protected], "JETTY user mailing list" 
> Copie à : 
> Objet : Re: [jetty-users] CrossOriginFilter
> 
>
I'm sorry for my lack of knowledge in the subject. I was hoping for a location 
of a web.xml for the static content. Is that not possible?  In what file do I 
configure the WebAppContext?

>
Thank you for your time. I appreciate your help.


>

On Sun, Aug 23, 2020, 4:12 AM  wrote:
>

> Hello

>  

> You have to use WebAppContext (or at least ServletContextHandler) to do that.

>  

> Message du 22/08/20 20:34
> > De : "Kara McElwrath" 
> > A : [email protected]
> > Copie à : 
> > Objet : [jetty-users] CrossOriginFilter
> > 
> >
Hello, we are running jetty-9.4.30.v20200611 and it is working well for a Java 
application which has its own web.xml.  
> > 
> > Additionally, in $JETTY_BASE/webapps I have a static.xml file configured 
> > for serving static content via a ResourceHandler.  I need to set up a 
> > CrossOriginFilter filter for the static content.  In what file/location do 
> > I add CrossOriginFilter filter and filter-mapping block for the static 
> > content?
> > 
> > Thanks in advance.
> >

> 
> 
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To unsubscribe from this list, visit 
> https://www.eclipse.org/mailman/listinfo/jetty-users
> 
>
_______________________________________________
> jetty-users mailing list
> [email protected]
> To unsubscribe from this list, visit 
> https://www.eclipse.org/mailman/listinfo/jetty-users
>

_______________________________________________
jetty-users mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to