Skip to Content

communication between jsp and abstractportalcomponent

Hello All

Communication between jsp and abstractPortalComponent.

jsp contains one input text field and one submit button.

when the user clicks on submit button it will call the component and that input value will

display in same jsp page.

how this communication will happen?

Rgrds

Sri

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2010 at 02:14 PM

    >

    > Hello All

    >

    >

    > Communication between jsp and abstractPortalComponent.

    > jsp contains one input text field and one submit button.

    > when the user clicks on submit button it will call the component and that input value will

    > display in same jsp page.

    >

    > how this communication will happen?

    >

    >

    > Rgrds

    > Sri

    Hi Sri,

    You can read out the submitted value in your component by request.getParameter("NameOfYourInputField").

    Before you load the JSP again from your component you can set this value as an attribute to the HttpServletRequest:

    String myValue = request.getParameter("myInputField"); //Suppose request is an object of IPortalComponentRequest
    request.getServletRequest().setAttribute("myValue", myValue);
    ...
    //include jsp in request...
    

    In your JSP file you can then read out this attribute by the following code:

    String myValueInJsp = (String)request.getAttribute("myValue"); //request is an implicit object in every JSP file and is a type of HttpServletRequest
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 20, 2010 at 05:47 AM

    Hi Srikanth,

    With your requirement I believe you can achieve this pretty much without any interaction b/w abstract portal component and jsp page. You only have to read one value and display it on the same page right.

    Kindly find the below snippet of code in which I have read the value of First name and displayed it on the second input field. You can easily tailor it to suit your need(replacing i/p field with label or sth else).

    Thanks,

    Jakes.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 20, 2010 at 05:54 AM

    Hi Srikanth,

    I am unable to include the snippet of javascript as the thread is not allowing me to submit the same(even with code dsiplay).

    Shoot a mail to <<address removed by moderator - please maintain your business card>> I will send you the jsp file.

    P.S : I tried using the code snippet gallery in wiki as well, but sadly it doesn't allow javascripts.

    Thanks,

    Jakes.

    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.