Skip to content
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

Merged
merged 7 commits into from Apr 2, 2018
Merged

Conversation

persapiens
Copy link
Member

@persapiens persapiens commented Mar 30, 2018

fix #392

@persapiens persapiens added this to the 3.1.0 milestone Mar 30, 2018
@persapiens persapiens self-assigned this Mar 30, 2018
@ConditionalOnClass(RewriteFilter.class)
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
public class RewriteAutoConfiguration {
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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 {
Copy link
Member

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?

Copy link
Member Author

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 {
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as above.

@persapiens persapiens merged commit 81d6c99 into joinfaces:master Apr 2, 2018
@persapiens persapiens deleted the rewrite branch March 18, 2022 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite
2 participants