Examples with JBeans / Session and Entity

I wish if you could give links to web pages were to download examples of Java Beans
using Session and Entity. In whole, JB that access relational databases.
Best, would be an example to test and also that include the source code. Maybe
an open source.
Thanks for your directions,
Janet

Teox wrote:
Thanks for your fast answering!
Another thing: if I plan to use this way of developing my applications, could be a good idea putting my Session EJB with my business methods in session, instead of calling a new EJB and removing it each time I load a servlet?
Thanks again.That depends on what you need to do. If you need to retain state between business method invocations (like a shopping cart) then store a Stateful Session bean in your http session. If you do not need to retain state then simply lookup a Stateless session bean each time you need it.
m

Similar Messages

  • How many ejbCreate() can be in Session and Entity Bean???

    Hi,
    How many ejbCreate() method can be in a Session and Entity
    Bean???
    How many can be in Stateless and Stateful SessionBean???
    How many can be in CMP and BMP SessionBean???
    Thanks,
    JavaCrazyLover

    How many ejbCreate() method can be in a Session
    ion and Entity
    Bean???For Stateful Session Beans and Entity Beans, as many as you'd like.
    Stateless Session beans can only have one, since their ejbCreate methods can not take any parameters.
    >
    >
    How many can be in CMP and BMP SessionBean???If you mean CMT/BMT(Container-Managed transactions / Bean-Managed Transactions), then
    the answer is the same. The create method requirements are independent of the transactional nature of the bean.
    If you really mean CMP/BMP(Container-Managed Persistence / Bean-Managed Persistence) , it doesn't apply to session beans, only entity beans. However, even for entity beans, CMP vs. BMP has no bearing on the rules regarding # of create methods.
    --ken
    >
    >
    Thanks,
    JavaCrazyLover

  • [svn:fx-trunk] 5899: Re: Sparkified this example with latest namespaces and prefixes.

    Revision: 5899
    Author: [email protected]
    Date: 2009-04-02 17:36:40 -0700 (Thu, 02 Apr 2009)
    Log Message:
    Re:Sparkified this example with latest namespaces and prefixes.
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/ListExample.m xml

    I am not sure what's happening with IE9 (no live site) but I had real problems viewing your code in Live View - until I removed the HTML comment marked below. Basically your site was viewable in Design View but as soon a I hit Live view, it disappeared - much like IE9. See if removing the comment solves your issue.
    <style type="text/css">
    <!-- /*Remove this */
    body {
        margin: 0;
        padding: 0;
        color: #000;
        background:url(Images/websitebackgroundhomee.jpg) repeat scroll 0 0;
        font-family: David;
        font-size: 15px;
        height:100%;

  • Correct Principal not showing up in the Session and Entity EJB layer

    In our app a user is authenticated via the web container. The web layer then makes
    calls to various session EJB's.
    In our session bean, calls to sessionContext.getCallerPrincipal().getName() sometimes
    returns "SYSTEM" instead of
    the principal's name that was authenticated at the web container level.
    In our entity beans, calls to entityContext.getCallerPrincipal().getName()
    sometimes returns "<anonymous>" instead of the principal's
    name.
    A) Why isn't the principal's name = context's principal's name?
    B) Can we ensure that principal's name isn't lost?
    As per the documentation, the user principal is associated with the current thread,
    so why is it that when calls are made in the same thread of execution from the
    web layer to the EJB layer we are losing the right principal. Btw, the Principal
    is always correct in the Web layer. We do not have any RunAs options set in our
    EJB deployment descriptors.
    What are we doing wrong?

    You aren't doing anything wrong. This is a bug in the webservices.
    kapil khanna wrote:
    In our app a user is authenticated via the web container. The web layer then makes
    calls to various session EJB's.
    In our session bean, calls to sessionContext.getCallerPrincipal().getName() sometimes
    returns "SYSTEM" instead of
    the principal's name that was authenticated at the web container level.
    In our entity beans, calls to entityContext.getCallerPrincipal().getName()
    sometimes returns "<anonymous>" instead of the principal's
    name.
    A) Why isn't the principal's name = context's principal's name?
    B) Can we ensure that principal's name isn't lost?
    As per the documentation, the user principal is associated with the current thread,
    so why is it that when calls are made in the same thread of execution from the
    web layer to the EJB layer we are losing the right principal. Btw, the Principal
    is always correct in the Web layer. We do not have any RunAs options set in our
    EJB deployment descriptors.
    What are we doing wrong?

  • EJB - MDB and Session and Entity - Seem to always run under same Thread

    I am working on an application that implemets a connection from an MDB to a Session EJB which inturn connects to a Entity EJB. All connections are impemented as Local Home. I use log4j for tracing and notice that the thread ID reported for all activity is the same "Thread ID: MessageListenerThreadPool : 0" .
    This confuses me because I thought that all EJB's would execute under different threads. Have I done something wrong? Have I missinterpreted the EJB implementation? Any opinions would be greatly appreciated!!

    Hi Kelly,
    This is a slight misinterpretation of the EJB threading requirements. There are a couple different issues as play here. First, the main threading guarantee made by the spec is that a particular instance of an EJB will not be invoked by the container on more than one thread at a time. This is one of the guarantees that simplifies the EJB programming model so that developers don't have to do anything special (e.g. the use of synchronized blocks) to handle concurrent access. Second, the EJB Local programming model requires that invocations have pass-by-reference semantics. Of course, the easiest way for the container to provide that behavior is to literally make the local invocation on the same thread.
    The call-flow you're describing touches a single instance from three different beans, so the threading guarantee is not violated. Hope that clears things up a bit.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Example on SOAP sender and receiver ...With all Screen shots PL...

    Hi Experts
        I want to work on SOAP scenarios (Where soap as sender as well receiver)
        Can any one help me... with example screen shots on this ...
        Pls...provide me end to end (I am very new to SOAP)
        like Soap 2 Rfc, Rfc 2 Soap...etc any examples with full details
        And one more thing is " In general when we will go for SOAP specific scenario's
        What are the real advantages ?
    Adv...thanx and points to ALL
    Rakesh B

    Rakesh,
    Look into these how to guides,
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/befdeb90-0201-0010-059b-f222711d10c0">How to Set Up a Web Service-Related Scenario with SAP XI</a>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79">How to Use SOAP Adapter</a>
    Blogs~
    <a href="/people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2">RFC -> XI -> WebService - A Complete Walkthrough (Part 2)</a>
    <a href="/people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009">Troubleshooting - RFC and SOAP scenarios</a>
    SOAP allows you to call webservices from XI and also expose your Interface as a webserivce. This way, you leverage and use all advantages of webservices.!
    Real Time scenarios invove cases when you have a vendor who have exposed / provide a set of webservices which your organization would like to use.
    Regards
    Bhavesh
    PS :Search on SDN. You will find answers and blogs for the same questions. By searching you are digging yourself and thereby you get to understand things better.

  • Model session not in sync with Http Session

    Hi All,
    I have an application developed in JDev 11.1.1.4 and we are not using ADF Security for login.
    The problem occurring is randomly some of the LOV on my home page are getting null (having no data). These LOVs are populated using the values passed as bind parameter from the login values (basically HTTP session values at web layer). So i added a method in all the task flow to set the session value at the model layer (default method) . Also on each call to the Am Impl call i am setting the value in the HTTP session and then invoking the method, but some how what happens is the Model level session value is not in sync with HTTP session and the list gets empty.
    Any inputs what i can do to get out of this prblm ?
    thnk

    In this case you need to overwrite the activateState/passivateState method of your am and store/reads the values from the xml structure you get as parameters to this methods.
    For more detailed information check the docs http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcstatemgmt.htm#sm0495
    By the way, this is nothing you need to open an SR on as it's working as designed.
    Timo

  • Flow of sessiob bean and entity bean

    Hi All,
    Can any one help me how is the flow of session and entity beans i.e
    What method is called first and what method is called next.
    There are so many methods like create(),ejbcreate(),
    ejbActivate(),ejbPassivate(),ejbDelete() etc.
    What is the flow of these methods and when they are called.

    Hi vasudulla,
    If you can, go to the bookstore and look for the book:
    Entreprise JavaBeans 3rd Edition by Richard Monson-Haefel.
    In the Appendix B, you can see the State and Sequence Diagrams, all the things you want to know about the Flow.
    --Paul.

  • Sticky sessions and Load Balancing in WL Clusters

    We are using iPlanet Web Server 4.1 with WebLogic App Server; and would like
    to implement load balancing with sticky sessions and in-memory state
    replication.
    The documentation in Weblogic says that -
    When using in-memory state replication, your WebLogic Server Cluster must
    live behind one or more proxy servers. The proxy servers are smart enough to
    send servlet requests, belonging to the same HTTP session, back to the same
    server in the cluster that holds the session data.
    (Ref: http://www.weblogic.com/docs51/cluster/setup.html)
    Does this mean that the sticky session configuration has to be done on the
    iPlanet Web Server itself ?
    Also, if WebLogic is used as the Web server, does WebLogic provide any
    support for sticky sessions?
    Any help, suggestions or links to useful info are welcome.
    Regards,
    Milind.

    Mike,
    im curious as to why you would recomend using weblogic as a web server in 6.1?
    I would not for the following reasons:
    - it costs 10x more per cpu list
    - it doesnt support hardware accell cards (afaik, please let me know if this has
    changed)
    iplanet is really good a serving up static html and gif's, especially in ssl if you
    have a hardware accell card. So if you have a site with lots of graphics and you use
    ssl a lot, I think its still a better solution.
    -Joel
    Mike Reiche wrote:
    You get sticky round-robin by default.
    You need to have session tracking turned on (i think it is on by default). You
    need to have the WL plugin configured in iPlanet.
    When WL creates an httpSession, it writes a cookie (or rewrites the URL) back
    to the browser. On subsequent requests, the browser sends the cookie and iPlanet
    plug-in directs the request to the correct WL instance based on the ip address
    of the WL server embedded in the cookie.
    If you are using WLS 6.1, I would recommend using it as a web server (and not
    using iPlanet). I imagine that it supports stickly load balancing as well.
    Mike
    Joel Nylund <[email protected]> wrote:
    you get round robin by default, if you want a different scheme you can
    use one
    of the other 3 options (weight, random or parameter).
    -Joel
    I think weight can be set in weblogic properties. I havent used any other
    than
    round robin.
    Milind Prabhu wrote:
    We are using iPlanet Web Server 4.1 with WebLogic App Server; and wouldlike
    to implement load balancing with sticky sessions and in-memory state
    replication.
    The documentation in Weblogic says that -
    When using in-memory state replication, your WebLogic Server Clustermust
    live behind one or more proxy servers. The proxy servers are smartenough to
    send servlet requests, belonging to the same HTTP session, back tothe same
    server in the cluster that holds the session data.
    (Ref: http://www.weblogic.com/docs51/cluster/setup.html)
    Does this mean that the sticky session configuration has to be doneon the
    iPlanet Web Server itself ?
    Also, if WebLogic is used as the Web server, does WebLogic provideany
    support for sticky sessions?
    Any help, suggestions or links to useful info are welcome.
    Regards,
    Milind.

  • DBMS connection speed: Session vs Entity

    Environment: WLS6.1 SP3, W2K, Oracle 8.1.7, OCI Driver
    Hi,
    we are experiencing performance problem when getting a connection from a
    pool.
    Getting a connection from a stateless session bean takes 300-500ms whereas
    it takes 15ms
    from an entity bean (local). Both session and entity beans are deployed in
    the same ear.
    In both cases we're getting the datasource using the following code snippet
    Properties p = new Properties();
    bla bla bla ...
    Context ic = new InitialContext(p);
    DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/XXX");
    and
    DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/YYY");
    When getting the connection, we are experiencing the speed difference
    described above.
    connection conn = ds.getConnection();
    Why do we have this difference? We have the reference to the datasource
    already.
    There is no further JNDI lookup. Is there something we are missing?
    Thanks
    Arnaud
    Entity descriptor
    <resource-ref>
    <res-ref-name>jdbc/XXX</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    </resource-ref>
    WLS specific
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/XXX</res-ref-name>
    <jndi-name>jdbc/MyDataSource</jndi-name>
    </resource-description>
    </reference-descriptor>
    Session descriptor
    <resource-ref>
    <res-ref-name>jdbc/YYY</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    </resource-ref>
    WLS specific
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/YYY</res-ref-name>
    <jndi-name>jdbc/MyDataSource</jndi-name>
    </resource-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/XXX</ejb-ref-name>
    <jndi-name>ejb/XXXLocal</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>

    Hi Arnaud,
    "Arnaud Benjacar" <[email protected]> wrote in message news:[email protected]...
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    InitialCapacity="5" MaxCapacity="10" Name="myPool"
    Properties="user=M594;password=M594;dll=ocijdbc8;protocol=oci8"
    Targets="ilimdev" URL="jdbc:oracle:oci8:@ilimdev"/>
    <JDBCTxDataSource JNDIName="jdbc/MyDataSource"
    Name="My Tx Data Source" PoolName="myPool" Targets="ilimdev"/>This configuration is far from the best performing one. I suggest you
    to change it to:
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    Properties="user=M594;password=M594;dll=ocijdbc8;protocol=oci8"
    InitialCapacity="20" MaxCapacity="20" Name="myPool"
    LoginDelaySeconds="1" RefreshMinutes="99999"
    ShrinkPeriodMinutes="5" ShrinkingEnabled="false"
    TestConnectionsOnReserve="true" TestConnectionsOnRelease="false"
    TestTableName="DUAL"
    Targets="ilimdev" URL="jdbc:oracle:oci8:@ilimdev"/>
    This configuration will perform better and will not spend time recreating
    connections and will require less synchronized operations inside the
    pool.
    BTW, in your code sample you look up two datasources. Are they bound
    to different pools?
    Regards,
    Slava Imeshev
    >
    >
    >
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]...
    Hi Arnaud,
    Could you post an extract from config.xml in part of the connection
    pools and datasources? I'm asking because the configuration
    you have may be not tailored to best performance.
    Regards,
    Slava Imeshev
    "Arnaud Benjacar" <[email protected]> wrote in message
    news:[email protected]...
    Environment: WLS6.1 SP3, W2K, Oracle 8.1.7, OCI Driver
    Hi,
    we are experiencing performance problem when getting a connection from a
    pool.
    Getting a connection from a stateless session bean takes 300-500mswhereas
    it takes 15ms
    from an entity bean (local). Both session and entity beans are deployedin
    the same ear.
    In both cases we're getting the datasource using the following codesnippet
    Properties p = new Properties();
    bla bla bla ...
    Context ic = new InitialContext(p);
    DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/XXX");
    and
    DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/YYY");
    When getting the connection, we are experiencing the speed difference
    described above.
    connection conn = ds.getConnection();
    Why do we have this difference? We have the reference to the datasource
    already.
    There is no further JNDI lookup. Is there something we are missing?
    Thanks
    Arnaud
    Entity descriptor
    <resource-ref>
    <res-ref-name>jdbc/XXX</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    </resource-ref>
    WLS specific
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/XXX</res-ref-name>
    <jndi-name>jdbc/MyDataSource</jndi-name>
    </resource-description>
    </reference-descriptor>
    Session descriptor
    <resource-ref>
    <res-ref-name>jdbc/YYY</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Application</res-auth>
    </resource-ref>
    WLS specific
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/YYY</res-ref-name>
    <jndi-name>jdbc/MyDataSource</jndi-name>
    </resource-description>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/XXX</ejb-ref-name>
    <jndi-name>ejb/XXXLocal</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>

  • Problem with trigger and entity in JHeadsart, JBO-25019

    Hi to all,
    I am using JDeveloper 10.1.2 and developing an application using ADF Business Components and JheadStart 10.1.2.27
    I have a problem with trigger and entity in JHeadsart
    I have 3 entity and 3 views
    DsitTelephoneView based on DsitTelephone entity based on DSIT_TELEPHONE database table.
    TelUoView based on TelUo entity based on TEL_UO database table.
    NewAnnuaireView based on NewAnnuaire entity based on NEW_ANNUAIRE database view.
    I am using JHS to create :
    A JHS table-form based on DsitTelephoneView
    A JHS table based on TelUoView
    A JHS table based on NewAnnuaireView
    LIB_POSTE is a :
    DSIT_TELEPHONE column
    TEL_UO column
    NEW_ANNUAIRE column
    NEW_ANNUAIRE database view is built from DSIT_TELEPHONE database table.
    Lib_poste is an updatable attribut in TelUo entity, DsitTelephone entity, NewAnnuaire entity.
    Lib_poste is upadated in JHS table based on TelUoView
    I added a trigger on my database shema « IAN » to upadate LIB_POSTE in DSIT_TELEPHONE database table :
    CREATE OR REPLACES TRIGGER “IAN”.TEL_UO_UPDATE_LIB_POSTE
    AFTER INSERT OR UPDATE OFF lib_poste ONE IAN.TEL_UO
    FOR EACH ROW
    BEGIN
    UPDATE DSIT_TELEPHONE T
    SET t.lib_poste = :new.lib_poste
    WHERE t.id_tel = :new.id_tel;
    END;
    When I change the lib_poste with the application :
    - the lib_poste in DSIT_TELEPHONE database table is correctly updated by trigger.
    - but in JHS table-form based on DsitTelephoneView the lib_poste is not updated. If I do a quicksearch it is updated.
    - in JHS table based on NewAnnuaireView the lib_poste is not updated. if I do a quicksearch, I have an error:
    oracle.jbo.RowAlreadyDeletedException: JBO-25019: The row of entity of the key oracle.jbo. Key [null 25588] is not found in NewAnnuaire.
    25588 is the primary key off row in NEW_ANNUAIRE whose lib_poste was updated by the trigger.
    It is as if it had lost the bond with the row in the entity.
    Could you help me please ?
    Regards
    Laurent

    The following example should help.
    SQL> create sequence workorders_seq
      2  start with 1
      3  increment by 1
      4  nocycle
      5  nocache;
    Sequence created.
    SQL> create table workorders(workorder_id number,
      2  description varchar2(30),
      3   created_date date default sysdate);
    Table created.
    SQL> CREATE OR REPLACE TRIGGER TIMESTAMP_CREATED
      2  BEFORE INSERT ON workorders
      3  FOR EACH ROW
      4  BEGIN
      5  SELECT workorders_seq.nextval
      6    INTO :new.workorder_id
      7    FROM dual;
      8  END;
      9  /
    Trigger created.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
    Session altered.
    SQL> insert into workorders(description) values('test1');
    1 row created.
    SQL> insert into workorders(description) values('test2');
    1 row created.
    SQL> select * from workorders;
    WORKORDER_ID DESCRIPTION                    CREATED_DATE
               1 test1                          30-NOV-2004 15:30:34
               2 test2                          30-NOV-2004 15:30:42
    2 rows selected.

  • Lion 10.7.2 On both mac book pro and iMac, both with Lion 10.7.2, obtain repeated iCal event notifications from calendar or address book.  Cannot turn these off.  They repeat several times per session and every time computer is used.  How to diagnose this

    Lion 10.7.2 On both mac book pro and iMac, both with Lion 10.7.2, obtain repeated iCal event notifications from calendar or address book.  Cannot turn these off.  They repeat several times per session and every time computer is used.  How to diagnose this?

    First, uninstall "SuperTV" (whatever that is) according to the developer's instructions. It isn't working and it's filling the log with noise.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time when you had the problem. Post the messages logged before the boot, while the system was unresponsive or was failing to shut down. Please include the BOOT_TIME message at the end of the log extract.
    Post the log text, please, not a screenshot. If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message. When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    PLEASE DO NOT INDISCRIMINATELY DUMP THOUSANDS OF LINES FROM THE LOG INTO A MESSAGE. If you do that, I will not respond.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post shutdownStall, spin, or hang logs — they're very long and not helpful.

  • Web session and authentification session pb with wl6.0

    Hi,
    I am evaluating weblogic 6.0 on windows 2000.
    I have a little web application, with some URL (html, servlet...), I want to protect.
    So I defined a <security-constraint> element in my web.xml
    file, and I binded the logical roles with real participant in
    weblogic.xml
    It works very well at startup. I launch a browser, request a protected URL and the
    authentification window popup. I enter valid info and I can access my URL.
    Perfect.
    Now I want to give the possibility to my user to terminate a session, to disconmect,
    so I had a button, (disconnect) which invoque a servlet which get the current session
    and invalidate it.
    I checked, the session is destroyed and a new one is defined (new ID, new counter...),
    but my user are still connected. It means that if I want to acces a protected URL,
    I still can do it.
    more strange. In both a secured and unsecured page I print the User Principal. When
    I connect, the two pages print the same and right value.
    But if I disconnect, the unsecured page print null(no connection for this session)
    and the secured page print the principal I used to connect in the previous message.
    I know this message is a little bit long, but I tried to give the cleares context.
    Has anyone ancountered that kind of problem? Is there a solution.
    I pass the test with netscape 4.76, netscape 6.01, Internet Explorer 5.50. I got
    the same behavior each time...
    Thanks
    Nicolas

    If you use a Form to authenticate then the browser is unaware of the
    username and password. The PetStore demonstrates how it's done in
    ..\samples\petStore\source\com\bea\estore\util\WLSecurityAdapter.java
    "Nicolas GANDRIAU" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi John,
    thank you for your answer. It confirmed my first guess, that the
    browser keep the secret info and send them back to the server.
    The server does not make any attachment with the current session.
    But you talk about a "ServletAuthentication" example which presents theway to bind
    the login info in the session. I have not found this servlet, in weblogic6.0 distribution
    or J2EE API.
    Can you give me the exact reference of this servlet.
    Thank you for your help.
    Nicolas
    "John Lindwall" <[email protected]> wrote:
    Nicolas,
    It is my understanding that the authentication information for this
    scenario
    (ie HTTP BASIC authentication) is not contained in the session -- it is
    maintained by the browser and resent with every request. That is why
    invalidating the session makes no difference. If you have a HTTPsnooping
    utility you will see the "Authorization" information (albeit encodedusing
    BASE64) present in the requests from your browser to the server.
    FYI: I've noticed that by using the ServletAuthentication class tomanually
    perform authentication, it DOES in fact store the authentication info in
    the
    session. There is a "done()" method in this class which removes thisinfo
    from the session (ie performs a logout).
    If this link reproduces properly, check it out -- it's a good simple
    explanation of what's going on:
    http://www.support.lotus.com/sims2.nsf/852561c1006719a98525614100588964/877
    a
    0ac029a78f8a8525645f0069a34d?OpenDocument
    For tons of detail on BASIC authentication see
    ftp://ftp.isi.edu/in-notes/rfc2617.txt
    John
    Nicolas GANDRIAU <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am evaluating weblogic 6.0 on windows 2000.
    I have a little web application, with some URL (html, servlet...), I
    want
    to protect.
    So I defined a <security-constraint> element in my web.xml
    file, and I binded the logical roles with real participant in
    weblogic.xml
    It works very well at startup. I launch a browser, request a protectedURL
    and the
    authentification window popup. I enter valid info and I can access myURL.
    Perfect.
    Now I want to give the possibility to my user to terminate a session,to
    disconmect,
    so I had a button, (disconnect) which invoque a servlet which get thecurrent session
    and invalidate it.
    I checked, the session is destroyed and a new one is defined (new ID,new
    counter...),
    but my user are still connected. It means that if I want to acces aprotected URL,
    I still can do it.
    more strange. In both a secured and unsecured page I print the UserPrincipal. When
    I connect, the two pages print the same and right value.
    But if I disconnect, the unsecured page print null(no connection for
    this
    session)
    and the secured page print the principal I used to connect in the
    previous
    message.
    I know this message is a little bit long, but I tried to give the
    cleares
    context.
    Has anyone ancountered that kind of problem? Is there a solution.
    I pass the test with netscape 4.76, netscape 6.01, Internet Explorer
    5.50.
    I got
    the same behavior each time...
    Thanks
    Nicolas

  • Problem with Sessions and window.open

    Hi,
    Hi everyone,
    Help Please!!!
    I am working with Sevlet session objects and HTML forms and windows. I have an HTML form for the user to supply a username and password. Once the user clicks submit I need to open another browser window that has no toolbar, no location, no status bar, etc. The user should also be able to go back to that login screen and login again and open a 2nd, 3rd, etc. instance of the application. My problem is that each application is being asigned the same sessionId. I believe it is being asigned to the main login window and thus to the other child windows it opens. Is there a way to work around this? Do I need to make the user open another browser window to login? I need to be able to let the user open multiple instances of the application with unique session ids for each.
    Any insight is GREATLY appreciated on this topic. Anything you can tell me about sessions (Java), IE, window.open would help greatly!
    THANK YOU IN ADVANCE!!!
    MA

    To achieve this, you must introduce another level of
    abstraction to the Servlet specifications. When you
    work with JSP/Servlets you use mostly the HttpSession
    to handle user related tasks, and the aplication
    context, for things that are common to all users. But
    inside the HttpSession scope, you want to create
    containers that have 'smaller' scope and are uniquely
    identified.
    A ipothetical scenario :Let's say that you must have
    multiple connections to several databases, on each
    database user rights beeing diferrent, and you must be
    able to track user actions globaly, and eventualy
    capture a 'Close Application event' and close all db.
    connections.
    1. when the user first accesses the login frame create
    the HttpSession. In the HttpSession object, store a
    Hastable (let's call it 'ConnectionTable'). Each
    object in the Hashtable must identify uniqely a
    database connection. Now, to create unique identifiers
    ids, make the keys in the hashtable java.lang.Long
    objects, created using System.getCurrentTimeMillis().
    This guaranties there will be no possible confusion.
    From each new open window, on each request to the
    server, along with the usefull parameters, send the
    connection identifier. When proccessing the request,
    select the object from the Hastable wich corresponds
    to the ID.
    2. Now, the values in the ConnectionTable, must act as
    the containers that I mentioned in the first
    paragraph. The simplest way to do this is to have
    again a Hashtable derived class to do the job, wich
    exploses methods similar to HttpSession: setAttibute (
    Object key, Object value) and getAttibute ( Object
    key, Object value). This container may use internally
    a Hashtable to store object, and explose only the
    getAttribute and setAttribute methods for clarity. Any
    way, this is a problem of implementation. Let's call
    this class CustomSession.
    Now, a textual activity diagram:
    1 user accesses the main page, you start a new
    HttpSession; In the HttpSession object, store the
    ConnectionTable object.
    2. the user enters the userID and pwd and adatabase
    name, and a new window is opened. Let's supose the
    data entered is valid.
    3. when you process the login data, you create a new
    CustomSession object. you put in it whatever you would
    put in your HttpSession. You generate a unique
    identifier using System.CurrentTimeMillis(). Put the
    CustomSession object in the ConnectionTable, using the
    generated id as key. Send the response.
    ..... later on .....
    100. the user asks for a particular action to be
    performed - e.g. a row deletion. The page contains a
    form with text field where the user introduces the
    row number, a submit button and a hidden input with
    the ID.
    101. you process the data. Get the ID from the request
    object, get the ConnectionTable from the session, get
    the CustomSession using the ID as key, do whatever
    your logic was doing, but obtaining the objects from
    the CustomSession instead of HttpSession
    NicNic,
    Very slick idea. I think that it could work and it seems that there would be not security issues because the id that you would store on the client side is the Unique Identifier and not the actual Session Id. Do you forsee any security issues for this implementation?

  • How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    How do I fix the compatibility issue between my iPhone 4S with iOS 7 and my Pioneer car stereo? There was no problem with iOS 6, but now I get a message saying "this device is not compatible" and so I can't use Netflix for example. How do I fix it?

    This is a typical response from the manufacturer. Did you try the fix that Lawrence mentioned. When Apple or any other phone manufacturer update phone software, they have the latest Bluetooth installed. It is usually the problem with the radio manufacturer that they devices are using the older Bluetooth protocols. You can try this support document http://support.apple.com/kb/TS3581 and see if anything there helps, but generally it requires the radio manufacturer to update their firmware.

Maybe you are looking for

  • After the latest firefox upgrade and the Adobe Flash Player upgrade, Silverlight, which runs Netflix Instant, is not working... any connection? Thanks!

    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 GTB7.1 That is my system info ~ my firewall is open and I have no anti-virus software installed. On Netfilx, when I click Play on an Instant movie, a sc

  • In po print inr and euro both appearing

    Hi Experts, We are using sap script for PO print where the euro value is zero but still it is appearing in print preview and print. The document currency is INR only, in script the any of the following lines are getting true although the variable val

  • Prompt in PL/SQL block

    Hi, I want to prompt procedure name and it's version during execution of procedure...? I am new in PL/SQL part, not sure whether it's possible or not? dbms_output.put_line gives output after execution and after setting serveroutput 'ON'.. Is there an

  • Export from IPad Camera to google or any where?!

    HI.  I just recorded a video with the Ipad camera.  I am told it is to long to email and the ipad asks me to "select" a section.  I need the entire thing. How can I export it?  Is there a way to compress it?  There is no "desktop" to save it to.  It

  • RPM for R12

    Haiall, Am using note. 555876.1 to install R12 in linux .am uanble to find the following RPM's.. glibc-2.3.4-2.25.i686.rpm (32-bit) glibc-devel-2.3.4-2.25.i386.rpm (32-bit) glibc-devel-2.3.4-2.25.x86_64.rpm libstdc++-3.4.6-3.i386.rpm (32-bit) libstdc