java - Spring MVC configuration question -


I have a basic Java EE Spring (MVC) application setup that displays the home page with dynamic content. I'm totally new to this and am confused to move on to this point and add more pages to my application. Do I need to create a new controller for each URL on my site? Now I have the following mapping in my ..- servlet.xml file:

  Bean square = "org.springframework.web.servlet.handler. SimpleUrlHandlerMapping" Gt; & Lt; Property Name = "Mapping" & gt; & Lt; Price & gt; /index.html=homeController & lt; / Value & gt; & Lt; / Property & gt; & Lt; / Bean & gt;  

So if I have a new page now / login, will I add mapping to /login/index.html? I am more confused because I am trying to integrate spring-safety to handle the login page ...

I take a look at the annotated controllers:

Example: < / P>

  @ Controller Public Class Test Controller {@RequestMapping (Value = "/ Login / Index") Public String Login () {Return "Login"; } @RequestMapping (value = "/ someelse / index.html") public string login () {return "something" "}}  

When you set up your scene resolver, Then the returned strings will correspond to a lexical page, i.e. something can be directed to / jsp / somethingelse.jsp if you have set up the resolver in your spring configuration ... you need to scan annotations for auto strings

In the same way, to the extent that spring safety is But it does not make sense to do this with Spring MVC. If you are done correctly, then only you need to provide the only resource to configure security, it is a simple login page, Configure this security example:


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -