您好我使用了内部资源视图解析器,我的jsp结构就像
jsp / adm,jsp / icon,jsp / iload,如
我的基于注释的控制器将根据条件返回字符串值
我的问题是jsp uder子文件夹没有重新分区但它在jsp文件夹下工作正常
任何人都可以帮助我
他是我的代码:`
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
我的控制器代码是
@RequestMapping("/icrl")
public String search() throws Exception
{
setMenuName(CommonConstants.ICRL);
return "pgiCRL";
}
@RequestMapping("/searchCodes")
public String searchCodes() throws Exception
{
String key=getSearchKey();
String query=getQuery();
Map<String, Object> searchKeys = new HashMap<String, Object>();
ArrayList<String> list=new ArrayList<String>();
if(query!=null||!query.isEmpty()){
searchKeys.put(CommonConstants.DIAGICD9, getDiaICD9());
searchKeys.put(CommonConstants.DIAGICD10, getDiaICD10());
searchKeys.put(CommonConstants.DIAGNOSIS, getDiagnosis());
searchKeys.put(CommonConstants.PROCEDURE, getProcedure());
searchKeys.put(CommonConstants.SURGICAL, getSurgical());
searchKeys.put(CommonConstants.SURGICAL9, getSurICD9());
searchKeys.put(CommonConstants.SURGICAL10, getSurICD10());
searchKeys.put(CommonConstants.REVENUE, getRevenue());
list= (ArrayList<String>) iCRLService.getSearchCodeList(query,searchKeys);
}
setSuggestions(list);
return CommonConstants.SUCCESS;
}
我的视图取决于条件,它可能是成功页面和失败页面,所以我需要修复控制器中的返回值,因为这是动态的。 提前致谢
答案 0 :(得分:6)
您需要在返回的字符串值中定义子文件夹名称。
例如,如果您的页面“pgiCRL”位于admin子文件夹中,则返回“admin / pgiCRL”。