Does Mule supports Spring MVC? - spring-mvc

I have web app which is already developed based on Spring MVC. I need to re-implement that web app in Mule.
Can I develop the mule application based on Spring MVC?
Can I declare the Spring MVC dispatcher servlet inside a mule's servlet endpoint and take things further from there?
The web app has web.xml where it defines the DispatcherServlet, the contextparams, the listener classes and so on. How can we remodel that in a mule application?
Any examples where a mule application is developed based on SpringMVC would be great.

Thanks to its embedded Jetty container, you can deploy any JavaEE web application in Mule. So there's no need to remodel anything.
The "Boosktore" example application demonstrates running web-apps within Mule: https://github.com/mulesoft/mule/tree/mule-3.x/examples/bookstore

Mule ESB is not an MVC Framework. It is developed using enterprise integration patterns in mind.
Please go through this blog, to know when to use ESB.

spring mvc can be integrated with mule.
Define all your spring related configuration in separate xml file and include it in mule configuration file.
You can write your custom transformers ,in the custom transformations you can inject or do an autowire of your service classes and from service object you can interact with dao layers.

Related

Liferay 7 + Spring MVC + JAX-RS

Hello StackOverflow Community,
Background:
I have a Spring MVC portlet project. I want to provide a JAX-RS web service on a class. I came across the below guides to understand rest services in Liferay,
Liferay documentation
Surekha Technology blog - creates a project using rest template. I've created a project using spring-mvc template
I'm using maven and creating a WAR package
Attempted:
Configuring Endpoints and Extenders with the Control Panel, as described in Liferay documentation
Annotated the class with #ApplicationPath, #Component. Annotated the method with #GET, #Path, #Produces; as described in Liferay documentation
Deployed the WAR
Issue:
When I invoke the url - http://server:port/o/context-path/app-path/ I get the message in the browser 'No services have been found.' What am I missing here?
You can use rest module of liferay to develop rest api.
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/jax-rs

Using spring saml without other spring frameworks

Is it possible to use the Spring Security SAML extension without using other Spring libraries and projects?
I am trying to using Spring SAML libraries in an existing project written in pure Java. I do not intend to use Spring MVC and other libraries. Do I still have to use the securityContext.xml , ContextLoaderListener and DelegatingFilterProxy referenced in web.xml?
Spring SAML security extension relies on the Spring IoC container. You don't need Spring MVC.

How can I add webflow using Spring Boot and Thymeleaf?

I have written a Spring web app for baseball umpires using Spring Boot and Thymeleaf. I like Spring Boot because it resolves dependency w/o a lot of configuration. Now I want to add Sprng WebFlow so umpires can order uniforms, a typical "shopping cart" application. There are many examples on the web but none using Spring Boot. They all are the traditional xml config with jsp and jstl. Has anyone used Spring Boot and WebFlow? There are WebFlow examples on the official Spring web site but very complicated. Thanks Rob
Spring Roo 2.0.0.M3 generates Spring Boot applications and integrates Spring Web Flow easier than ever.
The reference guide includes detailed descriptions of all the features, plus an extensive user guide for main use cases.

Spring MVC transparent resource proxy

I'm looking for a solution which allows me to proxy specific requests from my Spring MVC webapp to an another HTTP server while running in development profile. What i'm trying to achieve is to make Dart's Pub serve the web application files on it's own HTTP port, but map this path into my Spring MVC application so the Spring provided REST resources and the Dart files will be served from the Spring MVC HTTP server from the browser's perspective of view. In a release configuration these files will be bundled into the war so the proxy will be not required.
I wonder if this is supported by any built in MVC element in Spring (eg. the mvc:resource) or i have to write my own proxy element for this?
It can be done using a special Controller which's bean can be assigned to a profile and included in the dispatcher context scope only in development time.

Oauth in spring web mvc project

I need to add oauth security to spring mvc project.
The project have basic security that implement org.springframework.web.filter.DelegatingFilterProxy
with CustomAuthenticationProvider and i need to replace it with oauth2 .
is there a simple way to do it ?
Thanks.
We have done the same in one of our applications using Spring 4 and Java 8. The application is open source and you can read about the security layer here https://techdev.io/en/developer-blog/using-spring-and-oauth-in-trackr

Resources