Skip to Content
0
Former Member
Nov 15, 2012 at 08:05 PM

opening JSP in new window

49 Views

Hi ,

I have created a abstractportalcomponent and have created a JSP inside the component . My requirement is to load the JSP page in new window based on some condition. Below is the code i was trying to get JSP url and set it as hyperlink initially to test it. When i click the link i am getting portal run-time error.

IResource res = request.getResource(IResource.JSP, "jsp/popupmessage.jsp");

IPortalComponentURI uri = request.createPortalComponentURI();

uri.setContextName( res.getResourceInformation().getURL(request).toString());

response.write("<a href='"+ uri.toString() + "'>"+ "Vasu" + "</a>");

Also tried by by navigating using web resource path as given below but got error message as "Resource not found"

String webPath = request.getWebResourcePath();

String jspName = webPath + "/jsp/popupmessage.jsp";

response.write(jspName);

response.write("<br/>");

response.write("<a href='"+ jspName + "'>"+ "Vasu" + "</a>");


Thanks in advance,

Vasu