How to implements the single thread modal?

how to implement the singlethread modal in servler/jsp?

Do you mean 'model?' and 'servlet?' and are you referring to the interface with that name? which your servlet class just has to declare that it implements?

Similar Messages

  • How does the servlet implement the multi-thread feature?

    There is only one instance of every servlet in one wep application.
    When several clients invoke the doPost() method of the same servlet,the servlet can process their request respectively.
    So there much multi threads of one servelt.
    But the Servlet doesn't implement the Runnable interface of extends the Thread class.
    I wan't to know,how does the servlet/servlet container implement the multi-thread feature?

    Hi johnnylzb
    There is only one servlet instance existing.
    (assuming u have <load-on-startup>1</load-on-startup>)
    The server creates a thread for every request ..
    and all the threads access the same servlet instance.
    For this its not necessary for the Servlet to extend Thread or Runnable.
    hope this helps

  • I have a doubt about The Single-Thread Rule

    The [url http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html#rule]Single Thread Rule states:
    Rule: Once a Swing component has been realized, all code that might affect or depend on the state of that component should be executed in the event-dispatching thread.
    I began to wonder about this because so much code seems to work just fine when it isn't executed in the event dispatching thread. Why are there exceptions? I went looking for some code which acted differently when executed on the event thread than when it was not. I found this
    http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725
    Now I started wondering why this was the case. What I found was that DefaultCaret adds a document listener to the document of the JTextComponent. In this listener, the insertUpdate() method specifically tests if it is running on the event dispatch thread and if it is, it updates the caret position.public void insertUpdate(DocumentEvent e) {
        if (async || SwingUtilities.isEventDispatchThread()) {
            // ... update the caret position ...
    }I then copied the code from DefaultCaret and made a MyCaret. I needed to tweek the code a little bit, but it ran. I removed the event thread test. It worked outside the event thread. There was a small difference in the results though. The textarea did not scroll all the way to the bottom. Almost, but not quite. I didn't test enough to make sure this was the only problem, but there was at least one problem.
    Now I started think about why this would be. The thought crossed my mind that the order of the events which were posted to the event queue were probably important. Sun found bugs when components were updated out of the event thread, so they essentially ignored events which weren't on the event thread and created the The Single-Thread Rule.
    A few days pass. I'm starting to wonder if Sun could have done a better job making Swing components thread safe. I also don't know that this specific case I found was the rule or the exception to the rule. But without insight into the design philosopy of Swing, I would have to examine all their components and see how they have written them and see if I can come up with a better design. That sound like a lot of work. Especially without getting paid for it.
    But wait a second, all you have to do is call the append() method of JTextArea on the event thread. If that is the case, why didn't they write the freakin component that way? Well, I'll try itclass MyTextArea extends JTextArea {
      public MyTextArea(int rows, int columns) { super(rows,columns); }
      public void append(final String text) {
        if (SwingUtilities.isEventDispatchThread()) super.append(text);
        else {
          SwingUtilities.invokeLater(new Runnable() {
            public void run() { myAppend(text); }
      private void myAppend(String text) { super.append(text); }
    }I change [url http://forum.java.sun.com/thread.jsp?forum=57&thread=410423&message=1803725#1803725]camickr's code to use a MyTextArea and it works fine without calling from the event thread. I've essentially moved The Single-Thread Rule to the component itself rather than relying on each and every one of the [url http://www.aboutlegacycoding.com/default.htm?AURL=%2FSurveys%2FSurvey6intro%2Easp]2.5 million Java programmers worldwide to use SwingUtilities.invaokeLater().
    Now for my question...
    Why didn't Sun do this?

    Swing is slow enough as it is. Lets not make it slower
    just
    because dense "programmers" don't know what they are
    doing.I agree with you in defending the current model, but aren't you a bit harsh there?!? ;-)
    Well, there are a number of not-so-dense programmers that expect such high-level components to be thread-safe. The question is worth asking whether Sun intentionally favor the explicit thread management for performance reasons, or whether this was an oversight.
    I'd go for the former (intentional) : indeed any GUI toolkit is inherently thread-based; there is always a distinction between the graphical thread(s) and the application threads - and the programmer always has to manage explicit thread creation to handle long-running event handlers without blocking the event dispatching thread. Extending thread concerns to the updating of components is therefore not a big move.
    So it seems fair that a core GUI toolkit does not hide thread issues (though to the best of my knowledge there is no such limitation in updating AWT components), or at least that's what Sun deemed.
    An ease-of-use-focused toolkit wrapping the core toolkit for thread-safety can be provided as a third-party product. Though I agree that wrapping the dozens of existing widgets and hundreds of methods is cumbersome - and the lack of such products probably shows it would have a low added value to trained developpers.
    Because your way is an extra method call and if
    statement, neither of which is necessary if you already know you
    are in the correct thread. Now count the number of methods
    which will need to be changed (and add up the extra cost).Indeed it's quite common to update several properties of several widgets in one bulk (when user clicks "OK", add a row to the table, change the title of the window, update status bar, re-enable all buttons, change some color,...).
    In this case explicit thread management doesn't spare one if but a dozen of redundant ifs!
    Note that there could have been if-less ways to cope for thread safety, such as creating a copy of the component's model when a change is made to a component, and switching the model only before paint() is called in the event-dispatching - of course coalescing all changes into the same "updated" model until paint() is called.
    But this would trade ease of use for redundant memory consumption, especially for some components with potentially huge models (JTree, JTable, JTextArea,...). And Swing appears to be already quite memory-greedy!

  • How to Implement a Single Folder - Multiple Authors Scenario für NW 7.3?

    Hello,
    is a version "How to Implement a Single Folder - Multiple Authors Scenario" for NetWeaver 7.3 planned?
    Best regards,
    Arnold Gallemann

    Hi Detlev,
    thanks a lot for sharing your work!
    Due to the reason we need a different configuration in KM, I changed e.g. some values in the .cc.xml and .co.xml files. I rebuild the project and checked the created EAR file. I noticed that the ConfigArchive file in EAR file still has the old values. It seems that SAP NetWeaver Developer Studio 7.3 is not recognizing in a portal application project the configuration of the src.config folder anymore. To test this, I removed the initial provided ConfigArchive in the folder dist\PORTAL-INF\config\ from your project. I rebuild it and the ConfigArchive in the EAR file wasnu2019t included.
    I found in the documentation (http://help.sap.com/saphelp_nw73/helpdata/de/42/60aec0032c1422e10000000a114cbd/frameset.htm) the SAP Note 1572813, which would describe how to use KMC wizards in SAP NetWeaver Developer Studio 7.3. But the article is currently not released to public.
    In addition I have discovered, that it is possible to include the src.config folder in the build process if the project is set up as a development component (see for details bullet point Optionally of http://help.sap.com/saphelp_nw73/helpdata/de/42/60aec0032c1422e10000000a114cbd/frameset.htm). This works. But later on I am facing another problem: I am missing the entry KMC-CM to add it as a dependency for the development component.
    Best regards
    Mario

  • How to implement the View V_SEPA_CUST in SAP 4.7 ?

    Hi SAP Experts,
    We are going to implement SEPA in our project and currently using SAP 4.7.
    Is there any way to implement the View V_SEPA_CUST in SAP 4.7.
    I came to know that there is an OSS Note available for this implementation but I couldn't find the same.
    Please suggest me how to Implement the View V_SEPA_CUST in our SAP system, since we need this View for SEPA implementation.
    Many Thanks in Advance.
    Yogesh.
    Moderator message: one thread only per issue, please.
    Edited by: Thomas Zloch on Jan 31, 2012

    Dear Yogesh,
    SAP has just recently released a note you might want to consider: 1834272. One of the preliminary notes for this note is 1784060...
    This works for SAP 6.4. I can not help you where it is specifically related to SAP 4.7
    Hoping it is of use.
    Best regards,
    Raymond

  • How to make the main() thread wait?

    I would like to know how to make the main() thread wait for another thread?If I use wait() method in main() method it says "non-static method wait() cannot be referenced from a static context",since main()
    is static.

    Here is an example how you may wait for a Thread in the main -
    but be careful, this is no real OO:
    public class WaitMain {
    // this is the thread class - you may also create
    // a runnable - I use a inner class to
    // keep my example simple
         public static class ThreadWait extends Thread{
              public void doSomething(){
                   synchronized(syncObject){
                        System.out.println("Do Something");
                        syncObject.notify();
              public void run(){
                   // sleep 10 seconds - this is
                   // a placeholder to do something in the thread
                   try{
                        sleep(10000);
                        doSomething();
                        sleep(10000);
                   catch(InterruptedException exc){
    // this is the object we wait for -
    // it is just a synchronizer, nothing else
         private static Object syncObject = new Object();
         public static void main(String[] args) {
              System.out.println("This will start a thread and wait for \"doSomething\"");
              ThreadWait t= new ThreadWait();
              t.start();
              synchronized(syncObject){
                   try{
    // this will wait for the notify
                        syncObject.wait();
                        System.out.println("The doSomething is now over!");
                   catch(InterruptedException exc){
              // do your stuff

  • How to implement the schema validation with XSD in adapter module

    Dear All,
    I am trying to develop a EJB as the file adapter mudule.
    Please guide me how to implement the schema validation of the source message with XSD.
    Or provide me the relative resources about this task.
    Thanks & Regards,
    Red
    Edited by: Grace Chien on Nov 19, 2008 8:23 AM

    Hi Grace,
    You can do the xml scema validation in PI7.1 version directly.
    To develop the adapter module for xml schema validation
    Validating messages in XI using XML Schema
    Schema Validation of Incoming Message
    Regards
    Goli Sridhar

  • How to implement the shared lock in a  table view

    Hi,
    How to implement the shared lock in a  table view.for multiple users to edit on this same table.
    Thanks in advance
    Swathi

    Hi,
    Please refer this link to find solution to your querry.
    Hope it helps.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c322c690-0201-0010-fb86-811c52b0acc2.
    Regards,
    Rahul

  • How to implement the selfsecured page in oaf

    hi
    any one having knowledge how to implement the selfsecured OAF page documents
    can you please send me [email protected]
    Regards
    Chandra

    Use the search facility on the forum. Did you read the dev guide?
    --Shiv                                                                                                                                                                                       

  • How to implement the spell check in oracle forms 10g or 6i...

    How to implement the spell check in oracle forms.
    Is there any different method is there.
    Please help me....
    Praveen.K

    Here is one different from Jspell..
    In 6i client/server you can call MS Word spell checker using OLE. Below sample code for 6i.
    For 10g you will need webutil to use same code. install webutil and just replace "OLE2." with "CLIENT_OLE2."
    PROCEDURE spell_check (item_name IN VARCHAR2)
    IS
       my_application   ole2.obj_type;
       my_documents     ole2.obj_type;
       my_document      ole2.obj_type;
       my_selection     ole2.obj_type;
       get_spell        ole2.obj_type;
       my_spell         ole2.obj_type;
       args             ole2.list_type;
       spell_checked    VARCHAR2 (4000);
       orig_text        VARCHAR2 (4000);
    BEGIN
       orig_text := NAME_IN (item_name);
       my_application := ole2.create_obj ('WORD.APPLICATION');
       ole2.set_property (my_application, 'VISIBLE', FALSE);
       my_documents := ole2.get_obj_property (my_application, 'DOCUMENTS');
       my_document := ole2.invoke_obj (my_documents, 'ADD');
       my_selection := ole2.get_obj_property (my_application, 'SELECTION');
       ole2.set_property (my_selection, 'TEXT', orig_text);
       get_spell :=ole2.get_obj_property (my_application, 'ACTIVEDOCUMENT');
       ole2.invoke (get_spell, 'CHECKSPELLING');
       ole2.invoke (my_selection, 'WholeStory');
       ole2.invoke (my_selection, 'Copy');
       spell_checked := ole2.get_char_property (my_selection, 'TEXT');
       spell_checked :=SUBSTR (REPLACE (spell_checked, CHR (13), CHR (10)),1,LENGTH (spell_checked));
       COPY (spell_checked, item_name);
       args := ole2.create_arglist;
       ole2.add_arg (args, 0);
       ole2.invoke (my_document, 'CLOSE', args);
       ole2.destroy_arglist (args);
       ole2.RELEASE_OBJ (my_selection);
       ole2.RELEASE_OBJ (get_spell);
       ole2.RELEASE_OBJ (my_document);
       ole2.RELEASE_OBJ (my_documents);
       ole2.invoke (my_application, 'QUIT');
       ole2.RELEASE_OBJ (my_application);
    END;Call it like this: SPELL_CHECK ('BLOCK.MY_TEXT_ITEM' );

  • How to implement the Export to Excel funtionality in VC like in Webdynpro

    Hi
    I have requirement to display the BAR charts, Pie charts ,Line graphs based on the data retreiving from the R/3 thorgh VC.
    I hope it is possible .
    i have requirement like exporting the data whichis pulled from the R3 to display those charts, this data need to be exported to the Excel sheet by providing the button in VC. Like same way we have the privision in WEbdynpro exporting table data to excell sheet.
    How to implement the same thing in VC,
    Can any body help me
    Regards
    Vijay

    1) yes, it's possible
    2) Another one that's in the Visual Composer WIKI:
    https://wiki.sdn.sap.com/wiki/display/VC/Exportingdatafrom+VC

  • How to implement the FCKeditor in the WPC

    Hi all,
    can anyone tell me how to implement the FCKeditor in the Web Page Composer?
    I failed to implement TinyMCE because of the domain relaxing thing...
    Thanks a lot
    Steffi

    It's one of J2EE Patterns - Value List Handler.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
    Here is some implementation.
    http://valuelist.sourceforge.net/
    and some article
    http://www.devx.com/Java/Article/21383
    Just google "J2EE paging"

  • How to implement the Internationaliztion in VC

    Hi All,
    How to implement the Internationalization in VC. Based on the Portal user Lanugauge attribute. how to implement .? Is it possible to implement the Internationalization , changing the  displaying label data and Title names in VC application.
    Regards
    Vijay

    Hi Vijay,
    I think this help-entry should answer all your questions:
    Preparing iViews for Portal Translation:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/48e7428d877276e10000000a1550b0/frameset.htm
    If you have further questions, don't hesitate to ask!
    Regards,
    Christian
    don't forget the points

  • How to implement the pagination  in the entity bean?

    How to implement the pagination in the entity bean? could The rumnum and sub qurey be used in the ejb ql?
    Would you mind giving me some methods to implement it?

    It's one of J2EE Patterns - Value List Handler.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
    Here is some implementation.
    http://valuelist.sourceforge.net/
    and some article
    http://www.devx.com/Java/Article/21383
    Just google "J2EE paging"

  • How to implement the search help exit to MM01 for Material by product hiera

    Hi,
    How to implement the search help exit to MM01 T-code for Material by product hierarchy,
    but system default it gives the data from MVKE table, my client wants from MARA table,
    i created the one Function Module, write this code in that FM.
    IF CALLCONTROL-STEP EQ 'DISP'.
    REFRESH RECORD_TAB.
    SELECT * FROM MARA INTO TABLE RECORD_TAB
    WHERE PRDHA = 
    ENDIF.
    I Face the problem what variable i have to pass in WHERE CONDITION, FROM THE MM01 T-code.
    is't require to IMPORT variable from MM01 program, what is that import variable, please give me the solution.
    thanks to all.

    Hi there..
    check my web blog on search help exit...
    [Search help exit code|https://wiki.sdn.sap.com/wiki/x/du0]

Maybe you are looking for

  • How to print on photo paper with HP Photosmart 7520 on iphoto '11

    Dear All, I have a very serious problem. I've tried so many settings and configurations without success. Very simple. I cannot choose the photo tray in any way and I cannot print on photo paper. I get everything on A4 format. The printer is working f

  • ITunes (11.3 64bit) cannot run because some its required files are missing. Please reinstall iTunes.

    just set up my new laptop lenovo x240. Windows 7 SP1. itunes 64bit 11.3 first install went fine. then I tried to move my preexisting library. the library did not show the apps. so I tried around. Treid to re-install itunes. Since I did, after the re-

  • Upgrade Mail

    Does anyone know how to upgrade Mail to 3.5? I cannot find a download for this anywhere - or is it available only with 10.5? Reason for asking is that one of my macs is running 10.5 the other can't cause of its spec....

  • Dynamic Load Balancing vs Static Load Balancing

    What do you guys recommend, Dynamic or Static Loading Balancing+Logon Groups? This is to be for 2 instances envoirnment. 1 Central and 1 Dialog. Thank you, Samer

  • Error Idocs automatically transffered to users SAP Inbox

    Hi, I need to configure, such that Idocs with certain error messages will be automatically transffered to the users inbox (SAP inbox) based on the plant in the Idoc. Understand that to achieve this, will have to maintain the org plan in transaction P