• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SendRedirect() Method dosn't work in portal jsp file ....?

 
AMR OMAR
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to portlets development(WebSphere Portal). I am trying to use redirect Method in jsp file in portal to another URL (www.any.com).
I have written the following code in jsp file

class="com.zak.moi.knet.paymentgatway.e24PaymentPipe" scope="request" />
String payID =e24PaymentPipe.getPaymentId();
String payURL =e24PaymentPipe.getPaymentPage();
response.sendRedirect( payURL + "?PaymentID=" + payID );
this code dosn't work and didn't give me any exception and portal page
appear empty without any thing .

please any body help me.....!
 
Stefan Zoerner
Author
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amr,

do you use JSR 168 or the IBM API (WebSphere portal provides two programming models)?

In JSR 168 a redirect is only possible in the action phase of the life cycle, i.e. if a the processAction method is called.

javax.portlet.ActionResponse.sendRedirect(String location)

In a JSP, which is included during a render call, you can't send a redirect (even if the implicit object "request" within the JSP allows you to call that method). This is because more than one portlet may be located on the portal page. If some of them send a redirect during the render phase it is not clear what should happen to the clients browser.

I am not sure, but I assume the situation is similar to the old IBM portlet API.

Greetings from Hamburg,
Stefan
[ January 05, 2006: Message edited by: Stefan Zoerner ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic