You normally don't want to burden your controller with the fact that it should redirect. So prefix your urls with 'redirect:' and remove the new RedirectView from your code.
Next to that you have quite a collection of viewnames to resolve. It might be easier to put them in a map and use the response value as the key. So something like.
Code:
<bean id="yourController" class="YourController">
<property name="viewMappings">
<map>
<entry key="RES1" value="redirect:resp1.htm"/>
<entry key="RES2" value="redirect:resp1.htm"/>
<entry key="RES3" value="redirect:resp1.htm"/>
</map>
</property>
</bean>
Then instead of all your ifs.
Code:
String viewname = viewMappings.get(resp);
if (viewname == null) {
//throw exception or set a default
}
return new ModelAndView(viewname);
Now extending the resultcodes is as easy as adding a new entry to your mapping file, no changes in your code needed.