JSP - Portlet communicatation

Hi,
i wish to achieve communicate between a jsp (which is placed in the header) and
a portlet (which is placed in a book) in the Main Page Book. Is this possible
? I know that inter-portlet communication is possible, but I need to use a jsp
in the header as portlets cannot be placed into the header.
Thanks
Mark

Hi Mark,
If you want the portlet to be able to access data from the header, then have the
header jsp store the data in the request, where the portlet can then retrieve
it.
If you want the header to retrieve data from the portlet, this can be tricky because
the header will execute before the portlet. A simple technique would be to have
the portlet store data in the session, then on subsequent requests the header
can retrieve the data from the session; however this would not work on the first
request to the portal. An alternative is to use a backing file on the portlet
and implement the preRender method, which will be invoked before the header or
portlet renders. In the preRender method you can store data in the request, which
will then be available to the header.
Hope this helps,
Jim
"Mark" <[email protected]> wrote:
>
Hi,
i wish to achieve communicate between a jsp (which is placed in the header)
and
a portlet (which is placed in a book) in the Main Page Book. Is this
possible
? I know that inter-portlet communication is possible, but I need to
use a jsp
in the header as portlets cannot be placed into the header.
Thanks
Mark

Similar Messages

  • JSP portlet built in Jdeveloper call stored procedure

    Hi,
    I have a simple jsp portlet built with Jdeveloper, now I'm trying to execute a stored
    procedure from the jsp. How can one access database and call a proc, in a jsp which is
    developed in Jdeveloper?
    Is JSTL required for it or a normal jdbc calls will suffice?
    Any help asap is appreciated.
    Thanks,
    Kavitha

    It is actually very simple. :)
    I suggest to create a Java bean containing the Java code with the PL/SQL call.
    This method can be invoked from JSP.
    A good pratice is to pass database connection to this methode and commit or rollack in the JSP.
    example:
    public void saveData(Connection conn,
    String param1,
    String param2) throws SQLException
    With this approach you can call several SQL statements in the same session.
    This will enable transaction handling.
    I suppose the db connect will be pooled in your application.

  • Display image in JSP Portlet

    I create a JSP portlet. But The portlet can't display image(gif file, jpg file). I have modified the provider.xml and the following line is added:
    <imageURL>URL_Path</imageURL>
    But, the image still cannot be displayed.
    How can I display image in JSP portlet?

    Leo Cheung,
    You could try the following :
    1. Add a virtual directory path Alias 'imgf' in the Apache configuration file httpd.conf to load the image file. Add the following line under the alias section :
    Alias /imgf/ "<your directory>\images/"
    2. Place your gif/jpg files (eg., work.gif) in the images directory.
    3. Use the IMG tag of HTML :
    <IMG src="/imgf/work.gif" border=0 width=80 height=80> in the JSP file at the location where you need to display the image.
    Hope this helps
    Pushkala

  • [Error running JSP portlet in JDeveloper

    I'm writing a JSP portlet with JDeveloper 9.0.3.
    The "index.jsp" works OK, and I can see the registration URL for my new provider.
    I deploy the application to Oracle9iAS 9.0.2.0.1 Application Server succesfully throught DCM servlet, register the new provier and I can run the portlet succesfully.
    But if I try to run the "pasa_parametroShowPage.jsp" inside the Jdeveloper, I get an HTTP 500 Error :
    java.lang.NullPointerException
         void htdocs.pasa__parametro._pasa__parametroShowPage._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         [htdocs/pasa_parametro/pasa_parametroShowPage.jsp]
              pasa_parametroShowPage.jsp:12
    Line 12 is:
    Hello <%= pReq.getUser().getName() %>
    Thanks in advance.

    In order to successfully run, "pasa_parametroShowPage.jsp" must be called in a portal context - JDeveloper does not do this.
    Therefore, when called from JDeveloper, the PortletRenderRequest object is not present, hance the null pointer exception.
    You shouldn't attempt to run this JSP directly from with in jdev. You'll notice that if you point a browser directly at that JSP, you will get the same null pointer exception.
    If you need to debug this JSP in jdev, you can use a portal instance **or** the test harness (http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/TESTSUITE/PDKTEST/PDKTEST.ZIP)
    to fire http requests at JDeveloper's embedded OC4J.

  • Upload file form problem in JSP portlet !!!

    Hi!
    I use "OrdHttpUploadFile" class for upload file in JSP portlet to database!
    Problem is that this class must use FORM ENCTYPE="multipart/form-data" whis I suppose dont work in portlet!?
    Which FORM ENCTYPE should I use in portlet! Or there is some other solution for upload file in JSP portlet!?
    Thanks!
    Kristjan

    Thanks for u r reply Mr.Prasad.
    Sorry for the delay for reply.
    My scenario is in 2 phases
    Phase 1. I am taking input from the front end using jsp and writing the contents in to a file and then downloading that file on to my desktop.(Now let us say this one as file downloading)
    Phase 2. Now I had designed a page,which locates the downloaded file by using the following tag.
                        <td><input type ="file" name ="xmlFileName"></td>
        In the downloaded xml file I am having applicationid. I am checking whether the application id already xists in the database (or)not.
    If already exists in the database , the end user will get one confirmation msg,saying application already exists in the database.
    If the user clicks ok again the request has to go to the servlet.
    Now the actual problems are
    1. When I locate the file on the desktop let us say c:\desktop\krish and click on submit button, it is locating to the file that is present in the server(this is the case for the first time means before checking the application id in the database).
    2. when the end user clicks "ok" on the confirmation box , I am not getting the file name,that has to be submitted to the servlet.
    Can u plz help me how to resolve this issue.
    regards,
    Krish

  • Call pl/sql API from jsp portlets

    HI ALL!
    I need to ask from java developers for portal application,How can i call pl/sql API from my jsp portlets,What enhancements in code should i have to follow in addition to use JDBC,I read in FAQ abt portal some thing abt pl/sql wrapper but that was for complex scenarios ,what if my requirement is to call only API functions for contentareas,items,previleges etc.I really need help.
    thx
    Alizeh

    Hi
    thanks for ur reply but where were u a month ago,i really started to think that my question was enough stupid not to be answered.At present i have done with jdbc and pl/sql calls ,current concern is for sessions as i see that session id remains same when one user logs out and another logs in(if browser is not closed), same sessionid persists in my java portlet for both users.Is this an expected behaviour?? but yes new session id appears if browser is closed.
    .session clear for both application and sso after logout is checked
    .broser is set to check for new version each visit for the page
    portal version is 3.0.9.8.0 ,we r planning patch to 3.0.9.8.3 soon
    once again thx
    Alizeh

  • JSP Portlet posting information to another JSP

    Hi,
    I have a JSP portlet that needs to submit form information to another JSP that is not a portlet.
    I'm not sure how to do this. The parameter passing examples pass information from one JSP portlet to another JSP portlet. I want to pass information from a JSP portlet to another JSP which is not a portlet.
    Do I use:
    <form name="parameters" method="POST" action="<%= HttpPortletRendererUtil.htmlFormActionLink(request,PortletRendererUtil.PAGE_LINK) %>" >
    <%= HttpPortletRendererUtil.htmlFormHiddenFields(request,PortletRendererUtil.PAGE_LINK) %>
    If so, what does the PAGE_LINK stand for? How do I tell it the name of the JSP that I want it to submit to?
    Is there something else I need to be using?
    Thanks....JS

    I try to answer your questions inline.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Julie Steele ():
    Thanks for the info but....
    Let me add more information....
    We have 2 JSPs, the first being a form input JSP that I have made into a portlet. We want to submit the information from this form to another JSP that will do the insert into the database and return a insert successful message. We want that message to be returned to the form input portlet and displayed in that portlet. We can't pass parameters in the url because it would be way too long.
    <HR></BLOCKQUOTE>
    As I see in your first message you're using POST method for submitting the form. If so, you don't have to worry about the length of the parameters, as far as I remember there are no limits.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Do I need to make the receiving JSP a portlet also and will that work since it is only showing the results of a post?
    <HR></BLOCKQUOTE>
    You don't need to portletize it just because of technical reasons; but you may portletize if you're having concerns that the navigation leads out of the portal.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    How can we accomplish this? Do you have an example? I really do want to know what the PAGE_LINK stands for and how it's used?<HR></BLOCKQUOTE>
    There is a parameter passing example and an article "Understanding the Parameter Passing JSP Sample" at http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/understanding.parameter.passing.html .
    Do you have any other example in mind you're looking for?
    As far as I understand the key is how you navigate back from your standalone JSP to portal. Do you have a submit button there? Or do you want to redirect the browser after a given interval?
    You may also want to have a look at the multipage example portlet in the PDK that demonstrates how you can display multiple JSPs in the same portlet.
    Regards,
    Peter

  • Get the user group in a JSP portlet

    Hi,
    I'm developping a JSP portlet and i'd like to know how to get the group of the user ?
    (the JSP will display URL links only if a user belongs to a specific group).
    I've seen the objet ProviderUser but it doesn't have methods wich give the user groups...
    Can you help me,
    Thank you
    Franck

    ProviderUser or any other Java API for that matter in PDK cannot
    give user's group information. One way to get the User group is
    to make to make use of Portal's PL/SQL Security API Packages,
    through JDBC calls.
    Example PL/SQL Code:
    l_boolean boolean;
    l_boolean := wwsec_api.is_user_in_group
    p_person_id => wwsec_api.id ('USER1'),
    p_group_id => wwsec_api.group_id ('GROUP1')
    Note : Replace USER1, GROUP1 with your own values.
    -aMJAD

  • How to show chinese char form db in my jsp portlet?

    How to show chinese char form db in my jsp portlet?
    I had tried to set contentType in renderResponse, but itn't work ..

    Bent,
    You can access the database from your Java portlet, just like from any other Java/JSP environment. Yes, you can use JDBC, as well as BC4J.
    The Discussion Forum portlet was built using BC4J, take a look at it's source to see how it was done.
    Also, check out Re: BC4J Java portlet anyone?, it contains a lot of useful information too.
    Peter

  • Memory Leak In OC4J_WSRP Jsp Portlet

    Hi All
    I have the following problem:
    I have several JSP portlets deployed in the OracelAS OC4J_WSRP container.
    These portlets do a DB Access (using OracleAS connection pooling), call a remote Web Service parse the XML response and finally display the data to the user.
    We are in development period which means that we continuously deploy or redeploy the portlets using JDeveloper.
    The problem is that after 5 to 6 days an java.lang.outofmemory exception is thrown and all portlets deployed to this container stop working (we see a 500 Internal Server Error to the portal pages that use these portlets).
    We need to restart the OC4J_WSRP container to get the portlets back working.
    Obviously the JVM of the container runs out of memory and cannot serve further requests.
    But the big question is WHAT is causing the problem?
    I have noticed that the Memory usage metric in Oracle Enterprise Manager Application Server Control steadily increases over time and when it reaches about 125Mb then I get the OutofMemory exception.
    Another metric that steadily increases is the total JDBC connections but I am not sure if this is a problem or not as no Documentation from Oracle provides sufficient explanation of what this number is all about!!
    I have also noticed that each time we redeploy the provider that contains the portlets to the OC4J_WSRP container the Memory Usage increases significantly (about 2Mb more) and this memory is never given back to the OS but only when the OC4J_WSRP is restarted...
    Does anybody have an explanation to this?
    Thank you

    Do you mean the OC4J_WSRP container?
    Is it a production system or you are in development period??
    Because I suspect that the memory increases with the continuous re-deployments of the provider.
    maybe if we discuss the problem we will be able to find a solution together...

  • Session problem in JSP portlet

    Hi,
    I have a jsp portlet. In this jsp i am creating a session and i am putting some value in session. There is navigation from this jsp to second jsp(not portlet) and from this jsp to third jsp(again this is also not a portlet). Now in third jsp i am trying to retrieve the value from session. But i am getting null value.
    In provider i given <session>true</session> element. While registering provider with portal given login frequency 'once per user session'.
    The code in first jsp is:
    PortletRenderRequest portletRequest = (PortletRenderRequest) request.getAttribute(HttpProvider.PORTLET_RENDER_REQUEST);
    ProviderSession mySession = portletRequest.getSession();
    if(mySession != null){
    mySession.putValue(PortletRendererUtil.portletParameter(portletRequest.getPortletReference(), "const"), str);
    From the code i found that the session itself is not created.
    Sorry for the lengthy question.
    Pls. help me.
    Rgds,
    CRM.
    null

    To share a session between a web provider and other JSPs or Servlets, you need to make sure the "Same Cookie Domain" checkbox is checked AND your session cookie is scoped to a common domain (eg us.oracle.com)
    See documents on session handling and Integrating Password Protected Applications into Oracle Portal - downloadable from portalstudio.oracle.com.
    review the section on "deep links" in the second article.

  • File Upload JSP Portlet

    Hi,
    I want to upload files in a JSP portlet. I have java servlet and I can upload files successfully out of portal.
    How can I use these servlet in a JSP portlet to upload file?
    Thanks
    Ali Erkan

    http://jakarta.apache.org/commons/fileupload/
    http://jakarta.apache.org/commons/fileupload/using.html

  • Recommended Practice for Exception handling in JSP portlets

    Hi,
    This may be a redundant question, but hope to get some feedback on the generally used practice of catching exceptions in a JSP based Portal application.
    Is it okay to just make use of the standard JSP errorpage directive in each of the JSP portlets to point to the same errorpage.jsp. If a problem occurs in any of the portlets, the userfriendly message in the errorpage.jsp would be rendered.
    Of course there could be some kind of error logging done in the errorpage.jsp to track the error stack. This also means, that you would not want to catch any exceptions inside each of the portlet JSPs but rather let the errorpage directive, be the catch all?
    regards
    -Ananth

    Mohana,
    Pls ignore the voice mail,it was for something else and I was able to talk to Peter as well about this.
    Regarding the error/exception handling -
    If the errorPage.jsp is used in each of the JSP portlets with the help of the JPS errorPage directive, if a general system failure or major appln. error occurs, you will get the errorPage.jsp containing the user friendly message to show up in each of the half a dozen portlets on the page!!. Is that allright.
    You cannot really redirect the entire page using the code inside the JSP portlet. It will only render inside the same portlet. The only way you can do this is to use Javascript.
    -Ananth

  • When click on button in jsp portlet, the portlet is reloaded

    Hi all
    I have a jsp portlet containing a number of divs and buttons. When the user clicks on a specific button, I use javascript to hide and/or display specific divs.
    However, in Weblogic Portal 10.3 (using IE 8 or FF 3.5.3) the whole portlet is reloaded when I click on a button.
    This results in the default screen being displayed again.
    Is there a way that I can prevent Weblogic Portal from reloading the portlet when javascript is executed in the portlet?

    Can you send source for how you create your button? Is it <input> or <button> ?
    I suspect what's happening is that your button has no type, so it's defaulting to "submit" behavior, reposting the page.
    Try using <button type="button" ...> and see if that doesn't fix it.
    -Chris

  • Problem while creatin jsp portlet

    hello all,
    i get an error "500 internal server error" while creating jsp portlet. i do not write any thing in view.jsp page.
    can any body tell me what is wrong with it? i am using oracle jdeveloper 10g (version 10.1.2.0.0).
    thanks in advance

    Hi Arshita,
    This issue is corrected. You should make a search in SAP Marketplace. There is a note to correct that issue.
    I cannot search from my place (mobile handy device) but you should be able to find it easily in LO-MD-BP-CM or FI-AP* or FI-AR* + TMOD* or the error number.
    The note is quite recent. Probably less than 6 months.
    reward points if helpful.
    BR

Maybe you are looking for

  • Line Items not seen in Invoice output

    Hi All I am not able to see the line items in the invoice output. The invoice just shows the total amount with out displaying any of the line items. Please help -Madhu

  • How to deal with the code highlight problem of Jekyll in ArchLinux

    Seemingly, The code highlight function of Jekyll is required by python-pygments but I use python2 in ArchLinux. I have to install python2-pygments instead but this works not very well because Jekyll needs /usr/bin/pygmentize instead of pygmentize2 Be

  • Multiple payload mapping in zip file..

    Hi, is it possible to map multiple Payloads in one XI Message? My Source File is a zip (xml files) I unziped it in Sender CC I have message structure as this in my integration server XI Message - payload 1 - payload 2 As there are multiple structure(

  • Sql database connection in jsp

    Hi, I am new to java. I know how to connect the database in the java using the javacodings [jdbc] but i am don't know how to connect the database using the jsp. Is it easy. If so, can any one help me in this regards. Any sample codes or white paper a

  • 10.6.3 Combo update fails 5x at end

    I tried to install the 10.6.3 Combo update on a 2006 MacBookPro five times, with the same "installation failed" error. First time I tried via screen sharing from my desktop (where install went through without problems). Second time, directly from MBP