How to use the same bean from Jsp and Servlet

I want to use the same bean instance from both the servlet and jsp.
for eg. if a create a bean using the jsp:useBean in servlet and if a modify some values, that values should be reflected while i access the same bean from the servlet. But instead of that the servlet is creating a new instance of the bean.
is it possible?
Thanks in advance

Hi,
When you call jsp:useBean you inform a scope (session, request, page...)
This means the bean instance will be stored in that scope.
So, if the informed scope is session, then, in the servlet you could get the bean instance back from the session, this way:
HttpSession session = request.getSession();
Bean b = (Bean) session.getAttribute("bean_id");
Regards,
Filipe Fedalto

Similar Messages

  • How to use the same image map over and over

    Sorry, I posted this a couple of years ago and got a good answer by Murray. I'm so rusty with it, I can understand how it works anymore.
    Question:
    I have a large jpeg image map for a hundred pages. The jpegs are all the same except I changed the city name for each one.
    So for each corresponding htm page, the 4-5 links out are the same.
    Waht is the trick to not have to create by hand hotspots? thanks.
    I have previous notes, but I don't understand anymore, (too rusty) what they mean:
    The good news is that you really don't need a template at all.
    Just open one of your existing pages in DW, select that central image, browse to select the correct replacement image, and save the page with a new name.  It will have all of the image maps already there, from the original image.  One and done as they say."
    My old interpretation of this:
    select the large jpeg and then in link field drag over to the new city jpeg

    Ok, Nancy, code copy/ paste did work fine.
    what does this mean:
    "Change the image in the properties panel to display your new image."
    (the image is displaying ok)
    NEverthesless, I think I got Murrays old notes.
    Here is my new version of Murrays writing, easiest way I think:
    You open up a pre-existing html, say Chicago. Then drag over with pointer to the new jpeg you want (Buffalo). It replaces Chicago with the buffalo jpeg, all links work perfectly. Then do a save as called Buffalo.

  • HT204053 We both use the same iPad my father and I as of today, because I am using it too from now on, but each time the ID & Password pops up it ask for his, how can I access mine, so it's my account and financials being used. Thanks to any of those gift

    We both use the same iPad my father and I as of today, as is letting me use it too from now on (sweet! ), I do not want to make a mistake and accidently use my father's ID & passwords (dohh ), but each time the ID & Password pops up it ask for his (???), how can I access mine, so it's my account and financials being used. Thanks to any of those gifted with this knowlegde... AMAKANGAROO

    In order to reliably save the info and be able to restore at a later date, you would need to use his AppleID.
    Switch to it on iTunes, back the iPad up and confirm the backup exists (Preferences / Devices), then switch to yours, wipe the iPad and start afresh. Will also wipe his apps, as they are tied to the AppleID as well.

  • How to Use the same iview for both KM End User and the KM Administrator

    Hi friends,
    *This is my scenario :* How to Use the same iview for both KM End User and the KM Administrator but with different Context
    Menu Options.
    i followed these steps but im getting same context menu for both KM End User and the KM Administrator .
    Assign the role Content Administrator to the user km_admin. This is needed so that km_admin can change
    the presentation settings for the KM Folder u201EReports_kmFolder‟.
    Now, login with user km_admin. Navigate to the Km Folder reports_kmFolder through Content Administration
    -> Km Content. Click on Details link of the folder reports_kmFolder.
    Go To Settings -> Presentation. Click on the tab u201ESettings for You‟-> Click on button u201ESelect Profile‟.
    Select the radio button corresponding to u201Elayout Set‟, and choose u201EConsumerExplorer‟ from the dropdown.
    Click u201EOK‟.
    Select both the check boxes corresponding to Items Affected as shown above, and click u201ESave‟
    Now, remove the u201ESuper Administrator‟ role from the user km_admin and login with this user.
    How rto resolve this????
    Regards,
    Prasad.

    Hello Prasad,
    Most likely the user km_admin still has system principal roles assigned, even though you removed the Super Admin role, you should check that this user doesn't have any other admin roles, otherwise it will be considered a System Principal user and will therefore still have access to all content. For more information see http://help.sap.com/saphelp_nw70/helpdata/en/19/56f28fbd4e11d5993b00508b6b8b11/frameset.htm
    Try creating a new user with just read access to the content and you should see that it will not be able to make any changes etc.
    Regards,
    Lorcan.

  • How to use  the same channel to send a file and messages to the server

    I'm trying to develop a simple program that will send and receive files from the server and in the same time I need to communicate with the server through the messages
    I'm using TCP Socket
    my problem is
    I have only one channel
    so, I have no option, either I can use it for sending the file itself or sending the message .. but not both !
    my question is : How can I use the same channel for sending and receiving (file & message)
    I would appreciate for any clue or hint
    best

    kajbj wrote:
    kmarwani wrote:
    Thanks for reply
    yes, that what I'm thinking to do
    but, in case of sending binary file, if I attached a flag on its header, will it corrupt the file ?
    bestThe other end would of course need to decode the messages that you get, and only write the "data" part to the file.Thanks
    I'm gonna try to hard-code what you suggest and i will post what happen with me here
    even though I'm not sure how can I add header to a binary file and remove it from the file at other end. (coz I read it as stream and send as array without touching its contents)
    this how I'm sending the file
    ConnSocket = CSocket.accept();
    ToClient = new DataOutputStream(ConnSocket.getOutputStream());
    File myFile = new File("abc.jpg");
    FileInputStream myFileInStream = new FileInputStream(myFile);
    BufferedInputStream mybuffInStream = new BufferedInputStream(myFileInStream);
    myBytArray = new byte[(int) myFile.length()];
    mybuffInStream.read(myBytArray, 0, myBytArray.length);
    ToClient.write(myBytArray, 0, myBytArray.length);
    ToClient.flush();
    myFileInStream.close();best

  • How to use the same services-config for the local and remote servers.

    My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="amfphp-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="amfphp">
                    <channels>
                        <channel ref="my-amfphp"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    I think the problem  is the line
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    but I'm not sure how to use the same services-config for the local and remote servers.

    paul.williams wrote:
    You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
    The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
    Hi Paul,
    In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
    -services=path/to/services-config.xml
    IF
    services-config.xml
    have tokens in it and user have not specified additional
    -context-root
    and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
    Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
    for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
    -services=path/to/services-config.xml
    have been specified durring compilation.
    I dont know any better way to exmplain this, but in summary there is two places that you can tell swf  about service confogiration,
    1) pass -services=path/to/services-config.xml  parameter to compiler this way you tell swf file up front about all that good stuff,
    or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .

  • How to use the same email address for outgoing email on two iPads?

    How to use the same email address for outgoing email on two iPads?.   My wife and I both use the same email address.  We receive the same incoming email on both iPads but are unable to send email from my wife's iPad.  She is using an iPad 2 and is usng IOS 6.0.1

    Hi Creaturekeeper,
    If you've added the account into the iPad and you are unable to send email from it, then please follow the troubleshooting in the article below.
    Get help with Mail on iPhone, iPad, and iPod touch - Apple Support
    Take care,
    Alex H.

  • How use the same variable in read and write way?

    I don't know how to use the same variable in a .vi like an indicator and a
    control at the same time.
    Can someone help me?
    Thnks.

    Thanks!!!
    I'll try.
    "Adam Russell" escribió en el mensaje
    news:bkavdl$rd021$[email protected]..
    > Create local variables from the control (or indicator) and you can make
    > each local either read or write. Be careful of race conditions.
    >
    > "Urban" wrote in message
    > news:bkam3b$c4k$[email protected]..
    > > I don't know how to use the same variable in a .vi like an indicator and
    a
    > > control at the same time.
    > > Can someone help me?
    > >
    > > Thnks.
    > >
    > >
    >
    >

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use the same OC4j server with different port number

    How to use the same OC4j server with different port numbers..?
    I have to OC4J installed on my machine on different hard disk drives....
    I want to be able to run both the server simultaneously..?
    is it possible ..it yes then how..?
    for that i have changed the port number of one server...
    but when i am trying to start the other server with different port number..it says that JVM -Bind already...
    Is there any clues...?
    Nilesh G

    In the config directory:
    default-web-site.xml: Change the port the HTTP listener listens on
    jms.xml: Change the port the JMS service listens on
    rmi.xml: Change the port the ORMI listener listens on.
    Or, you can add another web-site.xml file, and deploy your applications to 1 server, and bind the web applications to the different web sites. This way you only have to deploy your applications to 1 place.
    Rob
    Oracle

  • Can i have 2 Apple IDs using the same playlist from the same pc?

    can i have 2 Apple IDs using the same playlist from the same pc?

    Easiest way is to create separate computer logins with all your own info including your own iTunes library.
    I recommend each individual not have more than one AppleID because you will have purchases on multiple accounts 
    You can use more than one AppleID in an iTunes library.
    AppleID/iTunes =used for purchases.
    iTunes library = iTunes and all media on your computer.

  • I lost my Iphone 3GS. My brother has given me his Iphone 4 now. We both use the same notebook to update and sync our phones. I would like to know how can i reconnect back to my account using the Iphone which was previous used by my brother.

    I lost my Iphone 3GS. My brother has given me his Iphone 4 now. We both use the same notebook to update and sync our phones. I would like to know how can i reconnect back to my account using the Iphone which was previous used by my brother.

    If you are saying that you both have iCloud accounts and use the same icloud ID, then yes, the contacts will be deleted.  The idea is that all devices using the same icloud ID are kept in sync.  You need to use different IDs.  You can keep the same iTunes ID so you can share the songs and apps.  But use different icloud IDs.

  • Trying to pay my bill, could you use the same information from last month

    Trying to pay my bill online, It keep saying wrong cvv, could you just use the same information from last month to pay bill? Haven't anything changed.

    Debit cards are no longer accepted in the iTunes Store, it seems. The current valid payment methods are listed here:
    http://support.apple.com/kb/HT5552
    You can try contacting the iTunes Store and asking if there is any way to use your card, but they probably will tell you that it's not possible.
    http://www.apple.com/emea/support/itunes/contact.html
    Regards.

  • How to use the Variants in SAP Transportation and what is its use ?

    Hi experts,
    How to use the Variants in SAP Transportation and what is its use & How to create a variant in SAP ?
    Can anybody answer this ?
    Regards,
    Shakti

    Hi,
    If you are asking about "slection vairants" in SPRO settings of "shipment cost document" then
    When it is activated,
    each user can have his own slecetion  and list criteria for
    1. List shippment costs:calculation
    2. List shippment costs: settlement
    This can be directly saved from VI01 screen by the user.
    from environment> lists
    This is user specific only.
    Hope this helps.
    Regards,
    Sharan

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

