cancel
Showing results for 
Search instead for 
Did you mean: 

How do I redirect my jsp pages from event?

Former Member
0 Kudos

public class Hoge extends AbstractPortalComponent

{

public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

{

...(call my jsp that has button component with buttonclicked event.)

}

public void doButtonClicked(IPortalComponentRequest request, IPortalComponentEvent event)

{

(I want to redirect for response from here)

}

}

Should I use "request.redirect(URI)"?

or

Should I use "request.getServletResponse(true).sendRedirect(URI) "?

If I have pagelet/test.jsp, I want to call the page from button clicked event.

How should I write the page call?

thank you.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

request.redirect(URI) should be okay to redirect.

I would recommend to create an AbstractPortalComponent which includes your jsp page (pagelet/test.jsp).

Check this how to create JSP component:

http://help.sap.com/saphelp_nw70/helpdata/EN/8a/4dae42cb9f0f31e10000000a1550b0/frameset.htm

Once the JSPPortalComponent is ready, to redirect do this:

request.redirect("/irj/servlet/prt/portal/prtroot/YourProjectName.YourJSPPortalComponent");

Regards,

Praveen Gudapati

Answers (1)

Answers (1)

Former Member
0 Kudos

I had already read the help link, but I don't still understand.

I think that YourProjectName means my project name of NWDS, though.

What is the yourJSPPortalComponent?

Is that a path for pagelet/test.jsp?

or need to define IResource?

If project name is "hoge",

"hoge.pagelet/test.jsp" ?

I don't think such path, though....

0 Kudos

Hi,

yourJSPPortalComponent is the Component name you defined in portalapp.xml for your component with jsp.

I hope you followed my suggestion in previous post and created an AbstractPortalComponent which includes your jsp page (pagelet/test.jsp).

So you replace yourJSPPortalComponent with Component name of this AbstractPortalComponent.

Hope it is clear now.

Regards,

Praveen Gudapati