New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite Spring Boot Starter #436
Conversation
missing tests.
@ConditionalOnClass(RewriteFilter.class) | ||
@AutoConfigureAfter(WebMvcAutoConfiguration.class) | ||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) | ||
public class RewriteAutoConfiguration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The listeners and filters here will collide with rewrite-servlet-3.4.2.Final.jar!/META-INF/web-fragment.xml
when used with war-deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Do you know how to detect war-deployment to avoid it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this in e9f563b
When deploying the application as war file to an existing container, the existing container will read the web-fragment.xml
. When using and embedded servlet container, the WebServerFactoryCustomizer
will do the same as the web-fragment.xml
-file
* | ||
* @author Marcelo Fernandes | ||
*/ | ||
public class SpringBootServiceLocator implements ServiceLocator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does org.ocpsoft.rewrite.spring.SpringServiceLocator
not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class uses ContextLoader.getCurrentWebApplicationContext()
and it does not work with spring boot apps.
SpringBootServiceLocator
solution uses a static field. It is not the best option to solve this problem, but it works for the moment. I think we could talk to rewrite guys and learn how to integrate better.
* | ||
* @author Marcelo Fernandes | ||
*/ | ||
public class SpringBootBeanNameResolver implements BeanNameResolver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does org.ocpsoft.rewrite.spring.SpringServiceLocator
not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as above.
fix #392