How do i use the jsp session in web application

pls i do i go about trying to maintain a user in a web application when he sign in so that his state would be mainain through out the other pages and also adding sound to my pge the page is being design with jsp thank u frm hamzah

I see what you are saying.
The JNDI approach should work-we will try to reproduce this internally.
I would recommend leveraging the OSGi service registry, instead of using JNDI, however. The Event Server is a modular server based on OSGi, so one should use the OSGi service registry whenever possible instead of using the jndi registry. Jndi is primarily there to support legacy code that requires Jndi.
Any data sources that you configure are automatically registered in the OSGi service registry. When there is more than one data source they can be distinguished using their name.
There are a couple of options.
If you want to inject a reference to your datasource into a Spring bean, you can use an annotation, @Service, to annotate a setter method on your bean (see my previous post). The container will then inject a reference to the data source into the bean.
You can also put the following in your spring application context file
<osgi:reference id="myDataSource"
interface="javax.sql.DataSource"/>
This creates a bean proxy that references the datasource by looking up the datasource in the OSGi service registry. It works similarly to JndiObjectFactoryBean, but it uses the OSGi service registry instead of the JNDI registry. You can read more about it here
http://www.springframework.org/osgi/specification
(Look in section 3.3)
Hope that helps.
Seth
Edited by swhite at 08/01/2007 6:19 PM

