Passing request parameter to the JSR 168 portal jsp

Discussions

Web tier: servlets, JSP, Web frameworks: Passing request parameter to the JSR 168 portal jsp

  1. I am trying to accomplish a very simple task: I have a regular non-portal J2EE web application that needs to invoke a JSP page residing on the JSR 168 portal with one String parameter. I am using IBM Websphere Portal server. Basically, I want to call this kind of URL: http://myportal/UserFriendly?name=Blah so I can extract the value of the name parameter in my JSR 168 portal jsp page. But when I add the parameter to the URL, the portal does even recognize the URL anymore and does not invoke the right page (gives me "page not found" error). How can accomplish that task? Any help would be appreciated. Thanks!
  2. Hi Lenny, So, are you creating a page on an app that, when you click on it, is supposed to take you to a page on the Websphere portal? I don't work with Websphere portal (I use Vignette) but I have developed JSR-168 portlets. I think there may be two things that you are running into. If you want to display the portal page within the context of the portal page, you will want to invoke the page url and not your JSR app directly. If you are doing that, then that is good, but it sounds like something is missing there because of the page not found. I don't know if I can help you with that since I'm not familiar with Websphere. For the parameter, I think I can help there. Since portal pages typically contain many portlets, you cannot simply pass a parameter to a page and expect the portlets to understand it since the assumption is that you don't want to use that request parameter in every portlet (this changes in JSR-286). Instead, portlets utilize something called namespaces that is a generated value that the portal server generates for each portlet. So, instead of ?name=Blah the portal server will need to pass a value like ?lkjlwtior0ru3rjofw9wfekj_name=Blah. All parameters for that portlet will have that same namespace. In JSR development, that value is generated by using the tag. There is also a programmatic way to do that as well but it escapes me right now. Other than manually looking at your url from the portal side, I'm not sure how you will obtain that namespace, but that's what you need to send to the portal server to pass to that portlet. Hope that helps, Eric
  3. Thanks Eric. I would love to know how can I pass that one String parameter to the portal JSP when the request is coming from the non-portal J2EE application. Is it possible at all, or am I trying to solve a problem that has no solution?
  4. Hello Eric, I am a Vignette Developer as well. I have a question for you. you said "If you want to display the portal page within the context of the portal page, you will want to invoke the page url and not your JSR app directly". May you please explain more on how to use the Page URL thing. I am facing a problem that the vgnextoid that was originally in the request disappears when actions like "submitting a form" takes place within the JSR168 portal application. This leads to redirecting to a totally different page which is the default home page of my website. I am using Vignette Portal V7.3. Your response is highly appreciated. Thanks, Regards
  5. Hello Eric, I am a Vignette Developer as well. I have a question for you. you said "If you want to display the portal page within the context of the portal page, you will want to invoke the page url and not your JSR app directly". May you please explain more on how to use the Page URL thing. I am facing a problem that the vgnextoid that was originally in the request disappears when actions like "submitting a form" takes place within the JSR168 portal application. This leads to redirecting to a totally different page which is the default home page of my website. I am using Vignette Portal V7.3. Your response is highly appreciated. Thanks, Regards
  6. Hi Lenny, You cannot access request parameters directly in a jsr168 portlet. You have to use a regular jsp page bundled in wps.war to convert the request parameters to render paramaters. There is an article on developerWorks that demonstrates this. The url is http://www-128.ibm.com/developerworks/websphere/library/techarticles/0508_scott/0508_scott.html Vishal
  7. It is true you can't access the input parameter directly. However, you CAN do this without leveraging vendor specific apis. I wrote and deployed a servlet that pulls the request parameter i want to make available to the portlet and put it in HTTP session. Then i do a redirect to your http://myportal/UserFriendly. The portlet would then access name like follows. portletRequest.getPortletSession().getAttribute("name", PortletSession.APPLICATION_SCOPE); It's a round about way of getting there, but if you have no concerns with creating the external link directly to the servlet in your war file you're deploying to the portal this works like a charm. And can be tested without running websphere portal, i prefer to develop portlets using pluto on tomcat.
  8. WSRP consumer for Vignettte[ Go to top ]

    Hi Eric, I want to install a WSRP consumer on vignette.I tried using Add Remote Portlet server but it did not work.I could connect to WSDL site but it gave registation error on the next a consumer portlet availablpage.Do you have some clue on this or is there a ready made cosumer portlet available for vignette. I did install a producer and consumer for Liferay and it working very well but i am facing problems with the way i could install it on vignette.If Could you suggest something on this. Thanks -Hiren