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

  & 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;    

After

You can map a URL directly to a view (assuming its own ViewResolver is setup correctly) and without the need for an intermediate controller

XML config sample

  & lt; mvc: view-controller path = "/ test" view-name = "test" />   

Java config sample

  @Configuration public class extends AppConfig WebMvcConfigurerAdapter {//. @Override Public Zero addViewControllers (ViewControllerRegistry Registry) {registry.addViewController ("/ test"). SetViewName ("Test"); } // ..}    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -