@RemoteMethod public String findLike(String firmName) throws IOException, ServletException { WebContext webContext = WebContextFactory.get(); HttpSession httpSession = webContext.getHttpServletRequest().getSession(false); if ((httpSession == null) || (httpSession.getAttribute("userId") == null)) { return ""; } String firmNameInLowerCase = firmName.toLowerCase(); List<EntitySection> sections = EntityManager.listByName("sections.all", new Object[0]); List firms = new ArrayList(); for (EntitySection section : sections) { for (EntityFirm firm : section.getFirms()) { if (firm.getName().toLowerCase().contains(firmNameInLowerCase)) { firms.add(firm); } } } webContext.getHttpServletRequest().setAttribute("firms", firms); return webContext.forwardToString("/security/likefirms.jsp"); }
/** * DWR函数--返回列表页面的字符串 * * @param form * @return * @throws Exception */ public String getSysParameterConfList(SysParameterConfActionForm form) throws Exception { SysParameterConfExample ex = new SysParameterConfExample(); List list = this.sysParameterConfService.selectByExample(ex); WebContext wctx = WebContextFactory.get(); HttpServletRequest request = wctx.getHttpServletRequest(); request.setAttribute("parameterList", list); return wctx.forwardToString("/jsp/sys/par/sysParameterConfList.jsp"); }