reset password
Author Message
dguhath
Posts: 61
Posted 16:50 Feb 27, 2015 |

Hello Dr Sun,

In CSNS the /login url (the custom login mentioned in spring login-page="/login") is not mapped to any controller method. So is spring security directly redirecting the /login calls to login.jsp? Is dispatcher servlet involved somewhere in the process?

Thanks.

cysun
Posts: 2935
Posted 18:43 Feb 27, 2015 |

The controller for that is actually specified in csns-servlet.xml: <mvc:view-controller>. It's basically a Spring provided controller that does nothing other than just forwarding the requests to a view.

dguhath
Posts: 61
Posted 23:06 Feb 27, 2015 |

Thanks Dr. Sun. i tried using the <mvc:view-controller> but i am actually getting a 404. 

cysun
Posts: 2935
Posted 09:01 Feb 28, 2015 |

The path attribute is the URL mapping, and the view-name attribute is a view name (i.e. not a path to a JSP).
 

dguhath
Posts: 61
Posted 11:49 Feb 28, 2015 |

Thanks Dr. Sun. Please correct me if i am wrong. Spring framework should take care of resolving this view name to an actual jsp file. And we don't need any other configuration.

cysun
Posts: 2935
Posted 12:33 Feb 28, 2015 |
dguhath wrote:

Thanks Dr. Sun. Please correct me if i am wrong. Spring framework should take care of resolving this view name to an actual jsp file. And we don't need any other configuration.

Right. It's basically a generic controller that you can easily write yourself if you want. The controller has a "viewName" property that needs to be set, and all the controller method does is "return viewName;".