Java Code Examples for org.springframework.ui.ModelMap#putAll()

The following examples show how to use org.springframework.ui.ModelMap#putAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SearchAct.java    From Lottery with GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping(value = "/search*.jspx", method = RequestMethod.GET)
public String index(HttpServletRequest request,
		HttpServletResponse response, ModelMap model) {
	CmsSite site = CmsUtils.getSite(request);
	// 将request中所有参数保存至model中。
	model.putAll(RequestUtils.getQueryParams(request));
	FrontUtils.frontData(request, model, site);
	FrontUtils.frontPageData(request, model);
	String q = RequestUtils.getQueryParam(request, "q");
	String parseQ=parseKeywords(q);
	model.addAttribute("input",q);
	model.addAttribute("q",parseQ);
	String channelId = RequestUtils.getQueryParam(request, "channelId");
	if (StringUtils.isBlank(q) && StringUtils.isBlank(channelId)) {
		return FrontUtils.getTplPath(request, site.getSolutionPath(),
				TPLDIR_SPECIAL, SEARCH_INPUT);
	} else {
		return FrontUtils.getTplPath(request, site.getSolutionPath(),
				TPLDIR_SPECIAL, SEARCH_RESULT);
	}
}
 
Example 2
Source File: SearchAct.java    From Lottery with GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping(value = "/searchJob*.jspx", method = RequestMethod.GET)
public String searchJob(HttpServletRequest request,
		HttpServletResponse response, ModelMap model) {
	CmsSite site = CmsUtils.getSite(request);
	String q = RequestUtils.getQueryParam(request, "q");
	String category = RequestUtils.getQueryParam(request, "category");
	String workplace = RequestUtils.getQueryParam(request, "workplace");
	model.putAll(RequestUtils.getQueryParams(request));
	FrontUtils.frontData(request, model, site);
	FrontUtils.frontPageData(request, model);
	//处理lucene查询字符串中的关键字
	String parseQ=parseKeywords(q);
	model.addAttribute("input",q);
	model.addAttribute("q",parseQ);
	model.addAttribute("queryCategory",category);
	model.addAttribute("queryWorkplace",workplace);
	if (StringUtils.isBlank(q)) {
		model.remove("q");
	}
	return FrontUtils.getTplPath(request, site.getSolutionPath(),
			TPLDIR_SPECIAL, SEARCH_JOB);
}
 
Example 3
Source File: CommentAct.java    From Lottery with GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping(value = "/comment*.jspx", method = RequestMethod.GET)
public String page(Integer contentId, Integer pageNo,
		HttpServletRequest request, HttpServletResponse response,
		ModelMap model) {
	CmsSite site = CmsUtils.getSite(request);
	Content content = contentMng.findById(contentId);
	if (content == null) {
		return FrontUtils.showMessage(request, model,
				"comment.contentNotFound");
	}
	if (content.getChannel().getCommentControl() == ChannelExt.COMMENT_OFF) {
		return FrontUtils.showMessage(request, model, "comment.closed");
	}
	// 将request中所有参数保存至model中。
	model.putAll(RequestUtils.getQueryParams(request));
	FrontUtils.frontData(request, model, site);
	FrontUtils.frontPageData(request, model);
	model.addAttribute("content", content);
	return FrontUtils.getTplPath(request, site.getSolutionPath(),
			TPLDIR_SPECIAL, COMMENT_PAGE);
}
 
Example 4
Source File: CsiCustomAct.java    From Lottery with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 解析至自定义模板页
 * 
 * @param tpl
 *            自定义模板名称
 * @param request
 * @param response
 * @param model
 * @return
 */
@RequestMapping(value = "/csi_custom.jspx")
public String custom(String tpl, HttpServletRequest request,
		HttpServletResponse response, ModelMap model) {
	log.debug("visit csi custom template: {}", tpl);
	CmsSite site = CmsUtils.getSite(request);
	// 将request中所有参数保存至model中。
	model.putAll(RequestUtils.getQueryParams(request));
	FrontUtils.frontData(request, model, site);
	return FrontUtils.getTplPath(site.getSolutionPath(), TPLDIR_CSI_CUSTOM,
			tpl);
}
 
Example 5
Source File: LoginAct.java    From Lottery with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 客户端包含
 * 
 * @param request
 * @param model
 * @return
 */
@RequestMapping(value = "/login_csi.jspx")
public String csi(HttpServletRequest request, ModelMap model) {
	CmsSite site = CmsUtils.getSite(request);
	// 将request中所有参数
	model.putAll(RequestUtils.getQueryParams(request));
	FrontUtils.frontData(request, model, site);
	return FrontUtils.getTplPath(request, site.getSolutionPath(),
			TPLDIR_CSI, LOGIN_CSI);
}
 
Example 6
Source File: BaseController.java    From molicode with Apache License 2.0 4 votes vote down vote up
public void toVm(CommonResult result, ModelMap context, HttpServletRequest request) {
    context.putAll(result.getReturnMap());
}