当前位置: 首页>>代码示例>>Java>>正文


Java RenderRequest.setAttribute方法代码示例

本文整理汇总了Java中javax.portlet.RenderRequest.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java RenderRequest.setAttribute方法的具体用法?Java RenderRequest.setAttribute怎么用?Java RenderRequest.setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.portlet.RenderRequest的用法示例。


在下文中一共展示了RenderRequest.setAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

    _log.info("render()");

    try {
        TaskRecord taskRecord = ActionUtil.getTaskRecord(renderRequest);

        renderRequest.setAttribute(TimetrackerWebKeys.TASK_RECORD, taskRecord);
    } catch (Exception e) {
        if (e instanceof NoSuchTaskRecordException || e instanceof PrincipalException) {

            SessionErrors.add(renderRequest, e.getClass());

            return "/error.jsp";

        } else {
            throw new PortletException(e);
        }
    }

    return getPath();
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:24,代码来源:GetTaskRecordMVCRenderCommand.java

示例2: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

    _log.info("render()");

    try {
        Contact contact = ActionUtil.getContact(renderRequest);

        renderRequest.setAttribute(ContactManagerWebKeys.CONTACT, contact);
    } catch (Exception e) {
        if (e instanceof NoSuchContactException || e instanceof PrincipalException) {

            SessionErrors.add(renderRequest, e.getClass());

            return "/error.jsp";

        } else {
            throw new PortletException(e);
        }
    }

    return getPath();
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:24,代码来源:GetContactMVCRenderCommand.java

示例3: renderFromMobilink

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
private void renderFromMobilink(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	renderFrontendWebEmployeePortlet(renderRequest, renderResponse);
	renderFrontendWebJobposPortlet(renderRequest, renderResponse);
	renderFrontendWebAdminPortlet(renderRequest, renderResponse);
	renderFrontendWebWorkingUnitPortlet(renderRequest, renderResponse);
	renderFrontendWebNotificationPortlet(renderRequest, renderResponse);

	renderRequest.setAttribute(
		"url", generateURLCommon(renderRequest, renderResponse));

	renderRequest.setAttribute("constants", generalConstantsCommon(renderRequest));

	renderRequest.setAttribute("param", generalParamsCommon(renderRequest));
}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:18,代码来源:AdminPortlet.java

示例4: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

	// Get Mode
	String mode = ParamUtil.getString(
		renderRequest,
		LDFPortletKeys.MODE,
		LDFPortletKeys.MODE_ORGANIZAION);

	// Carry around mode
	renderRequest.setAttribute(LDFPortletKeys.MODE, mode);
	
	if(_log.isDebugEnabled()) {
		_log.debug("mode <" + mode + ">");
		_log.debug("jsp  <" + _commonUtil
		.getPageFromMode()
		.getOrDefault(mode, LDFPortletKeys.JSP_ORGANIZAION) + ">");
	}

	return _commonUtil
			.getPageFromMode()
			.getOrDefault(mode, LDFPortletKeys.JSP_ORGANIZAION);
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:24,代码来源:CommonMVCRenderCommand.java

示例5: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

    _log.info("render()");

    try {
        Measurement measurement = ActionUtil.getMeasurement(renderRequest);

        renderRequest.setAttribute(DataManagerWebKeys.MEASUREMENT, measurement);
    } catch (Exception e) {
        if (e instanceof NoSuchMeasurementException || e instanceof PrincipalException) {

            SessionErrors.add(renderRequest, e.getClass());

            return "/error.jsp";

        } else {
            throw new PortletException(e);
        }
    }

    return getPath();
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:24,代码来源:GetMeasurementMVCRenderCommand.java

