Re: Linking to a Portal page via an image? - Websphere

This is a discussion on Re: Linking to a Portal page via an image? - Websphere ; well, i took the example from the link and used the PrintWriter to create the link: {code} final PrintWriter writer = response.getWriter(); writer.print(" "); writer.print("HR Applications"); writer.print(""); // Invoke the JSP to render PortletRequestDispatcher rd... rd.include(request, response); {code}...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Re: Linking to a Portal page via an image?

  1. Re: Linking to a Portal page via an image?

    well, i took the example from the link and used the PrintWriter to create the link:

    {code}
    final PrintWriter writer = response.getWriter();

    writer.print(" ");
    writer.print("HR Applications");
    writer.print("");

    // Invoke the JSP to render
    PortletRequestDispatcher rd...
    rd.include(request, response);
    {code}

  2. Re: Linking to a Portal page via an image?

    try just passing the string that is generated as a request variable to the jsp to render and output it there.

    Now I looked at my code, and if you are sending in without the save state param there is no checking for null, So just use the generateurl method passing in true/false

    Or this signature

    public static String generateUrl(
    String pageName,
    String portletName,
    HashMap params,
    boolean saveState,
    PortletRequest request,
    PortletResponse response)



    The method with five params if you look at the javadoc is for targetting the action phase of the other portlet so you HAVE to pass in a portlet



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  3. Re: Linking to a Portal page via an image?

    Well Jim, that did the trick. Assigning the string as a request attribute worked a treat.

    Regarding the params, if I want to target the action, I need to include a PortletName as follows:

    {code}
    PortletURLHelper.generateURL("ibm.portal.Home", "PortletName", null, request, response);
    {code}

    If I am not targeting a portlet, I pass in six params with null for PortletName and true for the state:

    {code}
    PortletURLHelper.generateURL("ibm.portal.Home", null, null, true, request, response);
    {code}

    Thanks for all of your help with this

  4. Re: Linking to a Portal page via an image?

    correct, this method is overloaded so you have to be aware of what you want to do.

    And to be clear the portletname HAS to be the name of the portletwindow on the page which is ONLY set via xmlaccess.



    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

+ Reply to Thread