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

Using a bean without a user

Hi,

I have built a component that is called on the logon page of the portal to manage new user requests. I have been using a portalComponentSession bean but I've just realised that when two users are using the component at the same time. User2 gets info from user 1...

Is it possible to use a bean before loggin in the portal when no users are defined without sharing info? What kind of bean should I use?

Thank you

Renaud

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2005 at 08:44 AM

    Hi Renaud,

    you might use the HttpSession, which is issued when you call the logon page.

    The PortalComponentSession just wraps the HttpSession. So if you request a IPortaComponentSession and the session is not null, the session will be user-specific.

    Regards, Karsten

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2005 at 12:36 PM

    Hi Karsten,

    I tried putting the bean in the HttpSession and I still have the problem of sharing data...

    Here is the code I used in the component

    HttpSession componentSession = ((IPortalComponentRequest)getRequest()).getServletRequest().getSession();

    Object o = componentSession.getAttribute("ContractBean");

    if (o instanceof ContractBean)

    {

    bean = (ContractBean) o;

    }

    else

    {

    // no bean or wrong class.

    bean = new ContractBean();

    componentSession.setAttribute("ContractBean",bean);

    }

    and here is the code of my jsp

    <jsp:useBean id="ContractBean" scope="session" class="com.ba.runtime.logon.contract.Model.ContractBean" />

    Is there a problem with the way I use it?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 08, 2005 at 06:13 PM

    Hi,

    The problem was elsewhere... Thank you for your help!

    Renaud

    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.