當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。