I am using spring MVC and want to send request from React.js but CORS problem. how i can enable it in spring mvc using ApplicationContext.xml?
i have added this these lines in applicationcontext.xml file but failed to build and run the application
<mvc:cors>
<mvc:mapping path="/**" />
</mvc:cors>
i want to allow the react.js send request and cors is working properly in spring mvc when i build the file it give error can not build.where i am doing wrong i want to solve it using xml file not by java class
2
Answers
Configure this in ApplicationContext.xml
replace http://localhost:8081 fro where your client application is making requests.
Add this is package com.your_packge_name and replace MyAppConfig with actual name