In which way Servlet implements  multiThread  without servlet implement Run

Hi,
In which way Servlet implements multiThread without servlet implement Runnable.
In general servletconaainer use one instance of servlet to handle multiple request(except implement SingleThreadmodal).
I thing that conatainer can achive this ,in this Way
Myservlet ms;
1st Way:
For each new request container call
new Thread(){
puvlic void run(){
ms.service(request,response);
}.start();
but I do not thing in this way we get any performace.
It is better creat pool of Myservelt. and get object from this
ms1,ms2,ms3
2nd way is
Myservlet implement Runnable
and for each request
new Myservlet ().start();
Please tell me In which way conatiner achive multithread of servlet
Siddharth Singh([email protected])

You don't need to do any of this. The servlet container starts its own threads, and they call the servlet methods as required. All you have to do is syncrhonize your servlet internally as required to protect anything that needs protecting from multiple threads.

Similar Messages

  • Classes on which ur servlet depends is not found in classpath

              i am trying to deploy a servlet in exploded form in weblogic 7.0.Its is deployed correctly but when i call the servlet from a html file i.e. index.html it throws an error http:<Error> <HTTP> <101250>
              stating that the classes on which my servlet class depends is not found in classpath.I have set classpath manually and also created a domain name "ApplicationDomain" and i have put my application "WebApp" in application's directory in the domain
              it throw the folowiing error with exceptions
              <May 28, 2003 12:09:54 PM IST> <Error> <HTTP> <101250> <[ServletContext(id=1642082,name=WebApp,context-path=)]: Servlet
              class myclasses.Gservlet for servlet Gservlet could not be loaded because a class on which it depends was not found in t
              he classpath D:\bea\user_projects\Applicationdomain\applications\WebApp;D:\bea\user_projects\Applicationdomain\applicati
              ons\WebApp\WEB-INF\classes.
              java.lang.NoClassDefFoundError: myclasses/Gservlet (wrong name: Gservlet)>
              <May 28, 2003 12:09:54 PM IST> <Error> <HTTP> <101018> <[ServletContext(id=1642082,name=WebApp,context-path=)] Servlet f
              ailed with ServletException
              javax.servlet.ServletException: [ServletContext(id=1642082,name=WebApp,context-path=)]: Servlet class myclasses.Gservlet
              for servlet Gservlet could not be loaded because a class on
              

    Configuration file bc4j.xcfg not found in the classpath.

  • How to get servlet container name on which servlet is running

    I tried getServletInfo(),but I couldn't get the information. Please give me code to find the servlet container on which servlet is running.
    Is there any system property which will retrieve servlet container information such as its name and version
    Thanks & Regards,
    Nasrin.N

    getServerInfo() should work.
    What about getServerInfo() doesn't work for you?
    My standard solution is to this in a JSP page:
    <h2> Server Info </h2>
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>Cheers,
    evnafets

  • I have an iPod which i currently sync on my iMac, I want to sync it on my Apple mac pro, how do I do this? Is there a way of doing this without restoring my iPod?

    I have an iPod which I currently sync on my iMac, but I want to sync it on my Apple mac pro, how do I do this? Is there a way of doing it without restoring my iPod?

    Post here:
    https://discussions.apple.com/community/ipod

  • HT5622 I do not remeber the awnsers to my security questions, to change them, i need to know them which i do not.  Is there any possible way to change them, without knowing them.

    to purchas apps, and music. if you have not done it in a long time you have to hav the anwsers to your security questions.  i do not know the anwsers to mine, and there is no way to change them without knowing them.  if there is a way to change the security questions without knowing them i would really like to know how.

    Security questions:
    https://discussions.apple.com/docs/DOC-4551
    http://support.apple.com/kb/HT5312
    This is also useful:
    http://www.macworld.co.uk/ipad-iphone/news/?newsid=3463233&olo=email

  • Best way to implement app wide process

    I am working on an application that has a list of art work in an sql report.. I want to be able to add each piece to a collection of items (which is stored in a table), so I added another column to the sql report to store the id of the art work. I am just wondering what is the best way to implement the process to insert the item to the collection of items. Since I want to do this from multiple pages - link from art work sql report; link from the edit page for a particular art work; and on the artists page where there is also an sql report, I thought it may be best to have an application process, to save duplicating the process on multiple pages.. however I don't think there's a way to pass the id of the item to the application process? as I was thinking best to have the application process conditional based on request, and then have the link as a doSubmit().
    So is it best just to have the link redirect to the same page, passing the id of the item, and then having a process that runs before header that inserts the item, then assigning the item to NULL?
    Thanks in advance,
    Trent

    Daniel:
    Thanks for the info. I have found that the IFRAME works nicely for some applications,
    however, some applications I want to re-write the front end to look better in
    the portal rather than screen scrape.
    Thanks for the help
    Ryan
    "Daniel Selman" <[email protected]> wrote:
    Ryan,
    Check out the thread (a few days old) titled "Different ways of creating
    portlets".
    Sincerely,
    Daniel Selman
    "Ryan Richards" <[email protected]> wrote in message
    news:3d2eda12$[email protected]..
    I have a few existing applications that I need to port over to portletsin
    Weblogic
    Portal 4.0. One application is a servlet based web application witha few
    html front-end
    screens. I am trying to determine how to do this in the best way. Ihave
    noticed
    that portlets behave differently inside the portal than do stand-aloneweb
    apps.
    Any help would be appreciated.
    The other web application is the Microsoft Outlook Web Access. (Thisone
    is going
    to be difficult because it is actually an ASP app. I dont know if thisis
    possible
    without building some proxy code between bea and iis.)
    Thanks
    Ryan

  • Best way to implement service in 3-tier webarchitecture

    Hi,
    What would be the best way to implement a service in the following 3-tier TopLink architecture: no ejb and a webclient (jsp/servlets)?
    Currently I have a server session type and a service pojo using a singleton SessionFactory. The service pojo is used by the jsp/servlets.
    Should the service pojo be a singleton? Should a SessionManager be used?
    In the examples on OTN a clientsession is directly acquired in the jsp/servlets.
    Thanks,
    Ronald

    Ronald,
    There are numerous ways to do this. I would recommend using the SessionFactory. The SessionFactory makes use of the SessionManager, which holds onto the singleton Server session. You can then acquire client sessions using the oracle.toplink.sessions.Session interface from the SessionFactory. There is no need to hold the SessionFactory in a singleton yourself and you do not need to reference the ClientSession directly either.
    We have introduced this latest approach to simplify coding. It will work in both the web architecture with JSP/Servlets accessing the sessions as well as within an EJB tier (Session/Message Driven beans).
    Doug

  • Problem getting simple servlet to run in tomcat

    i am trying to get a servlet to run that is explained in wrox Professional JSP second edition. i am using tomcat as the book explains.
    1. i have created the ch03/WEB-INF/classes directory within the webapps folder in tomcat.
    2. in the classes folder i created the directory
    com/wrox/projsp/ch03/myfirstwebapp.
    3. in the folder myfirstwebapp i have the compiled file
    MyFirstServlet.class
    4. i made sure the code is exactly as in the book.
    5. it states that if i go to
    http://localhost:8080/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet i should get the correct output.
    6. the only way i can get this to work is if i create a web.xml
    file and point it to
    com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet and then in the
    browser i type in
    http://localhost:8080/ch03/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet thus leaving out /servlet in the URL
    7. this seems fine but i would like to get it to work how the book shows which is without having to use the web.xml. am i missing something? do i need to set up anything (eg. a context tag for this app)within the server.xml.
    any help would greatly be appreciated,
    gary bushek

    I don't know how the book you're using instructed you to setup the server but my web.xml simply has the following in it:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    </web-app>
    I'm using tomact 3.2 and am able to run my servlets using
    http://localhost/servlet/package_name.servletName
    you might want to checkout www.coreservlets.com for more help on setting up tomcat.

  • Which Way To Go? (ADF with Netbeans?, Glassfish in JDeveloper?)

    Hi there,
    I am new to the "Java for Web" branch - though I'm not that new to Java and J2EE itself. So far I've always used PHP for Web-stuff
    I have to write a Web Application (using Java EE 5 as backend) in JSF. Nothing too fancy - just a statistics tool (grabing data from the JPA-Entities, and displaying it in nice-looking charts)
    My problem is that I'm not really sure which way to go, since I have hardly any experience in this field (I did some JSP/Servlet stuff a while ago, but it was really painful)
    The application server is Glassfish V2 (SJSAS 9.1), database is Oracle 10g. Since I've used Netbeans for most of my Java stuff, I thought of using it for this project too, but when looking at JSF Implementations/Frameworks, a lot of people seem to like ADF Faces, while the other Implementations/Frameworks (obviously) aren't that great. However I couln't find any way to Integrate ADF in Netbeans (getting the ADF widgets/elements in the toolbox-palette of Netbeans). Using JDeveloper wouldn't be that bad (have used it too for some simple Swing-stuff), but I'm not sure on how well I can delploy/debug stuff in JDevelooper using Glassfish. - Is JDeveloper Java EE 5/EJB 3.0 ready? EJB 3.0 seems ok, but I tried creating a JSF Page, and I could only create one in Java EE 1.4 (JDeveloper version 10.1.3.2.0)
    I also had a look at PHP-like stuff in JSP/Servlets (like Phobos or Quercus), but they didn't seem to work that great :\
    Any ideas on how to approach this best?
    Thanks!

    Tim,
    Is JDeveloper Java EE 5/EJB 3.0 ready? EJB 3.0 seems ok, but I tried creating a JSF Page, and I could only create one in Java EE 1.4 (JDeveloper version 10.1.3.2.0)
    JSF support works in Java EE 1.4 and Java EE 5. However, JDeveloper uses JSF 1.1, not JSF 1.2 - which is what we support in JDeveloper 11. In regards to your requirement to create charts, ADF Faces does provide data visualization components in JDeveloper 11 - which currently is in developer preview and freely available on OTN. In JDeveloper 10.1.3 there are no graph components in ADF Faces.
    Since you want to use NetBeans and ADF doesn't work within this IDE I suggest you to have a look at Trinidad. Trinidad is an open source JSF component set originated from the ADF Faces code. Trinidad also has charting capabilities
    http://myfaces.apache.org/trinidad/index.html
    In JDeveloper 11, Trinidad is integrated within the JDeveloper IDE for declarative development with ADF. Not sure though if you find the same level of EJB /JPA support in Netbeans as you do in JDeveloper. However, you pick.
    Frank

  • What is the best way to implement a scheduled task?

    Dear kind sirs...
    let us say I have a JSF application, and it is working perfectly fine...
    I need the method like
    void DoProcessing()
    *// processing code here*
    to execute everyday at 7AM...
    so what is the best way to do it? I need this to be part of the JSF application... not in a different process... and I want the method to execute at that exact time every day.
    and what are the main steps to do that?
    best regards

    Dear Mr. Chris...
    the reason I am asking about this is because we are required to provide reports for a number of customers by email every day... each report requires retrieving values from a DB.
    I made a test few hours ago about making a thread sleeps and check the time when it wakes up, it works, no problem about that...
    I placed a thread in the servlet context and started it... and it kept working for about an hour writing in the log every 5 seconds... so I guess the idea works...
    but do you think that this way of implementing the scheduler is ok? for I have not done it before and I don't know the cons of such a method.
    thanks for any advice or comment.
    best regards

  • Anyone figured out a way to use JWS without needing the MIME type preloaded

    Anyone figured out a way to use JWS without needing the MIME type preloaded on the client's computer?
    Why is it not server-side loading? How can I force a load of JWS and the MIME-type?

    when you install web start, the mime type jnlp is associated with WEBstart.
    The WEB start home page has code to request an
    install if web start is not on the user system.
    On the web server, of course you need to specify the association between a
    .jnlp file and the mime type. This is in the configuration of the server.
    It would be nice if standard ISP's provided that for user directories.
    Anyone think AOL would do this?
    After all it should not cost anything like installing servlets.

  • The Excel-Mania - Best Ways of Implementing Excel-Like ADF

    Hello people, good afternoon!
    I would like to share with you a doubt i have implementing complex, matrix-like forms in ADF. More often than i'd like to hear, users ask for input forms that closely resemble Microsoft Excel, where the dimensions are layered both vertically and horizontally, and the intersection between them must contain an input or output component, allowing themselves to rapidly input the data they need or to create a web version of Oracle Reports' Matrix Report. Some cases are:
    1) The user wishes to associate the employees (located in table EMPLOYEES) to the projects (located in table PROJECTS) in a screen that lays out the employees as columns and the projects as rows in a table. The intersection between them must contain a checkbox, which will insert a third record when selected, on a table called EMP_PROJ, which associates the employees to the projects.
    2) The user wishes to input a timecard in a time control system. This system must have a screen that shows the days in the week as columns, and the projects the employee is working on as rows. On the intersection, we must provide an input text where he will enter the hours he worked on that specific project on that day.
    3) The user wishes to see a screen that shows the Open Auctions they have in a Purchasing system as rows in a table, crossed with the suppliers that have bidded on these (as the columns). The intersection must contain the price each supplier bidded on each Auction.
    As you can see, i run across this requirement A LOT =). And, as much as i have polished my "Web-Like-Applications-Are-Not-Like-This" and "You-Are-Not-Working-With-Excel" speeches, our beloved users never learn ;)
    Nevertheless, i have been looking for a consistent way to implement this behavior, and i have found some options along the way. I would like to know your impressions on this matter, and if you have any "Best-Practices" that you imagine for this case.
    CASE 1: Creating a Dynamic, On-The-Fly View Object by using ADF BC APIs and using af:table component to do the trick on the page
    PROS: Less work in the View layer, Preservation of the Table CSS Layout (very nice blue header and light brown cells)
    CONS: A LOT of work on the BC layer, creates an awful lot of View Objects, and generates tons of java code on the Application Modules.
    CASE 2: Creating the model as usual and working with repeating layouts on ADF Faces (for example, enclosing an af:cellFormat on an af:forEach to repeat each column)
    PROS: Simplifies the BC layer, making it much cleaner and maintainable.
    CONS: Loses a lot of the declarative wonders of ADF Faces and also the CSS Layouts, since we are using cellFormat, rowLayout and tableLayout instead of table tag we have to manually apply the styles to the columns and rows.
    Of course, both implementations take an awful lot of time. Any other implementation styles are quite welcome (ADF Wizards, step in!)
    Anyone wants to discuss better ways of doing it?
    Best Regards,
    Thiago Souza

    Well, you could do the following:
    1) Create a stored procedure that assembles the data into a rowset with rows and fields like the format you want.
    2) Create stored procedures that handle insert, update, and delete.
    3) Create an entity object definition with all transient attributes. Make the attributes match the elements of one row.
    4) Override doDML() in the entity object class to call your procedures (the doc explains how to do this). You might also need to do a bit of research and figure out if you need to override some other method so you can report rows with transient attribute changes only as needing posting. (getPostState(), maybe?)
    5) Create a view object definition with entity-derived attributes based on your EO attributes.
    6) Override the appropriate methods to call your data assembly procedure rather than execute a query (this is also in the doc).
    Still kind of kludgy, but it keeps your business components pretty clean, especially if you use framework classes to do most of the work for you. (I have a partial example of how to do that here.) Of course, it keeps your business components clean by moving the real work to the DB, but some people find that more maintainable that a kazillion business components.
    Hope this helps,
    Avrom

  • Displaying Multiple Values on GUI components - best way to implement

    Hi,
    my program needs to implement a basic function that most commercial programs use very widely: If the program requires that a GUI component (say a JTextField) needs to display multiple values it either goes <blank> or say something more meaningfull like "multiple values". What is the best way of implementing it?
    In particular:
    My data is a class called "Student" that among other things has a field for the student name, like: protected String name; and the usual accessor methods (getName, setName) for it.
    Assuming that the above data (i.e. Student objects) is stored in a ListModel and the user can select multiple "Students", if a JTextField is required to display the user selection (blank for multiple selections, or the student "name" for a single selection), what is the best (OO) way of implementing it? Is there any design pattern (best practice) for this basic piece of functionality? A crude way is to have the JTextField check and compare all the time the user selections one by one, but I'm sure there must be a more OO/better approach.
    Any ideas much appreciated.
    Kyri.

    Ok, I will focus on building a solution on 12c.
    right now I have used a USER_DATASTORE with a procedure to glue all the field together in one document.
    This works fine for the search.
    I have created a dummy table on which the index is created and also has an extra field which contains the key related to all the tables.
    So, I have the following tables:
    dummy_search
    contracts
    contract_ref
    person_data
    nac_data
    and some other tables...
    the current design is:
    the index is on dummy_search.
    When we update contracts table a trigger will update dummy_search.
    same configuration for the other tables.
    Now we see locking issues when having a lot of updates on these tables as the same time.
    What is you advice for this situation?
    Thanks,
    Edward

  • What is the best way to implement a cluster-wide object ID generator?

    What is the best way to implement a cluster-wide object ID generator?

    What is the best way to implement a cluster-wide
    object ID generator?Always use 3 because it is prime.
    Alternatively more information about the system and the needs of the system might prompt alternative ideas some of which are likely to be better than others for your particular implementation and system constraints.

  • Different ways to implement OM Module

    Hi All,
    I am new to this, Please let me know all the 5 different ways to implement OM and PA module in HCM

    Basics of OM
    OM is mainly used to perform numerous business and human resources processes. As the first step an organizational plan is created. The organizational plan is a functional structure representing the enterprise. In OM, the current organizational plan can be created and additional organizational plans are created as archives (this provides a clear picture of the organization at any point in time:past, present or future). Organizational Management is the basis for additional Human Resources components and functions as well as for SAP Business Workflow.
    OM is installed before Personnel Development(PD), Recruitment, Compensation Management (CM/ECM), Workflow, Time Management, Security, ESS/MSS etc. OM structure provides the foundation for these modules and streamlines business processes. For example MSS setup can be such that the manager will be able to view only the details of those working under him/her - the details of persons working under the manager are picked up from OM. Similarly data from OM is used when WF has to route the work of approving the leave of an employee to his/her manager.
    OM is based on the objects and their relationships. Jobs, tasks, positions, etc are the objects. These objects are created in OM. The relationship between various objects is also stored in OM.
    Transaction codes
    PPOM - Change org Unit
    PO03 - Maintain Jobs
    P013 - Maintain Position
    PO10 - Maintain Organizational Unit
    PP01 - Maintain Plan Data (menu-guided)
    PP02 - Maintain Plan Data (Open)
    PP03 - Maintain Plan Data (Event-guided)
    PP05 - Number Ranges
    PP06 - Number Ranges Maintenance HR Data
    PP07 - Tasks/Descriptions
    PP69 - Choose Text for Organizational Unit
    PP90 - Setup Organization
    PP01 - Change Cost Center Assignment
    PP02 - Display Cost Center Assignment
    PP03 - Change Reporting Structure
    PP04 - Display Reporting Structure
    PP05 - Change Object indicators (O/S)
    PP06 - Change Object indicators OS
    PPOA - Display Menu Interface (with dyn.)
    PPOC - Create Organizational Unit
    PPOM - Maintain Organizational Plan
    PPOS - Display Organizational Plan
    PQ01 - Events for Work Center
    PQ02 - Events for Training Program
    PQ03 - Events for Job
    PQ04 - Events for Business Event Type
    PQ06 - Local Events
    PQ07 - Resource Events
    PQ08 - Events for External Person
    PQ09 - Events for Business Event Group
    PQ10 - Events for Organizational Unit
    PQ11 - Events for Qualification
    PQ12 - Resource Type Events
    PQ13 - Events for Position
    PQ14 - Events for Task
    PQ15 - Events for Company
    PSO5 - PD : Administration Tool
    PSOA - Work Center Reporting
    PSOC - Job Reporting
    PSOG - Org Mgmt General Reporting
    PSO1 - Tools Integration PA-PD
    PSOO - Organizational Unit Reporting
    PSOS - Position Reporting
    PSOT - Task Reporting
    Configuration steps apart from steps which were given by Teja
    IMGPersonnel management Organizational management  Basic settings  Maintain number ranges  set up number assignment for all plan versions
    Maintain object type:
    IMGPersonnel management  Organizational management  Basic settings  Data model enhancement  maintain object type
    Maintain infotypes
    IMGPersonnel management Organizational management  Basic settings  Data model enhancementu2014infotype maintenance  maintain infotypes
    Relationaship maintenance:
    IMGPersonnel management Organisational management  Basic settings  Data model enhancement  Relationship maintenance  maintain relationships
    Maintain evaluation paths:
    IMGPersonnel management Organisational management  Basic settings Maintain evaluation paths
    Maintain personnel actions:
    IMGPersonnel management Organisational management  Basic settings Maintain personnel actions
    Activate inheritance of account assignment features
    IMGPersonnel management Organisational management  Basic settings Activate inheritance of account assignment features
    Setup integration with Personnel Administration
    IMGPersonnel management Organisational management  Basic settings Integration  Setup integration with PA
    Transfer data from Pa
    IMGPersonnel management Organisational management  Basic settings integration  transfer data from PA
    Perepare integration with Pa
    MGPersonnel management Organisational management  Basic settings integration Prepare integration with PA
    Transfer data to PA
    IMGPersonnel management Organisational management  Basic settings integration Transfer data to PA
    Check integration consistency
    IMGPersonnel management Organisational management  Basic settings integration Check integration consistency

Maybe you are looking for