Closed Frank0321 closed 1 year ago
To provide some context:
"Jakarta EE 9 a new top-level jakarta package, replacing EE 8's javax top-level package. For example, the Servlet specification in Jakarta EE 8 uses a javax.servlet package but this has changed to jakarta.servlet in EE 9."
"Generally speaking, it's not possible to mix Java EE and Jakarta EE APIs in the same project. You need to ensure that your own code, as well as all third-party libraries are using jakarta.* package imports."
https://spring.io/blog/2022/05/24/preparing-for-spring-boot-3-0
This implies the need for a version of SiteMesh that is updated to use jakarta instead of javax (I think).
I took a copy to experiment with and was able to change the javax. to jakarta.. The new jar seems to work well with SpringBoot3.
I was not able to get the tests working. I don't fully understand Jetty etc. But happy to share what I have done if anyone is interested.
Here is a full working example with Spring Boot 3.1.1:
https://github.com/sitemesh/sitemesh3/tree/jakarta/sitemesh-examples-springboot
spring boot 3.x must be to use java 17 In java 17, almost javax is replace by jakarta like javax.servlet.Filter is replace to javax.servlet.Filter
when I extend ConfigurableSiteMeshFilter to setting decorator
and implements WebMvcConfigurer
it show me error
The method setFilter(Filter) in the type FilterRegistrationBean is not applicable for the arguments (WebSiteMeshFilter)
that is because setFilter is use jakarta.servlet.Filter but ConfigurableSiteMeshFilter is implements Filter (javax.servlet.Filter)
I try use cast to let
javax.servlet.Filter
to bejakarta.servlet.Filter
but when run this project, it show meConfigurableSiteMeshFilter cannot be cast to class jakarta.servlet.Filter
how can I do to fix this question ?