Giter VIP home page Giter VIP logo

Comments (13)

janbartel avatar janbartel commented on June 15, 2024 2

So I would suggest we do the following for ee8/9/10 and beyond:

  • look for a jetty-web-x.y.z.xml where x.y.z matches the executing version (eg 12.0.1)
  • if not found, look for a jetty-web-x.y.xml where x.y matches the most significant digits of the executing version (eg 12.0)
  • if not found, look for a jetty-web-x.xml where x matches the most significant digit of the executing version (eg 12)
  • if not found, look for jetty-web.xml

The environment needs to be there in the name too as key classes have different names.

So the preferential search order would then be:

1 jetty-web-eeN-x.y.z.xml
2 jetty-web-eeN-x.y.xml
3 jetty-web-eeN-x.xml
4 jetty-web-eeN.xml
5 jetty-web-x.y.z.xml
6 jetty-web-x.y.xml
7 jetty-web-x.y.xml
8 jetty-web-x.xml
9 jetty-web.xml

from jetty.project.

vmassol avatar vmassol commented on June 15, 2024 1

Note that items 6 and 7 are dups.

from jetty.project.

joakime avatar joakime commented on June 15, 2024

Interesting problem.
The quick solution would be to have an alternate named jetty-web.xml, something like jetty-ee8-web.xml, which has a priority in lookup in Jetty 12.

But considering that Jetty 10 is now at End of Community Support, why do you need Jetty 10 support still?

from jetty.project.

vmassol avatar vmassol commented on June 15, 2024

The quick solution would be to have an alternate named jetty-web.xml, something like jetty-ee8-web.xml, which has a priority in lookup in Jetty 12.

This doesn't exist yet, right? I was indeed looking for something like this :)

But considering that Jetty 10 is now at End of Community Support, why do you need Jetty 10 support still?

First, thanks for the info, I wasn't aware of that!

Till today, the version of Jetty that XWiki supports is Jetty 10 (see https://dev.xwiki.org/xwiki/bin/view/Community/SupportStrategy/ServletContainerSupportStrategy/). The reason is that XWiki was not able to upgrade to 11 since that would have meant removing the javax.servlet.* namespace and moving to the jakarta.servlet.* namespace and we're far from being able to do this. This is actually why, when I learnt that Jetty 12 was able to support EE8, that I wanted to see if we could make XWiki run on it and thus be able to support Jetty 12.

What we could do indeed, is only support Jetty 12 on our master branch (ie on our latest releases), and not on our LTS branch (which would still be on Jetty 10). Note: it would be too harsh to our users to ask them to move to Jetty 12 in a heartbeat. However, if we could support both Jetty 10.x and 12.x on all our branches, it would be even nicer.

We could provide several distributions of XWiki for the different Jetty versions, but that's a lot of work and support for us (we are already supporting other servlet engines, DBs, etc and the combination matrix is already bursting ;)).

So, my understanding, is that at this point in time, there's no solution to have a WAR with a jetty-web.xml be deployable both in Jetty 10.x and 12.x, correct?

Thx @joakime !

PS: When I say "supported version" above it means:

  • We have automated tests that execute on that Jetty version, to prove that XWiki works on that Jetty version.
  • If there are questions or issues reported for that version, we work on fixing them
  • We provide distributions of XWiki on Jetty for that version

from jetty.project.

janbartel avatar janbartel commented on June 15, 2024

@vmassol is this the jetty-web.xml file that your project uses here: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/jetty-web.xml

Is it only these 2 properties that you need to configure, or is there more?

from jetty.project.

vmassol avatar vmassol commented on June 15, 2024

Is it only these 2 properties that you need to configure, or is there more?

@janbartel indeed, there are only 2 properties we need to configure. Is there another way to configure them?

Thanks

from jetty.project.

joakime avatar joakime commented on June 15, 2024

I submitted PR #11274 as a proof of concept for a possible way to address this.
Would like feedback (@janbartel @vmassol )

from jetty.project.

vmassol avatar vmassol commented on June 15, 2024

Thanks @joakime ! Do you think it's better to do it this way rather than add support for a jetty-web-ee8.xml file for example? I feel that it's a lot less powerful. For example back in Jetty 9.4.x we had to ask users to do the following: https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJetty/ (and that wouldn't be possible through web.xml).

Also, imagine we needed to have different values for Jetty 10.x and Jetty 12.x. How would be able to write it? I don't know if it would be possible with jetty.xml but it seems it could, based on https://www.eclipse.org/lists/jetty-dev/msg02544.html

Last point, it's quite nice to have everything related to jetty located in a single specific file like jetty-web.xml rather than mix jetty stuff with other stuff in web.xml(it would also need additional comment to explain it).

WDYT?

Thanks a lot for working on this, really appreciated, and whatever solution you propose will be fine :)

from jetty.project.

joakime avatar joakime commented on June 15, 2024

@vmassol all good points, and as a result I no longer like that PoC with context attributes.

from jetty.project.

gregw avatar gregw commented on June 15, 2024

Generally I think that jetty-web.xml is not a great way to configure anything.... but there are certainly use-cases like this one where it is the best option.
Thus no matter what, I think we should put in a version mechanism for jetty-web[[[-X].Y].Z].xml that will discover multiple files and then use some logic to work out which ones will be run and in which order.

Meanwhile, we should also think of other better ways to do this.

from jetty.project.

janbartel avatar janbartel commented on June 15, 2024

Generally I think that jetty-web.xml is not a great way to configure anything.... but there are certainly use-cases like this one where it is the best option. Thus no matter what, I think we should put in a version mechanism for jetty-web[[[-X].Y].Z].xml that will discover multiple files and then use some logic to work out which ones will be run and in which order.

Meanwhile, we should also think of other better ways to do this.

@gregw I would suggest an algorithm that closely matches what we are already doing with jetty-web.xml, which is to find a single file to apply based on this logic:

  • we look for a jetty8-web.xml
  • if not found we look for a jetty-web.xml
  • if not found we look for a web-jetty.xml

So I would suggest we do the following for ee8/9/10 and beyond:

  • look for a jetty-web-x.y.z.xml where x.y.z matches the executing version (eg 12.0.1)
  • if not found, look for a jetty-web-x.y.xml where x.y matches the most significant digits of the executing version (eg 12.0)
  • if not found, look for a jetty-web-x.xml where x matches the most significant digit of the executing version (eg 12)
  • if not found, look for jetty-web.xml

from jetty.project.

joakime avatar joakime commented on June 15, 2024

So I would suggest we do the following for ee8/9/10 and beyond:

  • look for a jetty-web-x.y.z.xml where x.y.z matches the executing version (eg 12.0.1)
  • if not found, look for a jetty-web-x.y.xml where x.y matches the most significant digits of the executing version (eg 12.0)
  • if not found, look for a jetty-web-x.xml where x matches the most significant digit of the executing version (eg 12)
  • if not found, look for jetty-web.xml

The environment needs to be there in the name too as key classes have different names.

from jetty.project.

vmassol avatar vmassol commented on June 15, 2024

That would be awesome, thanks everyone!

from jetty.project.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.