LOT-959 Free Dumps Study Materials
Question 10: What is the output of the following code? public PreferencePortlet extends GenericPortlet{ protected
void processAction(ActionRequest actionRequest,
ActionResponse){ actionRequest.getPreferences().setValue(test iewModePreferenceValue);
actionRequest.getPreferences().store(); } protected void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws PortletException, IOException { // Generate action URL }
Please note that PreferencePortlet is a Portlet Specification 2.0 compliant and running in WPS 6.1.
A.The container will throw java.lang.IllegalStateException because it is not allowed to change preference
in the processAction() method.
B.The code will compile and execute fine. It will store test preference at the end of the processAction()
method call.
C.The container will throw java.lang.IllegalStateException because it is not allowed to change preference
in the view mode.
D.This will result in compiler error because PortletPreference does not have store() method.
Correct Answer:B