Search code examples
jspstrutsweblogicportlet

How to change ContentURI in Weblogic Portlet?


I am developing an application which uses Weblogic portlets and Struts. All I need to do is to load different jsp's in the same portlet based on the web browser that client is using.

For eg: If I have a portlet called home.portlet. If the user is using IE it should display IE.jsp in the home.portlet, if he is using firefox I should display firefox.jsp in home.portlet.

This is what I have in home.portlet:

<netuix:content>
        <netuix:jspContent contentUri="IE.jsp"/>
    </netuix:content>


 //in struts config file
 <forward name="firefox" path="/firefox.jsp>

This is what I did to achieve it- In homeAction.java:

if(firefox)
return mapping.findForward("firefox");

So even if the user is using firefox it is displaying IE.jsp. How can we change the jsp content in the portlet from the Struts Action Class so that I can check the kind of the browser the user is using and display the page accordingly??

All help and suggestions appreciated.

Thanks,

-Sai


Solution

  • My portlets wern't configured for struts. I changed that now, and its working fine.

    EG:

    <netuix:strutsContent action="getStudentList" module = "people/students"
      refreshAction = "getStudentList" reqestAttrpersistence="none"/>
    

    And then in the action class I am checking for the browser and displaying the appropriate jsp