Hey there,
In the control panel under portal seetings -> authentication -> cas i made some configuration.
In a custom portlet i need to have access to these preferences I made in the control panel. I tried following code:
1
2import java.io.IOException;
3import javax.portlet.PortletException;
4import javax.portlet.RenderRequest;
5import javax.portlet.RenderResponse;
6import com.liferay.util.bridges.mvc.MVCPortlet;
7import com.liferay.portal.kernel.util.PrefsPropsUtil;
8
9public class eClinicalLogin extends MVCPortlet {
10 @Override
11 public void doView(RenderRequest renderRequest,
12 RenderResponse renderResponse) throws IOException, PortletException {
13
14 try {
15 renderRequest.setAttribute("casServerUrl", PrefsPropsUtil.getString("cas.server.url"));
16 renderRequest.setAttribute("casServiceUrl", PrefsPropsUtil.getString("cas.service.url"));
17 } catch (Exception e) {
18 // TODO Auto-generated catch block
19 e.printStackTrace();
20 }
21
22 super.doView(renderRequest, renderResponse);
23 }
24
25}
This code returns the default values of the properties instead of my configured preferences. Does anyone know how to get my customized values?
Please sign in to flag this as inappropriate.