[ 
https://issues.apache.org/jira/browse/WW-3933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130765#comment-18130765
 ] 

Lukasz Lenart commented on WW-3933:
-----------------------------------

Closing as Won't Fix.

A web-fragment.xml that maps StrutsPrepareAndExecuteFilter cannot detect that 
the application already declared the filter in web.xml, so the usual setup 
would register it twice. It also cannot be switched off selectively: the only 
ways to drop a fragment-declared mapping are metadata-complete="true" or an 
absolute-ordering that omits the fragment, both of which affect every other 
fragment in the deployment. These are the concerns raised in the comments above 
and they still hold.

No comparable framework ships a fragment that maps a filter. Spring delegates 
to user-written WebApplicationInitializer classes, Jersey registers its servlet 
only when an @ApplicationPath application is present, and Log4j 2 uses its 
fragment for ordering only and performs the registration in a 
ServletContainerInitializer with an explicit opt-out. Spring Boot users 
register the filter through a FilterRegistrationBean.

Descriptor-less registration remains possible as a separate improvement: a 
ServletContainerInitializer that registers the filter only when no Struts 
filter or servlet is already present, with an opt-out. That needs its own 
design discussion and ticket, since it affects the split 
StrutsPrepareFilter/StrutsExecuteFilter setup used with SiteMesh and would 
expose any application that merely has struts2-core on the classpath.

> Provide web-fragment.xml for easier deployment on Servlet 3.0 compliant 
> containers
> ----------------------------------------------------------------------------------
>
>                 Key: WW-3933
>                 URL: https://issues.apache.org/jira/browse/WW-3933
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Dispatch Filter
>    Affects Versions: 2.3.7
>            Reporter: Daniel Le Berre
>            Priority: Minor
>             Fix For: 7.5.0
>
>
> Servlet 3.0 specification includes the possibility for libraries to ship 
> web-fragment.xml files in their META-INF directory to contribute some 
> declarations to the main web.xml file.
> Struts 2 only requires the declaration of a filter in the web.xml file to 
> work. When building Servlet 3.0 webapp, the web.xml file is often not used at 
> all.
> It would be nice to ship a web-fragment.xml file in struts 2 that declares 
> the PrepareAndExecute filter to simplify the use of the framework on a 
> servlet 3.0 stack.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to