Topic
  • 5 replies
  • Latest Post - ‏2013-02-23T08:44:31Z by SystemAdmin
the.techie007
the.techie007
11 Posts

Pinned topic Obtaining webclientsession in custom JSP file

‏2012-08-17T11:40:54Z |
Champs,

I am working with MAM 7.5 (Nuc), App Server WebSphere 7 Oracle 11g at the backend.

I have a custom link on the "Attach New Webpage" dialog box of Maximo Attachment functionality, when I click on the the link it calls a custom JSP file and it should display the Application and current MBOSET name.

What did I do so far?

I included ../webclient/common/componentheader.jsp file in my custom JSP usinc <include> tag. This file has a WebClientSession variable, I used that variable to get the current app instance and

AppInstance curApp = wcs.getCurrentApp();
MboRemote mbo = curApp.getAppBean().getMbo();
System.out.println("Application name : " + mbo);
MboSetRemote mboSet = mbo.getMboSet("DOCLINKS");

This worked well with MAM 7.5.0.0, My bad luck now I have applied fixpack MAM 7.5.0.3 and the same code gives internal server error. I investigated it but no clue why this error is coming.

I could include other file and it works well I am able to access their variables but I want webclient session variable and is present in this file only.

Please suggest if you have any other idea to achieve this.... :-(

-Techie
Updated on 2013-02-23T08:44:31Z at 2013-02-23T08:44:31Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Obtaining webclientsession in custom JSP file

    ‏2013-02-12T10:02:11Z  
    I am having the exact same problem, were you able to fix it?

    when i include the component header and footer it generates a null pointer

    please reply ASAP
  • maxmix
    maxmix
    83 Posts

    Re: Obtaining webclientsession in custom JSP file

    ‏2013-02-15T12:48:29Z  
    where exactly does your code error out?
    MXSession mysession=(MXSession)request.getSession().getAttribute("MXSession");
    worked for me so far, though I am not on 7.5.0.3 yet...

    So we could help each other, could you please check if that works?
    Though I do not need the current app name...
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Obtaining webclientsession in custom JSP file

    ‏2013-02-18T11:18:49Z  
    • maxmix
    • ‏2013-02-15T12:48:29Z
    where exactly does your code error out?
    MXSession mysession=(MXSession)request.getSession().getAttribute("MXSession");
    worked for me so far, though I am not on 7.5.0.3 yet...

    So we could help each other, could you please check if that works?
    Though I do not need the current app name...
    my code is the following

    WebClientSessionManager wcsm = WebClientSessionManager.getWebClientSessionManager(session);
    WebClientSession wcs = wcsm.getWebClientSession(request);
    AssetAppBean assetO= (AssetAppBean)wcs.getCurrentApp().getAppBean();

    it doesn't work on first time, however when i press f5 it works :s

    its confusing me its not getting the session directly
  • maxmix
    maxmix
    83 Posts

    Re: Obtaining webclientsession in custom JSP file

    ‏2013-02-20T10:24:18Z  
    my code is the following

    WebClientSessionManager wcsm = WebClientSessionManager.getWebClientSessionManager(session);
    WebClientSession wcs = wcsm.getWebClientSession(request);
    AssetAppBean assetO= (AssetAppBean)wcs.getCurrentApp().getAppBean();

    it doesn't work on first time, however when i press f5 it works :s

    its confusing me its not getting the session directly
    hm that sounds like a session handover issue into a separate tab or so.
    How do you reach your page, what was in the browser tab before?
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Obtaining webclientsession in custom JSP file

    ‏2013-02-23T08:44:31Z  
    ComponentInstance tempComponent = (ComponentInstance)session.getAttribute("currentcomponent");
    WebClientSession wcs = tempComponent.getWebClientSession();

    voila! solution :)

    regards