方法壹:
方法返回值為字符串類型,可以在Controller需要使用的方法中添加HttpServletRequest ?request參數,然後在方法體中添加request.setAttribute("string", "前端需要的字符串");
return "/areas/mgt/views/process/modelList"; ?在modelList.html頁面中使用${string}即可獲取"前端需要的字符串"這個字符串
方法二:
方法返回值為ModelAndView類型,可以在Controller需要使用的方法內
[html]?view plain?copy
Map<String,String>?map=new?HashMap<String,String>();?
map.put("activityId",?activityId);?
return?new?ModelAndView("/areas/mgt/views/form/elecfg/actioncfg",map);?
在[html]?view plain?copy
actioncfg<span?style="font-family:?Arial,?Helvetica,?sans-serif;?background-color:?rgb(255,?255,?255);">.html頁面中使用${</span><span?style="font-family:?Arial,?Helvetica,?sans-serif;">activityId</span><span?style="background-color:?rgb(255,?255,?255);?font-family:?Arial,?Helvetica,?sans-serif;">}即可獲取"</span><span?style="font-family:?Arial,?Helvetica,?sans-serif;">?activityId</span><span?style="background-color:?rgb(255,?255,?255);?font-family:?Arial,?Helvetica,?sans-serif;">"這個值</span>?