示例6: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL dossierInfoURL = PortletURLFactoryUtil.create(
		renderRequest, portletId, themeDisplay.getPlid(),
		PortletRequest.RENDER_PHASE);

	dossierInfoURL.setPortletMode(PortletMode.VIEW);
	dossierInfoURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	dossierInfoURL.setParameter(
		"mvcPath", "/templates/lookup_dossier/dossierinfo.ftl");

	urlObject.put("dossierinfo", dossierInfoURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put(
		"portletNamespace",
		themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:LookupDossierResult.java

示例7: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL registerResultURL = PortletURLFactoryUtil.create(
		renderRequest, portletId, themeDisplay.getPlid(),
		PortletRequest.RENDER_PHASE);

	registerResultURL.setPortletMode(PortletMode.VIEW);
	registerResultURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	registerResultURL.setParameter(
		"mvcPath", "/templates/applicant/register_result.ftl");

	urlObject.put("register_result", registerResultURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put(
		"portletNamespace",
		themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:RegisterPorltet.java

示例8: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL confirmPasswordURL = PortletURLFactoryUtil.create(
		renderRequest, portletId, themeDisplay.getPlid(),
		PortletRequest.RENDER_PHASE);

	confirmPasswordURL.setPortletMode(PortletMode.VIEW);
	confirmPasswordURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	confirmPasswordURL.setParameter(
		"mvcPath", "/templates/applicant/confirm_password.ftl");

	urlObject.put("confirm_password", confirmPasswordURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put(
		"portletNamespace",
		themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:ForgottenAccount.java

示例9: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL serviceInfoLookupURL = PortletURLFactoryUtil.create(
		renderRequest, portletId, themeDisplay.getPlid(),
		PortletRequest.RENDER_PHASE);

	serviceInfoLookupURL.setPortletMode(PortletMode.VIEW);
	serviceInfoLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	serviceInfoLookupURL.setParameter(
		"mvcPath", "/templates/homepage/serviceinfo_lookup.ftl");

	urlObject.put("serviceinfo_lookup", serviceInfoLookupURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put(
		"portletNamespace",
		themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:ServiceInfoLookup.java

示例10: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
	RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	ThemeDisplay themeDisplay =
		(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL dossierLookupURL = PortletURLFactoryUtil.create(
		renderRequest, portletId, themeDisplay.getPlid(),
		PortletRequest.RENDER_PHASE);

	dossierLookupURL.setPortletMode(PortletMode.VIEW);
	dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	dossierLookupURL.setParameter(
		"mvcPath", "/templates/homepage/dossier_lookup.ftl");

	urlObject.put("dossier_lookup", dossierLookupURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put(
		"portletNamespace",
		themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:39,代码来源:DossierLookup.java

示例11: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
		throws IOException, PortletException {

	ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
			PortletRequest.RENDER_PHASE);

	dossierLookupURL.setPortletMode(PortletMode.VIEW);
	dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	dossierLookupURL.setParameter("mvcPath", "/templates/homepage/search_serviceinfo.ftl");

	urlObject.put("dossier_lookup", dossierLookupURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:32,代码来源:ServiceSearchPortlet.java

示例12: render

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
		throws IOException, PortletException {

	ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
	String portletId = portletDisplay.getId();

	JSONObject urlObject = JSONFactoryUtil.createJSONObject();
	JSONObject apiObject = JSONFactoryUtil.createJSONObject();

	// url
	PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
			PortletRequest.RENDER_PHASE);

	dossierLookupURL.setPortletMode(PortletMode.VIEW);
	dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
	dossierLookupURL.setParameter("mvcPath", "/templates/homepage/dossier_lookup.ftl");

	urlObject.put("dossier_lookup", dossierLookupURL.toString());

	// api
	apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
	apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());

	// set varible
	renderRequest.setAttribute("ajax", urlObject);
	renderRequest.setAttribute("api", apiObject);

	super.render(renderRequest, renderResponse);

}
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:33,代码来源:DossierLookupPortlet.java

示例13: doView

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void doView(RenderRequest renderRequest, RenderResponse renderResponse)
    throws IOException, PortletException {

    renderRequest.setAttribute(DummyFactoryConfiguration.class.getName(), _dummyFactoryConfiguration);

    super.doView(renderRequest, renderResponse);
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:9,代码来源:LiferayDummyFactoryPortlet.java

示例14: doDispatch

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
protected void doDispatch(
		RenderRequest renderRequest, RenderResponse renderResponse)
	throws IOException, PortletException {

	renderRequest.setAttribute(DummyFactoryConfiguration.class.getName(), _dummyFactoryConfiguration);

	super.doDispatch(renderRequest, renderResponse);
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:10,代码来源:LiferayDummyFactoryPortlet.java

示例15: preHandleRender

import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler)
	throws PortletException {
	if (request.getAttribute("test2-remove-never") != null) {
		throw new PortletException("Wrong interceptor order");
	}
	request.setAttribute("test1-remove-never", "test1-remove-never");
	request.setAttribute("test1-remove-post", "test1-remove-post");
	request.setAttribute("test1-remove-after", "test1-remove-after");
	return true;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:12,代码来源:ComplexPortletApplicationContext.java


注:本文中的javax.portlet.RenderRequest.setAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。