Executors inside a container

Hi. I need to use ExecutorService inside my application.
Application is targeted to intensive usage and I want to take advantage of Java SE 5 concurrency.
How can I use Executors inside Web container? Can I create ExecutorService and put it to ServletContext?
How can I use Executors inside EJB container? Can I put it to JNDI?
Is there any restrictions or special conditions to do this?

Frank,
Thanks, wasn't sure what extra information to provide but I'm running 11.1.1.3.0 of JDeveloper. If I create a two level tree data contol that works fine. When I add the third level I get the error yet I can navigate through the data control using the business components browser and the structure seems fine. I've tried two separate two level data controls; the first with the top two levels of the tree, the second with the bottom two levels of the tree. Both work fine but when I combine them into a single data control, then I get the error.
One of the problems I have is not knowing what the error means, so I have no idea what to start looking at to determine what to do to try to remedy it.
George

Similar Messages

  • Java.util.concurrent.ExecutorService inside J2EE Container

    I want to use the JDK 1.5 concurrency class ExecutorService for concurrent execution of data-access logic inside my oc4j web-application.
    I'm using the Factory Executors.newFixedThreadPool(6) for creating a thread-pool.
    I know that it's not a good practice to create new threads inside a j2ee container.
    Is there anything I have to think of or beware of??
    Perhaps anybody here has experience using the java.util.concurrent.Executor inside OC4J or an other j2ee container.
    Thanks, Harald

    Yes, I have used java.util.concurrent.Executor in weblogic 10 server.
    You can really improve the performance of the EJB application if you use the thread pool carefully with limited size say 100 threads, by creating a single instance of thread pool for the whole J2EE application.
    You have to control the life cycle of thread pool using the container's life cycle methods, create the thread pool only once and destroy every time you recycle your app.
    Good luck with the implementation :)

  • Centering an image inside its container

    Hi,
    I have been placing several images with text on a web page on which I have been using CSS3 to float the images either left or right so that my text wraps around the image.
    Now, at the bottom of this same page, I want to add a wider image that I do not want to wrap text around.  I just want the image to centered on my page (or in its container I guess I should say, which is a div).
    If anyone could tell me the best way to do this, I would greatly appreciate it.
    Thanks in advance,
    Paul

    Thank you Ken,
    I created the .clearing rule as you suggested and added the <hr class="clearing" /> after the end of the paragraph that wraps around my second (and final) floated image.
    After the <hr class="clearing" />, I have my image reference for the image I want to be centered inside its containing DIV as follows....
    <hr class="clearing" />
    <p><img src="Images/pk_38_41_43.jpg" alt="Membrane Casting Line" width="612" height="367" class="center"/></p>
    ...the class="center" is a class I created where I set the left and right margins to "auto", hoping that this would do the job.  This didn't work.  My image appears all the way to the left.  If you can give me a hint what I should do to get it centered, I'd really appreciate it.
    Thanks again for your help,
    Paul

  • IllegalStateException: ADFv: Not inside a container

    When accessing our UI application from multiple client sessions(browsers), we often get this exception while collapsing/expanding tree nodes. The issue happens only when we add new children to the node. Any idea what this exception is?
    [2009-10-07T04:25:12.312-07:00] [AdminServer] [WARNING] [ADF_FACES-00009] [oracle.adf.view.rich.component.fragment.UIXRegion] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: 0000IGiji9r37E7TrIaASY1An6lJ00006Z,0] [APP: oam_admin] [arg: /lhp/lhp.jsff] [arg: /oracle/am/security/taskflows/navigationtree/leftpane/Lhp.jsff] [arg: /oracle/am/security/taskflows/navigationtree/leftpane/Lhp.jsff] Error processing viewId: /lhp/lhp.jsff URI: /oracle/am/security/taskflows/navigationtree/leftpane/Lhp.jsff actual-URI: /oracle/am/security/taskflows/navigationtree/leftpane/Lhp.jsff.[[
    java.lang.IllegalStateException: ADFv: Not inside a container.
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.exitContainer(FacesCtrlHierBinding.java:672)
    at oracle.adfinternal.view.faces.model.FlattenedTreeCollectionModel.getRowIndex(FlattenedTreeCollectionModel.java:109)
    owIndex(FlattenedTreeCollectionModel.java:109)
    at oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils$1.getRowIndex(TreeRendererUtils.java:552)
    at oracle.adfinternal.view.faces.renderkit.rich.TreeRenderer._handleRowDelete(TreeRenderer.java:1171)
    at oracle.adfinternal.view.faces.renderkit.rich.TreeRenderer._handleDataFetch(TreeRenderer.java:989)
    at oracle.adfinternal.view.faces.renderkit.rich.TreeRenderer.encodeAll(TreeRenderer.java:231)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:527)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)

    Hello! Take a look at this thread
    Recursive tree issue
    This may help

  • Getting Not inside a container with tree (key attributes defined)

    Hello,
    I'm building an ADF tree with a recursive entity based query:SELECT ProjectIndicators.ID_COMPONENT AS ID_COMPONENT_KEY,
           ProjectIndicators.ID_PROJECT AS ID_PROJECT_KEY,
           ProjectIndicators.THE_VALUE,
           , res.ID_COMPONENT
           , res.ID_PROJECT
           , res.ID_MAIN_COMPONENT
    from PROJECT_INDICATORS_BA ProjectIndicators
    SELECT Project.Id_Project
           , Component.Id_Component
           , Component.Id_MAIN_COMPONENT
    FROM ...
    WHERE ... and Project.Id_Project = :Bind_IdProject
    ) res
    WHERE ProjectIndicators.Id_Project (+) = res.ID_PROJECT
          AND ProjectIndicators.Id_Component (+) = res.ID_COMPONENTNote there's a *:Bind_IdProject* peremeter inside a subquery.
    Queried data is:ID_COMPONENT_KEY     ID_PROJECT_KEY     THE_VALUE     ID_COMPONENT     ID_PROJECT     ID_MAIN_COMPONENT
                                                   1064             1003     
                                                   1065             1003             1064
                                                   1353             1003             1066
    1646                     1003                             1646             1003             1065
                                                   1586             1003             1066
                                                   1587             1003             1066
    1605                       1003              11             1605              1003             1065
    1625                       1003                          1625             1003             1065
                                                   1845             1003             1065
                                                   1846             1003             1845 ID_COMPONENT_KEY and ID_PROJECT_KEY are primary keys of PROJECT_INDICATORS_BA. THE_VALUE is a filed I need to edit (in case a row is null, a new row would be created on runtime).
    ID_COMPONENT and ID_MAIN_COMPONENT is a recursive relationship. ID_PROJECT is a foreign key.
    The recursive view link is
    Source            Destination
    IdComponent   IdMainComponent
    IdProject         IdProject
    Query
    (:Bind_IdComponent = ID_MAIN_COMPONENT) AND (:Bind_IdProject = ID_PROJECT)So I build a treetable on my page and the first (root) level looks fine. I can disclose a row and see the second level.
    But when I try to disclose any second level row I get java.lang.IllegalStateException: ADFv: not inside a container.
    Funny is that I can do "right click - disclose all" on any row, and I will see an entire tree without any errors.
    Seems, this messae should signal that there is no PK defined in the View Object, but here is prmary key definition:  <AttrArray Name="KeyAttributes">
        <Item Value="IdComponentKey"/>
        <Item Value="IdProjectKey"/>
      </AttrArray>Tricky is that the tree must show some records where primary keys are null. But still "disclose all" button works fine.
    I also tried a key like:  <AttrArray Name="KeyAttributes">
        <Item Value="IdComponentKey"/>
        <Item Value="IdProjectKey"/>
        <Item Value="IdComponent"/>
        <Item Value="IdProject"/>
      </AttrArray>But that only shows me a root level, no child records.
    Any help wpuld be appreciated.
    Thanks.
    ADF 11.1.2.1
    Found kinda workaround adding NVL to keys:
    SELECT nvl(ProjectIndicators.ID_COMPONENT, 0) AS ID_COMPONENT_KEY,
           nvl(ProjectIndicators.ID_PROJECT, 0) AS ID_PROJECT_KEY, And yet it works... but that seem to deliver me some DML troubles.
    Edited by: ILya Cyclone on Apr 25, 2012 4:54 PM

    Hello,
    I'm building an ADF tree with a recursive entity based query:SELECT ProjectIndicators.ID_COMPONENT AS ID_COMPONENT_KEY,
           ProjectIndicators.ID_PROJECT AS ID_PROJECT_KEY,
           ProjectIndicators.THE_VALUE,
           , res.ID_COMPONENT
           , res.ID_PROJECT
           , res.ID_MAIN_COMPONENT
    from PROJECT_INDICATORS_BA ProjectIndicators
    SELECT Project.Id_Project
           , Component.Id_Component
           , Component.Id_MAIN_COMPONENT
    FROM ...
    WHERE ... and Project.Id_Project = :Bind_IdProject
    ) res
    WHERE ProjectIndicators.Id_Project (+) = res.ID_PROJECT
          AND ProjectIndicators.Id_Component (+) = res.ID_COMPONENTNote there's a *:Bind_IdProject* peremeter inside a subquery.
    Queried data is:ID_COMPONENT_KEY     ID_PROJECT_KEY     THE_VALUE     ID_COMPONENT     ID_PROJECT     ID_MAIN_COMPONENT
                                                   1064             1003     
                                                   1065             1003             1064
                                                   1353             1003             1066
    1646                     1003                             1646             1003             1065
                                                   1586             1003             1066
                                                   1587             1003             1066
    1605                       1003              11             1605              1003             1065
    1625                       1003                          1625             1003             1065
                                                   1845             1003             1065
                                                   1846             1003             1845 ID_COMPONENT_KEY and ID_PROJECT_KEY are primary keys of PROJECT_INDICATORS_BA. THE_VALUE is a filed I need to edit (in case a row is null, a new row would be created on runtime).
    ID_COMPONENT and ID_MAIN_COMPONENT is a recursive relationship. ID_PROJECT is a foreign key.
    The recursive view link is
    Source            Destination
    IdComponent   IdMainComponent
    IdProject         IdProject
    Query
    (:Bind_IdComponent = ID_MAIN_COMPONENT) AND (:Bind_IdProject = ID_PROJECT)So I build a treetable on my page and the first (root) level looks fine. I can disclose a row and see the second level.
    But when I try to disclose any second level row I get java.lang.IllegalStateException: ADFv: not inside a container.
    Funny is that I can do "right click - disclose all" on any row, and I will see an entire tree without any errors.
    Seems, this messae should signal that there is no PK defined in the View Object, but here is prmary key definition:  <AttrArray Name="KeyAttributes">
        <Item Value="IdComponentKey"/>
        <Item Value="IdProjectKey"/>
      </AttrArray>Tricky is that the tree must show some records where primary keys are null. But still "disclose all" button works fine.
    I also tried a key like:  <AttrArray Name="KeyAttributes">
        <Item Value="IdComponentKey"/>
        <Item Value="IdProjectKey"/>
        <Item Value="IdComponent"/>
        <Item Value="IdProject"/>
      </AttrArray>But that only shows me a root level, no child records.
    Any help wpuld be appreciated.
    Thanks.
    ADF 11.1.2.1
    Found kinda workaround adding NVL to keys:
    SELECT nvl(ProjectIndicators.ID_COMPONENT, 0) AS ID_COMPONENT_KEY,
           nvl(ProjectIndicators.ID_PROJECT, 0) AS ID_PROJECT_KEY, And yet it works... but that seem to deliver me some DML troubles.
    Edited by: ILya Cyclone on Apr 25, 2012 4:54 PM

  • Handle "Enter" inside Custom Container

    Hi all,
    I am having 4 to 5 fields in my module pool screen and at the same time i am having a custom container wherein, there is editable ALV.
    Here in editable ALV, i am having an editable field called dealer code.When i enter dealer code in editable ALV and press enter
    my dealer name and dealer address in editable ALV [inside Custom Container] should get populated.
    But when the cursor is inside the custom container [in that editable field] none of my screen events[Module pool events]
    are getting triggered [Hence my values are not getting populated.When the cursor is outside the custom container all my module pool events are working fine, hence values are getting populated....
    Is there anyway to handle this???
    I am using OOPS Editable ALV inside a custom container...
    Waiting for your repiles...

    Hello,
    You have to implement events in order to handle your ALV, take a llok to this PDF:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Take a look on section EVENT BASED ADDITIONAL FUNCTIONALITIES->Making ALV Grid Editable
    Bye!!
    Gabriel P-

  • [Solved] Decrypt files securely inside lxc container.

    Hi, this is my first question, I've been using Arch for 5 years now, thanks for all your hard work!
    I'm trying to setup an lxc container to securely view encrypted files(gpg keys encrypted with cryptsetup and a loopback device), I've done so already using cryptsetup, the only issue is that after I decrypt the device from inside the container, it is available from the host as /dev/mapper/name and I can mount it and view it's contents.
    Is there any way to set cgroups to deny host and allow lxc container to access this device, maybe I can change /dev permissions so only root on host can access? I would prefer that not even root on host can access it but I know I'm asking too much, I can do this with qemu or other VMs but there is a lot of overhead.
    If you happen to know of any way I can access files from inside lxc container but block access to host even if it is after mounting the device, I would like to hear you out.
    I'm running an archlinux host and archlinux lxc container with grsecurity-pax enabled.
    Feel free to ask any questions if it's not clear .
    Thank you for your time, and kudos for your great work with this distro.
    Last edited by freetoken (2014-09-18 07:57:46)

    Progress!
    $ ls -la /dev/mapper/name
    lrwxrwxrwx 1 root root 7 Sep 16 09:21 /dev/mapper/name -> ../dm-0
    $ ls -la /dev/dm-0
    brw-rw---- 1 root disk 254, 0 Sep 16 09:21 /dev/dm-0
    $ rm /dev/mapper/name
    $ rm /dev/dm-0
    voila!
    The device is still there but it's not visible and user would need to have root permissions to run mknod and restore dm-0.
    Also very interesting read about cgroups for anyone interested: https://www.kernel.org/doc/Documentatio … groups.txt
    I'm wondering if there is any damage from doing this, since the data is backed up I guess I don't care too much and will test it for a while.
    If anyone has any ideas or knows some cool feature I'm missing let me know.
    Will mark as solved in 24 hours after more testing and in case something unexpected happens.

  • Putting an ap div inside a container?

    Hello,
    I am rather new to dreamweaver and am stuck with an issue. It is dealing with putting an ap div inside a container.
    I am not planning on becoming a web developer, I am a VFX artist, and have some of my work up on the web for employment.
    Since I don't know code and other complicated things with Dreamweaver, I decided to do an "easy" way of designing my page.
    I basically made a giant container, and then dragged out ap divs inside it where ever I wanted.
    I came back another day and added more ap divs, only this time - they didn't stay with the container. I am guessing I'm missing a step
    or did something a little different this time, and am trying to find out what.
    Here is my website for reference:
    www.mikelarned.com
    As you can see on the project page for example, when you click and drag the corner of the web window left and right, the top title moves with the page.
    And the videos/ other text under, stays static.
    I am hoping there is a way to resolve this issue without code. Maybe theres a way with the options on the right hand side of Dreamweaver to drag that ap div into the container?
    If not, hopefully there is an easy way to copy and paste the code.
    Thanks for you time and help.
    -Mike

    elementsk8er506 wrote:
     I am a VFX artist, and have some of my work up on the web for employment.Since I don't know code and other complicated things with Dreamweaver, I decided to do an "easy" way of designing my page.
    Hmm. I wonder what your reaction would be if I came along and asked a similar question about VFX? I know nothing about VFX, but want to do it the easy way without learning anything... Each technology requires certain skills and at least some basic knowledge. Unfortunately, a lot of people unfamiliar with web design think absolute positioning is the easy way. It's actually quite an advanced technique that has many people tearing out their hair until they learn how it really works.
    Basically, the problem with AP (absolutely positioned) divs is that they are removed from the normal flow of a web page. You might think you're putting them in a container, but you're not. Absolutely positioned elements float in front of the web page and have a stacking order defined by their z-index property. The top and left coordinates are absolutely positioned with regard to the element's containing block. The containing block is the element's most immediate ancestor that is also positioned using either fixed, relative, or absolute positioning. If no such ancestor exists, the containing block is the page itself.
    If you understand HTML and CSS, this is a relatively easy concept. If you don't, it's as difficult as VFX would be for me.
    To put this in as simple terms as possible, your container must also use CSS positioning. A common way to do this is to set the CSS rule for the container to position: relative without defining coordinates for the top and left. All AP divs nested inside then take their coordinates from the container, which you can center by giving it a width and setting the left and right margins to auto.

  • Suspend a method execution inside J2EE container

    Hi,
    I'm implementing a method that sends and resends payment transactions. The method resides in POJO java class and is going to be called from a Session EJB. When the same transaction has to be resent (accoring to some rules), we have to wait several milliseconds before doing it.
    I know that threading should not be used directly inside a J2EE container, so what would be the way to implement the waiting before resending a transaction?
    Thank you very much.

    Yes, I have used java.util.concurrent.Executor in weblogic 10 server.
    You can really improve the performance of the EJB application if you use the thread pool carefully with limited size say 100 threads, by creating a single instance of thread pool for the whole J2EE application.
    You have to control the life cycle of thread pool using the container's life cycle methods, create the thread pool only once and destroy every time you recycle your app.
    Good luck with the implementation :)

  • Creating Context Menu in ALV tree defined inside DOCKING CONTAINER

    Dear Experts.
    Can you please tell me which EVENTS should i use in CLASS: CL_GUI_SIMPLE_TREE to get a Context menu after right click on any tree node in ALV Tree which has been defined inside a Docking Container.
    Regards Arnab.

    Hi,
    Check Program SAPSIMPLE_TREE_CONTEXT_MEN_DEM and check event node_context_menu_request
    Hope this helps you.
    Thanks,
    Prashanth
    Edited by: Prashanth KR on Jun 2, 2009 7:50 AM

  • Resizing the swf inside a container

    Hi Guys,
    I am using a dashboard inside a vbox. I have integrated my
    dashboard into my main application (i.e. I have two different swfs,
    one of my main application and other of dashboard). Now when I
    login into my application by reducing the size of the browser, the
    pods inside the dashboard appears very small. Now when I increase
    the size of the browser the size of the pods remains small. Now my
    requirement is that the size of the pods should also get increased
    along with the size of the browser. Please help me in this regard.
    Thanks,
    Nirmal Kumar Bhogadi

    Hi mersec,
    That's Ok, I fixed the code like below, you could refer to.
    Private Sub picturebox1_mouseup(sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseUp
    'Allows picture box to be dragged inside container
    'Top and Left sides of picturebox1 will not exceed point 0,0
    'This will stop any "grey space" from appearing outside these edges.
    pbLoc.X = (PictureBox1.Location.X + (e.X - a))
    pbLoc.Y = (PictureBox1.Location.Y + (e.Y - b))
    If pbLoc.X + screenshot.Width > 0 And pbLoc.Y + screenshot.Height > 0 Then
    If pbLoc.X > 0 Then pbLoc.X = 0
    If pbLoc.Y > 0 Then pbLoc.Y = 0
    If pbLoc.X + screenshot.Width - ClientSize.Width < 0 Then pbLoc.X = ClientSize.Width - screenshot.Width
    If pbLoc.Y + screenshot.Height - ClientSize.Height < 0 Then pbLoc.Y = ClientSize.Height - screenshot.Height
    PictureBox1.Location = New Point(pbLoc.X, pbLoc.Y)
    Else
    'else recovery the location
    pbLoc.X = PictureBox1.Location.X
    pbLoc.Y = PictureBox1.Location.Y
    End If
    End Sub
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Inside Customer_function, container is loaded automatically

    Hi Experts
    I encounter a strange issue, can't figure it out.
    Basically I load inbounding idoc to create a new Sales Order.
    1. I load Idoc A to create sales order A in WE19, after SO A creation, I keep it on WE19 initial screen.
    2. Then I create another session and the same to load idoc B to create Sales order B.
    3. During Sales Order B createion, I debug it, outside customer-function EXIT_SAPLVEDA_001, internal table container xe1edpt2 is initial which is cleard by system program for every Idoc loading.
        But don't know why once it is inside customer-function EXIT_SAPLVEDA_001, Idoc A's corresponding data is loaded into xe1edpt2 automatically, and of course when my code is reached in EXIT_SAPLVEDA_001, Idoc A and Idoc B's data are all in xe1edpt2.
    I guess it must be related to memory, but I don't know the reason:
    1. Before program reach EXIT_SAPLVEDA_001, xe1edpt2 is initial.
    2. there is no local xe1edpt2 in  EXIT_SAPLVEDA_001, it is global container.
    3. When program reaches EXIT_SAPLVEDA_001, last Idoc's data will be automatially loaded into table xe1edpt2.
    This is really strange. Is there anybody encounter this issue before? What is the reason?
    Regards
    Derek

    hi Derek,
    bit of a longshot, but a guess from me is
    (SAPLXVED)xe1edkt2  is filled with the previous IDOC data
    (SAPLVEDA)xe1edkt2  is empty
    The programs SAPLVEDA and SAPLXVED do not share the data one with other
    so that clearing/refreshing the internal table xe1edkt2 in the standard
    coding (SAPLVEDA) does not lead to clearing/refreshing the table in the
    customer-specific coding (SAPLXVED).
    To solve the problem you have to clear/refresh this table in the
    customer coding (SAPLXVED) by yourself.
    Hope this helps
    Paul Q

  • Create controls inside a container?

    So I am now creating a checkbox at runtime with the following
    code:
    import mx.controls.CheckBox;
    createClassObject( CheckBox, "button2", 5, { label:"Test
    Checkbox" } );
    Is there a way to create a button inside another object like
    a ScrollPane (or something else?)? I created a ScrollPane at
    designtime, and would like the checkboxes, as well as text and
    perhaps draw lines within it at runtime. Is this possible? If not,
    is there another container which would allow this?
    I am trying this with the following code:
    CounterScrollPane.createClassObject( CheckBox, "button3", 5,
    { label:"Test Checkbox" } );
    but that doesn't work.
    Any thoughts?
    Thanks!

    Sorry I didn't explain more. contentPath can be an external
    swf (in which case you need to wait for it to load.
    But it can also be a movieclip in the library set with its
    linkage identifier to the name used in the contentPath property of
    a container component. That's what I did here.
    a. I made a square, turned it into a movieclip..
    b. then in the library, right-clicked it, and chose linkage
    c. in the identifier field (it probably already has
    something) put the name you want to use in contentPath
    d. make sure that export for actionscript is checked and in
    first frame

  • Creating Input Field inside Docking Container bar

    Hello.
    Does anyone know how I can put an input field inside a docking container object ? Just like it appears in SE80.
    I have created a docking container bar, and in one of those bars i want to put a text field.
    Anyone please ?
    Thank you
    EDIT----
    I found how to do this with cl_gui_container_bar_2 and with dynamic documents.
    Edited by: Ricardo Monteiro on Aug 25, 2010 1:30 PM

    Hi,
    Check Program SAPSIMPLE_TREE_CONTEXT_MEN_DEM and check event node_context_menu_request
    Hope this helps you.
    Thanks,
    Prashanth
    Edited by: Prashanth KR on Jun 2, 2009 7:50 AM

  • Exact functions of Servlet context and servlet Config inside web container

    What is the correct(exact) function in the Servlet Context and Servlet Config inside the Web Container?.
    Pls anybody response me.
    -- Palani

    ServletConfig:
    The container reads the servlet init-parameters specified in web.xml then adds them to ServletConfig. The container then passes ServletConfig to the servlet. Thereafter, the servlet can access the ServletConfig and get the servlet init-parameters. The idea is that you can avoid hard coding data that might change in your servlet code, e.g. an email address. If the email address changes, you can change it in web.xml instead of having to hunt through all your code and change the email address every place it appears and then recompiling the servlet.
    Servlet init-parameters in web.xml are targeted for one servlet.
    ServletContext:
    The ServletContext is an app wide bulletin board where you can post data. Other parts of your app, e.g. other servlets, can then read the data on the bulletin board.
    Also, similar to ServeltConfig, the container reads context-init parameters from web.xml and inserts them into ServletContext. However, in this case they are inserted into an app wide bulletin board, and therefore all servlets can read them.
    An example: you might put database connection info in some context-init parameters. Then when the ServletContext is created, you can have "a listener" respond to the ServletContext creation event and get the database info, create a database connection, and attach it to the ServletContext. Then the database connection will be available to any servlet that needs it.
    palanithendral wrote:
    What is the correct(exact) function in the Servlet Context and Servlet Config inside the Web Container?.
    The exact function of each would be determined by the group of methods each one provides. You need to check the java docs to see what each method does.

Maybe you are looking for

  • K7T Turbo Limited Edition W/Raid board

    Can someone tell me if the VIA KT133A Chipset Based K7T Turbo Limited Edition W/ Raid board will take a faster processor beyond 1.6 ghz? if so what is the fastest cpu it will take?

  • Creation of local and root folders?

    I have a photoshop home page that is complete. But it was created by someone else. I do not have any of the images or other information used in the home page. Except for what in photoshop. I don't know where to go from here. I sliced it all up and ge

  • Final Cut Pro 7: problem creating Blu Ray disc

    Hello, I've a problem using FInal Cut Pro 7. I want to create a Blu Ray disc using the "Share" function, but during the process - after many hours - appears this warning message: "SHARE WARNING - NSEXPETION RAISED BY 'NSPORT TIMEOUT EXCEPTION' REASON

  • Image Gallery Rollover effect

    First Issue: I've dynamically created the image gallery, on rollover or mouseover i'm using the zoom in effect, on rollout i'm using the zoom out effect (that will return to the original size). onrollover zm = new Zoom(timg); zm.zoomHeightFrom = 1.2;

  • Issue with context menu for online help?

    Try this 1. Start JDeveloper; Choose Help | Table of Contents and make it visible in Navigator 2. Close JDeveloper and start it again 3. Try right clicking on a help node in the Help tab in Navigator. the context menu does not appear until you choose