Maybe you are looking for

  • Upload of GL balances in mid year go live

    Hi gurus, appreciate if you can please tell me things to keep in mind and steps to upload balance sheet and p&l accounts in mid year go live in May and also client wants to see p&l from January in sap????????? waiting for your reply. THanks

  • Create Delivery with Reference to Order

    Hi! All, While Creating the Delivery (VL01n) with reference to Sales Order i have a error. Even i maintained Material correctly. 'Storage location was deleted since material is not maintained correctly'. Plz give me suggestions, how to solve? Thanks

  • Delay afte I plug in headphones

    Like the subject line says I get a 2-3 sec delay after I plugin my headphones...I can be playing without them and it is fine, but when I try to play using the head phones I get the delay. I am using my 810-L10 Taylor plugin to the back of my 24inch i

  • HT4137 My ipad2 suddenly quit working.

    It's fully charged but won't turn on.  I've tried restoring it but I get an error 28 so I removed my security settings but still nothing.  The Apple logo comes on and the line to show progress appears but then they go away.  I've tried holding the sl

  • Why do the images break up?

    Hi All. Since I have switched from my Mac Mini over to the new Intel Mac Mini 1.66GHz/1GB RAM/100GB HDD, my display shows very frequent strange image and text break-ups. I tried to take a screen picture, but that corrected it. I have been able to tak