java - How create link which don't handling in controller? Spring framework -
After
I just want to create simple links like and (work like simple links in html) not dealing with this link controller Should do it. But springing every link handling in the controller that I do not want. I know that I can put my test.html page (beyond the folder web-INF) in certain resources and the controller is not working on this request, but I have to find a solution
After You can map a URL directly to a view (assuming its own XML config sample Java config sample
& lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; appServlet & lt; / Servlet-name & gt; & Lt; URL pattern & gt; / & Lt; / URL pattern & gt; & Lt; / Servlet-mapping & gt; & Lt ;! - Spring Security - & gt; & Lt; Filter & gt; & Lt; Filter-name & gt; SpringSecurityFilterChain & lt; / Filter-name & gt; & Lt; Filter range & gt; org.springframework.web.filter.DelegatingFilterProxy & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; SpringSecurityFilterChain & lt; / Filter-name & gt; & Lt; URL pattern & gt; / * & Lt; / URL pattern & gt; & Lt; / Filter-mapping & gt;
ViewResolver is setup correctly) and without the need for an intermediate
controller
& lt; mvc: view-controller path = "/ test" view-name = "test" />
@Configuration public class extends AppConfig WebMvcConfigurerAdapter {//. @Override Public Zero addViewControllers (ViewControllerRegistry Registry) {registry.addViewController ("/ test"). SetViewName ("Test"); } // ..}
Comments
Post a Comment