Message Boards

setRenderParameter is deprecated in liferay CE 7.3

manoj kumar, modified 3 Years ago.

setRenderParameter is deprecated in liferay CE 7.3

New Member Posts: 5 Join Date: 4/15/21 Recent Posts

Kindly suggest the alternative method which can be used, thank you

thumbnail
Olaf Kock, modified 3 Years ago.

RE: setRenderParameter is deprecated in liferay CE 7.3

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

As this is in javax.portlet.ActionResponse, the deprecation is part of the new Portlet API 3.0, JSR 362. See the specification, or its javadoc (I found the first one here to a (new) superclass of ActionResponse)

Kevin Neibarger, modified 2 Years ago.

RE: RE: setRenderParameter is deprecated in liferay CE 7.3

Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts

Hi Olaf, I have the same question as manoj. The link posted here is broken. Maybe it's my firewall or security settings. 

I did find the following for the Portlet API 3.0, JSR 362

This doesn't make sense to me, how do we replace a "set" method with a "get" method?? I want to set the "mvcPath" parameter to my JSP. There must be a different way of doing this. I can still use it as it's simply deprecated, but when they decide to completely remove it, we are screwed. 

If there is an alternative to setting the renderParameter, let us know. 

manoj kumar, modified 2 Years ago.

RE: setRenderParameter is deprecated in liferay CE 7.3

New Member Posts: 5 Join Date: 4/15/21 Recent Posts

Hi, I am new to liferay so may i know what function should i used to achive things, which we were using liferay 7. 

    @SuppressWarnings("deprecation")
    public void addBatch(ActionRequest actionrequest, ActionResponse actionresponse) throws IOException, PortalException {
        ServiceContext serviceContext = ServiceContextFactory.getInstance(Batch.class.getName(),actionrequest);
        String name = ParamUtil.getString(actionrequest, "batchname");
        String city = ParamUtil.getString(actionrequest, "batchcity");
        long id = Long.valueOf((ParamUtil.getString(actionrequest, "groupId")));
        BatchLocalServiceUtil.create_Batch(id, name, city, serviceContext);
        actionresponse.setRenderParameter( "mvcPath", "/batch_view.jsp");
   

I am calling this addBatch from front end using action url, now i want to render to a specific page after doing some database operation, may i know how to do that

thumbnail
Olaf Kock, modified 2 Years ago.

RE: RE: setRenderParameter is deprecated in liferay CE 7.3

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

This looks like a new question, not like an answer to the question that you answered to. Consider posting a new question, because your question is not about a deprecated method - or is it?

Or if it is: Please describe your observations. The method is only deprecated, not removed. I'd expect it to still work. Worst case, you can also revert to portlet spec 2.0, JSR-286

Ravinder karnati, modified 2 Years ago.

RE: setRenderParameter is deprecated in liferay CE 7.3

New Member Posts: 7 Join Date: 9/20/17 Recent Posts

Hi Manoi,

You can do it in following way

response.getRenderParameters().setValue("mvcPath", "view.jsp");

response.getRenderParameters().setValue("param name", "param value");