Similar Messages

  • How can i use the dbms_lob.session

    hi
    i need to use the dbms_lob.session in my procedure but it didn't work in the client_side (in the form side )
    and i use this procedure in the database side but when i call it from the form it will giv me an error because this package(dbms_lob.session)
    any one have an answer
    10x

    Hi,
    In order for you to be able to load the sample project into the session console you need to do the following:
    1) Start HSQL
    2) Run successfully the demo in "D:\toplink903\examples\core\examples\sessions\threetier"
    3) Add to the file "sessionconsole.cmd" the above classes location.
    It should look something like this " set CP=%TL_HOME%\core\lib\toplink.jar;%TL_HOME%\workbench\demos\democlasses.zip;%TL_HOME%\core\lib\xerces.jar;%TL_HOME%\hsql\lib\hsqldb.jar;D:\toplink903\examples\core\examples\sessions\threetier\stage;%CLASSPATH%; " Please note the ...threetier\stage
    4) Open the sessionconsole -> log into the DB -> and load the project "employeeProject.xml". You should be able to find the xml project file in "D:\toplink903\examples\core\examples\sessions\threetier"
    Raanan.

  • How can I use the same session for different components acroos application ?

    I am trying to include the components(chat, filesharing, whitboard) in different parts of my application. User should be able to access any of the component. We would like to have a single "ConnectSessionContainer" so that we don't see same user creating a seperate session for each component.
    Is there a better way of dealing with this other than declaring the "ConnectSessionContainer" in the main application ? Is there a way to check if we have a "ConnectSessionContainer" session already established ? Please help . Thanks.

    Thanks for the response. Let me explain what I am trying to do..
    I am trying to create components at different places(screens) of the flex application (not in the same .mxml file).
    Each time I create a component, I am using a "AdobeHSAuthenticator" and "ConnectSessionContainer" which is resulting a new participant in the room.
    For example
    screen1.mxml -
    <mx:Panel>
    <rtc:AdobeHSAuthenticator id="auth" authenticationSuccess="onAuthSuccess(event);" authenticationFailure="onAuthFailure(event);" />
    <rtc:ConnectSessionContainer id="mySession" >
            <rtc:Roster id="myRoster" width="100%" height="100%" />
            <rtc:Chat id="mychat" width="100%" height="100%" />
    </rtc:ConnectSessionContainer>
    </mx:Panel>
    screen2.mxml (in the same application) -
    <mx:Panel>
    <rtc:AdobeHSAuthenticator id="auth" authenticationSuccess="onAuthSuccess(event);" authenticationFailure="onAuthFailure(event);" />
    <rtc:ConnectSessionContainer id="mySession" >
            <rtc:SharedWhiteBoard id="wb" width="100%" height="100%" />
    </rtc:ConnectSessionContainer>
    </mx:Panel>
    Here, I open a screen1 and authenticate as UserA and when I try to open screen2 flex is considering me as another user though I am in the same application.
    1) How can I use different components which are in different flex files as a same User ?
    2) Should I place my <rtc:AdobeHSAuthenticator> and <rtc:ConnectSessionContainer> in the main application which calls the screen.mxml?
    3) What is the best way to do it ?
    Thanks for your time !

  • How can i get the realpath of my web application in jsf manage bean

    in jsp, i can use application.getRealPath("/")
    but in jsf how can i get the realpath in manage bean and initializean variable.
    thanks

    FacesContext aFacesContext = FacesContext.getCurrentInstance();          
    ServletContext context = (ServletContext)aFacesContext.getExternalContext().getContext();
    String rootpath = context.getRealPath("/");
    i use the code like that ,it can work , but when i click a button in my web page and call a function of java bean to read a file in "rootpath" , only odd number click it do well , even number click it do nothing and navigate to a blank page.
    how can i do that ,.
    my english is too pool ,sorry.

  • How to change image in jsp in a web application

    I had created a web application in which I have given the option to change the image in a jsp, and I am saving that image in a folder.
    The image is saved during the run time.But I am not getting that changed image.
    If I restart my server the image is retrieved . What is the solution for getting the changed image during the runtime itself?

    use javascript
    example:
    <img id='img' src="Img1.gif" border=0
         onMouseover="document.getElementById('img').src='Img2.gif'"
         onMouseout="document.getElementById('img').src='Img1.gif'">

  • Cannot use the double-click in web applications

    In firefox mobile, the double-click ask for a zoom on a specific part of the page.
    The double-click is used by many web applications (like webmails to open a mail in the list), but the event seems not to be sent to the application.
    Is there a way to disable this behavior ? I have not found a related configuration key...

    You should be careful with overriding the extensions compatibility check.
    Create a new profile exclusively for the 4.0 beta version and create a desktop shortcut with -P "profile" appended to the target to launch that profile.
    * http://kb.mozillazine.org/Testing_pre-release_versions

  • How do i use the text highlighter on web pages

    I want to highlight some small print on a banking web page to email. The print is too small and will be missed if not highlighted. I have installed the text highlight add on in my tool bar but don't know how to use it.

    Hi Trease,
    Check to make sure that is it is not disabled in the about:addons page of your browser window.
    There are a few addons with that name, but I would also take a look at the description on its addons.mozilla.org page if you still have it.

  • How I can gain the variable value in web-application?

    Hi,
    I have a web-template with several web-item. The data provider refers to a query with a variable screen.
    After the report run and the table is displayed, i have need to set a paticular filter-item with the variable value that i put in pop-up screen.
    Therefore I am trying a function or method in order to pass the variable value (pop-up variable).
    Help me, Thanks in advance

    Hi Ciro,
    in the Web item properties of the Text element web item you can specifically select in the ITEM_LIST a list of text elements. For variables you can choose if you want to display text or key values. This should work for the print template.
    With the Excel display I'm a bit unsure. There is a BEx Function called SAPBEXshowTextElements that allows you to display the variable values. I just don't know if you can execute it in the SAPBEXonRefresh. You can find additional information in the BW help under Business Explorer->Analysis & Reporting: BEx Analyzer->Queries in Workbooks->Integration with Visual Basic for Application (in the BW 3.1 documentation).
    Another thing that might work is to add another navigational attribute to the needed InfoObjects with reference to the InfoObject. While loading Master Data you can fill the navigational attribute with the same value as the characteristic. Then you can drag the variable into the filter and put the Navigational attribute into the query.
    Example: You have the IO 0COSTCENTER that you want to put a filter on. Create an IO COSTC_N (Costcenter Navigation) with reference to 0COSTCENTER and insert it into 0COSTCENTER as navigational attribute. While loading Master Data for 0COSTCENTER fill COSTC_N from 0COSTCENTER.
    In the query put COSTC_N into the filter box and create a fitting variable. 0COSTCENTER can now be displayed in the rows and the filter values for COSTC_N are displayed in the query.
    Best regards
       Dirk

  • How can i access the jsp file in a asp file

    Hi every one..
    we have two projects one is developed in ASP and one is developed in JSP both are running in two different locations.
    now i want to include a jsp file from one project to ASP file in the other project.
    please tell me how can i insert the JSP file in ASP application.
    thanx in advance.

    Wouldn't that be an ASP question for an ASP forum?

  • How to share the same session between JNLP Application and browser session

    How to share the same session between JNLP Application and browser session using BasicService.showDocument(url) method? It appears whenever i launch any URL from within a JNLP application using BasicService.showDocument(url) , it creates new instance of browser and session even after i used cooke handlers to restore JSESSIONID and Ltpa token etc.
    public static int showDocument(String urlToOpen)
    BasicService obj = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService");
    obj.showDocument(urlToOpen);
    }

    Try using Reflection

  • How can I use active user session that's in an application scope Hashtable?

    First of all, is it possible to use the same session after a user exits and then returns?
    Second, if it is possible, then please tell me what I need to do. So far, this is what I have been doing...
    1.) The user submits login credentials
    2.) The user is authenticated.
    3.) The user does not have an existing session, so a new one is created.
    4.) The user closes the browser.
    5.) The user returns to login page and submits login credentials.
    6.) The user is authenticated.
    7.) The user has an existing session, so it should be used.
    This is where I'm having trouble. All active sessions for my application are stored in a Hashtable. I have been using <%@ page session="false" %> so that a new session is not automatically created. Each time before I create a new session, I check my Hashtable to see if that user has an existing session. If a session exists for that user, then I would like to continue using that session if possible. I have used the methods request.getSession() and request.getSession(false), but a new session is always returned.
    I could create a new session, copy the attributes from the old session(which is stored in my Hashtable) to the new session, and then invalidate the old session, but I'd rather not do that.
    Is there a way that I can use existing sessions that I have stored in my Hashtable?

    First of all, is it possible to use the same session after a user exits and then returns?No, I don't think so. Let me explain why. When the server creates a session object for each client, it needs to know which client is making the request. Remember that HTTP is a stateless protocol. Every time a client makes a request, it sends some sort of session id to the server to let the server know who is trying to make the request. The server will then check to see if a session object exists for that particular client and if so, it will make sure that the max inactive interval (maximum time alloted for that client's session) has not been exceeded. If every thing is okay, then the client can access the session object to get values that were previously placed there. There are many ways that servers try to keep track of clients. One way is to have the clients write the session ID using cookies. But, many people like disallow cookies. So some servers do what is known as URL rewriting. That is, they will write the session ID on the end of the query string. This can also be accomplished programmatically, but it can be taxing to do. Anways, the point is that the client and the server have to have some sort of link between each other and that link is the session ID. So, if the browser is closed, the session ID is lost. That particular client will be forced to get a new session ID the next time the following code is executed:
    //create a session object and set its values
    HttpSession session = request.getSession(true);>
    Second, if it is possible, then please tell me what I
    need to do. So far, this is what I have been doing...
    1.) The user submits login credentials
    2.) The user is authenticated.
    3.) The user does not have an existing session, so a
    new one is created.
    4.) The user closes the browser.
    5.) The user returns to login page and submits login
    credentials.
    6.) The user is authenticated.
    7.) The user has an existing session, so it should
    be used.If you really want to do something like this, you could make up your own ID and store it as a cookie on the client. I've never tried anything like this before so you would have to do your own research. Are you sure you want to do something like this. There is a reason why it works the way it does. There is also a reason why you want to keep the session timeout value some what small. Let me give you an example of some craziness with sessions. A client we once had wanted to keep their sessions open for 4 hours because they said there clients simply did not like to log in all the time. I nearly gasped when I was told we needed to do this. When you make the session time out large (i.e. the maxInactiveInterval( )), then session objects stick around longer in the server. Let's say a client logs into the server and receives a session object. Then, the client makes a few requests. The server knows to keep the session alive as long as the time between requests has not exceeded 4 hours. Then the client closes the browser. How is the server suppose to know that the browser was closed. Well, it doesn't. It just knows to check times between requests. So, that particular session object won't be garbage collected until the session times out. What if a whole bunch of clients did this. Yucko. The server would have a whole bunch of session objects living in memory. What a waste. This is all above and beyond the typical security problems that can arise from having a session open for so long. To make a long story short, you really shouldn't do what you are trying to do unless it is the nature of the app.
    >
    This is where I'm having trouble. All active sessions
    for my application are stored in a Hashtable. I have
    been using <%@ page session="false" %> so that a new
    session is not automatically created. Each time
    before I create a new session, I check my Hashtable
    to see if that user has an existing session. If a
    session exists for that user, then I would like to
    continue using that session if possible. I have used
    the methods request.getSession() and
    request.getSession(false), but a new session is
    always returned.
    I could create a new session, copy the attributes from
    the old session(which is stored in my Hashtable) to
    the new session, and then invalidate the old session,
    but I'd rather not do that.
    Is there a way that I can use existing sessions that I
    have stored in my Hashtable?

  • How can i use the project code instead of project xml?

    hello
    i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
    i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
    otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
    thank you very much?

    There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
    When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
    When using the project-class you simply replace the project-xml entry like this:
    <project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
    The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
    Doug Clarke
    Product Manager
    Oracle9iAS TopLink

  • How can we execute the BDC session in error mode through se38 programme

    Dear Experts,
    How can we execute the BDC session in error mode through se38 programme....
    we can execute the session in the below 2 ways
    1) Through SM35 we can process the session manually in foreground/Error mode or Background also.
    2) through RSBDCSUB (standared Program) we can process the session in back ground.
    But i want to process the session in foreground or Error mode..Do we have any standared program for process the session in foreground or error mode.
    Please suggest.
    Regards,
    Bussa.

    Hi,
    SAP was smart enough to provide this little program: RSBDCCTU
    Sandra
    Edited by: Sandra Rossi, 15 minutes later
    Maybe the answer to your question is just to use CALL TRANSACTION ... USING ... (see the example in RSBDCCTU). You can also generate such a program using transaction SHDB

  • How can I get the same session with jdbc?

    HI
    After I create or use a JDBC connection,
    i do a query.
    How can I get the same session next time?
    thanks a lot!

    Hi qin,
    Unless I have misunderstood your question, a 'connection' and a 'session' are the same thing. When you obtain a database connection, you have created a database session. Once you close that connection, the session dies -- it no longer exists. You cannot obtain the same 'session' when you get another database 'connection' (after you closed the first one).
    Hope this answers your question.
    Good Luck,
    Avi.

  • How do I use the Japanese fonts in Font Book in a Pages document?

    How does one use the Japanese fonts in Font Book in a Pages document. Pages has its own fonts but I cannot get the Japanese fonts into it.

    To type japanese on a computer you change the keyboard, not the font.  Go to system prefs/keyboard/input sources and add Japanese/Kotoeri to the list, then select Hiragana in the "flag" menu at the top right of the screen, then type.  The font will take care of itself.
    http://redcocoon.org/cab/mysoft.html
    If you have any further questions, just ask.

Maybe you are looking for

  • How to change the owner of a GPO using command line/script? - More than 200!

    I have more than 200 GPOs on the AD DOmain Half of the GPos were created by sveeral different people or are owned by the domain admins How can I change all of then, to a new owner, using the more "quick and easy" method? there a tool/utility for that

  • Aperture 3 trial version hangs and quits

    I downloaded a trial version of Aperture 3 to try it out since I liked the added features. I currently use iPhoto. Everything went fine until I did the iPhoto import. Now, every time I start Aperture, it either hangs and becomes unresponsive, or quit

  • Pdf form -- Web form?

    I created a pdf fillable form using Acrobat 9 and imported it into FormsCentral.  Everything works fine!  Is it possible now to make the form fillable as a web form?  That would be not just a homerun, but a grand slam for me!

  • Download problem with Adobe Flash Player 11

    I downloaded Adobe Flash Player 11 a long time ago, when it first came out; however, every time I need it, I get a window saying I need to download Adobe Flash Player in order to view it. What in the world is happening that it isn't downloaded and th

  • HT201210 I cannot update or restore my iPhone4

    I am getting error message "device ineligible" when I try to restore or update my iphone using my MacBook pro. With other macbook pros I could do the update.