Topic
2 replies Latest Post - ‏2014-02-27T14:26:44Z by RafayMirani
RafayMirani
RafayMirani
11 Posts
ACCEPTED ANSWER

Pinned topic How to get javax.portlet.PortletRequest object in a HATS business logic

‏2014-02-26T12:55:52Z |

Hi there,

I am working on Web Express Logon using Portal Credential Vault on HATS 9.0 and WPS 8.0.0.1 CF09. Using standard JSR-168 portlet specification in my HATS project which is for testing only but it will be JSR-286 in the real project. As per the API I have to get javax.portlet.PortletRequest object in a HATS business logic, I am using following line to get it.

javax.portlet.PortletRequest portletRequest = (javax.portlet.PortletRequest) blInfo.getRequest();

but getting java.lang.ClassCastException at this line:

Caused by: java.lang.ClassCastException: com.ibm.hats.portlet.runtime.Jsr168PortletRequest incompatible with javax.portlet.PortletRequest

                at lSPO_WEL.businessLogic.Getcredentials.execute(Getcredentials.java:20)

                ... 301 more

This portletRequest must be the javax.portlet.PortletRequest as per the API. Do you think I am not getting the portletRequest object correctly? Any quick help will be highly appreciated. Thanks!

 

 

  • tmparker
    tmparker
    516 Posts
    ACCEPTED ANSWER

    Re: How to get javax.portlet.PortletRequest object in a HATS business logic

    ‏2014-02-26T18:21:26Z  in response to RafayMirani

    Can you try something like this:

    PortletRequest portletRequest = ((Jsr168PortletRequest)blInfo.getRequest()).getPortletRequest();

    Thanks
    Tim

    • RafayMirani
      RafayMirani
      11 Posts
      ACCEPTED ANSWER

      Re: How to get javax.portlet.PortletRequest object in a HATS business logic

      ‏2014-02-27T14:26:44Z  in response to tmparker

      Thanks Tim for your help. I could get the javax.portlet.PortletRequest object now and the WEL thing looks to be working as expected. Thanks again!