The thing is i want to use spring mvc 4.1 features . Like it supports the return of string instead of MVC.But i when i return "logon" it doesn't load home page.
This is not a new feature introduced in 4.x. It was available even in
2.5 using InternalResourceViewResolver, and likely in even earlier versions.
Anyway, what you need is an InternalResourceViewResolver bean. It resolves a string like "logon" to a web application view resource like 'WEB-INF/views/logon.jsp'.
Use InternalResourceViewResolver only if your view resources conform to this convention. Otherwise,
you should use one or more of the other view resolvers, and chain them.
I recommend reading up all the sections related to view resolvers
starting here.
From the discussion so far, I felt that you are not sure
why you are upgrading to 4.1. If there is no definite goal and your existing code is all working fine with 2.5, then I suggest keeping as much of your code unchanged - which should be doable, since spring has maintained good backward compatibility over versions - and solve only problems that may come up. Moving entire codebase wholesale to annotation based or something like that will probably not add any value to your business or your customers.