Skip to Content
author's profile photo Former Member
Former Member

Try to link to internal jsp pagegs

Hi there.

I try to link from one .jsp to anohter .jsp Page. They're both located the same .par and there in the same directory.

So I'm not able to get them linke successfully by using either a native html <a href=...> or using the <hbj:link...

Here some infos:

<% String strWRoot = componentRequest.getWebResourcePath(); %>

<hbj:link

id="link1"

text="BlaBla"

reference="<%= strWRoot+\"/jsp/myPage.jsp\"%>"

target="_TOP"

tooltip="BlaBla"

onClick="LinkClick"

/>

I think problem is getting the right ressource path. So I also tried:

<% String strPubPath = componentRequest.getPublicResourcePath(); %>

But no success.

Bye.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Sep 08, 2006 at 10:10 AM

    Unfortunately you can't link to a JSP page in this manner. The reason for this is because JSP pages are compiled when they are accessed, therefore you need to access it using a different method.

    Basically you need to have some form of controller servlet, which then dispatches the request to the JSP page. This Servlet can be either a standard HttpServlet or an AbstractPortalComponent. If you use an AbstractPortalComponent, then you would have to send something in the request to identify where you would like to dispatch the request to, i.e. a parameter holding the JSP name, for instance. Then, in the portal component, simply use the request.dispatchRequest(IResource jspResource, IPortalComponentResponse response) method to dispatch the request to the JSP page.

    I hope this helps

    D

    Add a comment
    10|10000 characters needed characters exceeded

    • Ahhh!!

      This is very different indeed. The request.dispatchRequest method is used to dispatch to different JSP pages within the same component, and not to another component.

      Therefore this is even easier. You should use the URL generator to generate a URL to this second component. This is documented in the PDK. I can't remember off the top of my head, but there is an example of this in the documentation, I believe.

      I hope this helps

      D

  • Posted on Sep 08, 2006 at 12:33 PM

    Hi,

    Masthead par file uses link to another jsp in the same par file.

    When we click on logoff link in the masthead then logoffConfirmMsg.jsp file is called and this file is present in the masthead par file itself.

    Referring this par file might help you to solve your problem.

    Thanks and Regards,

    Gauri Gosavi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.