package com.smtservlet.control; import java.util.Map.Entry; import org.springframework.stereotype.Controller; import org.springframework.web.servlet.ModelAndView; import com.smtservlet.core.SMTRequest; import com.smtservlet.util.Json; /** * SMT内置公共处理类 */ @Controller public class SMTPublicControl { public ModelAndView responseJsp(SMTRequest tranReq) throws Exception { Json requestJson = tranReq.getRequestJson(); Json jsonRequestAttrs; if((jsonRequestAttrs = requestJson.safeGetJson("request_attrs")) != null) { for(Entry entry : jsonRequestAttrs.asJsonMap().entrySet()) { tranReq.setRequestAttribute(entry.getKey(), entry.getValue().getValue().toString()); } } String jspName = requestJson.getJson("jsp_name").asString(); return tranReq.returnView(jspName); } }