How does SingleThreadModel handles doget and dopost?

Hi,
I have a requirement to synchronize the DB transactions but my servlet has doGet and doPost methods instead of service method.
public class EMEATPRates extends HttpServlet implements SingleThreadModel{
doGet(){
synchronized(){
---Gets the data from DB and displayes on a page
doPost(){
synchronized(){
----saves the changes to the DB
I need to get a lock when an user requests for page(doGet()) and release the lock only after he saves it(doPost).
Does SingleThreadModel handles this?

HTTP GET requests submit any form parameters within the URL of the request itself. HTTP POST requests submit any form parameters within the HTTP message body. Let's say you have two forms for a logon screen:
userid, password
HTTP GET: http://localhost:8080/LoginServlet?userid=foo&password=bar
[http headers]
[http body (empty)]
HTTP POST: http://localhost:8080/LoginServlet
[http headers]
userid=foo&password=bar
Clearly, for something like a logon screen, you would want to POST (no need to see the user's password in a URL if someone walks by). Otherwise, the implementation is up to you. I personally like cleaner-looking URL's, so I usually POST.
- Saish

Similar Messages

  • How to Submit doGet and doPost request using javascript ?

    Hi,
    My requirement is:
    Need to submit form to two different methods doGet and doPost.
    doGet will authenticate the request by asking to enter username and password.
    After successful authentication we need to call doPost to submit the data of form.
    I tried using Get(url); and Post(url,data,type); methods of FormCalc but i am not able to retrive the attribute and its value using Post.
    my FormCalc script is
    Get("https://server:port/servlet"); //I am able to call doGet method successfully
    Post("https://server:port/servler","user=abcd&password=123456"); //I am able to call doPost method but I am not able to retrive the attribute user and password in doPost method.
    i tried request.getAttribute("user"); and also i tried request.getParameter("user");
    both are coming as null. How to submit form data to doPost method of servlet.
    Also I would like to know is there any javascript for the same.

    Why do you want to use javascript..? Why not action listener..? You can check whether its an empty string by checking
    if(str != null && !str.equals("")) {..}
    where str is the variable for inputText value.
    If this is not helpful, do provide more details on which version of JDev you are using and what are you trying (your usecase).
    regards,
    ~Krithika

  • How do I combine my iphone contact list with my laptop pc contact list?  And how does it handle duplicates with different information?

    How do I combine my iphone contact list with my laptop pc contact list? And how does it handle duplicates that have different information?
    How do I merge my iphone calendar appointments/alerts with my laptop pc calendar appointments/alerts?  And how does it handle duplicates?
    I do not need anything to change on my email that is working fine on both.

        gspielman,
    Help has arrived to assist you with getting those contacts on both your devices. The Verizon cloud service is definitely a great tool to use and you can also use Apple iCloud as well. When you sign into the Verizon cloud on your iPad does it give an option or message to restore?
    CandiceH_VZW
    Follow us on Twitter @VZWSupport

  • Is it possible to use doGet() and doPost method in one jsp

    i am having a jsp form which will perform upload as well as download.There is a seperate servlet for download and upload.For downloading i use doGet method and doPost for the upload.how can i change the method dynamically for the above cases.

    Hi,
    in your jsp, if you call:
    request.getMethod();
    it should the string "GET" or "POST" depending on the HTTP method used, so you could do something like
    <%
    String httpMethod = request.getMethod();
    if ( "GET".equals(httpMethod) ) {
    // code to handle get requests
    else if ( "POST".equals(httpMethod) ) {
    // code to handle post requests
    %>
    I probably would of done it in a servlet(override doGet and doPost), or 2 seperate jsps
    Hope this helps
    Dominic

  • Jave servlets- doget() and dopost() methods.

    Iam trying to learn servlets but got confused on these doget() and dopost() methods usage. I just want to know generally what does these methods do in general (like the doget() sets the header..but what about dopost()?). I saw some example code where doget() is called within a dopost()method so Iam not clear about their purposes.
    I'd appreciate any help possible. Thank you.

    The doPost() and doGet() (also doHead() etc.) methods are all designed to handle specific HTTP request types. eg: doGet() handles HTTP GET requests (requests caused by common HTML links or typing a URL in your browser's address bar) while POST handles HTTP POST requests (commonly generated by HTML form submissions).
    When you see an example of a serlvet's doGet() being called within it's doPost(), it is because, at least for part of the processing, the servlet will be treating the two request types the same way.

  • ColdFusion 11: cfclient ... how does normal CFML code and cfclient code interact?

    G'day:
    I am reposting this from my blog ("ColdFusion 11: ... how does normal CFML code and  code interact?") at the suggestion of Adobe support:
    @dacCfml @ColdFusion Can you post your queries at http://t.co/8UF4uCajTC for all cfclient and mobile queries.— Anit Kumar Panda (@anitkumar85) April 29, 2014
    I have edited this in places to remove language that will be deemed inappropriate by the censors here. Changes I have made are in [square brackets]. The forums software here has broken some of the styling, but so be it.
    G'day:
    Another quick one. I'm raising these quick-fire questions here because Adobe have declined to suggest a better place to raise them, other than as comments on one of their blog entries. Well that was Ram's suggestion (which I don't think is terribly-well thought out). He declined to react to my suggestion that the Adobe ColdFusion forums might be a good place. Anit suggested Twitter or just emailing him, but I think there'd be public interest in this stuff, so don't want to resort to email.
    As I'm the master of what goes on on this blog: I'll clutter this thing up.
    Say I want to have a mix of "normal" CFML and <cfclient>-based CFML in the same file. I can only presume the intent is to allow this, otherwise having <cfclient> as a tag rather than just a file extension seems like a poor approach. Obviously if one can have a start tag and an end tag, then code can come before (and I guess after) the <cfclient> tags themselves.
    So I'd expect this to work:
    <cfset message = "G'day World"> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    However all I get is an error in JS:
    Uncaught ReferenceError: message is not defined variablesScopeVariable.cfm:4
    And, indeed, the only mention of message in the JS source is the one that's erroring (as it's on the right-hand side of an assignment).
    So I thought perhaps <cfclient> worked like <cfthread> and I needed to pass attributes into it:
    <cfset message = "G'day World"> <cfclient message="#message#"> <cfoutput>#message#</cfoutput> </cfclient>
    This doesn't compile:
    Attribute validation error for the client tag.
    The tag does not have an attribute called message. The valid attribute(s) are ''.
    ColdFusion cannot determine the line of the template that caused this error.This is often caused by an error in the exception handling subsystem.
    Note also there's an error in the error message itself. It's not the <client> tag, it's the <cfclient> tag.
    Rightio then, so I tried just using the request scope instead (the code's the same as the variables-scoped example, except using the request scope). No dice: same JS error.
    As a last ditch effort, I just tried to see if <cfclient> was aware of anything going on around it, by passing a value on the URL, and seeing if <cfclient> saw that, eg:
    <cfclient> <cfoutput>#URL.message#</cfoutput> </cfclient>
    This behaved differently from the variables- / request- scoped examples, in that I didn't get a JS error, I just got this on the screen:
    undefined
    And no JS error. It pains me to have to do this, but let's look at the generated JS to see why the behaviour is different:
    Variables scope example:
    <script type="text/javascript" src="/CFIDE/cfclient/cfclient_main.js"></script> <script type="text/javascript" src="/CFIDE/cfclient/cffunctions.js"></script> <meta name="viewport" content="width=device-width"> <script type='text/javascript'> globalDivStruct=null; var _$variablesScopeVariable_func=function(){     var self=this;     var variables={};     self.__init=function(){         var localdivstruct=globalDivStruct;         var __output_var="";         var tmpVarArray={};         localdivstruct.outputvar+=message;        return""     } }; function __startPage__$variablesScopeVariable(){     document.write("\x3cdiv id\x3d'__cfclient_0'\x3e\x3c/div\x3e");     window.ispgbuild=false;     var clientDivStruct={         divId        : "__cfclient_0",         outputvar    :""     };     globalDivStruct=clientDivStruct;     try{         _$variablesScopeVariable=new _$variablesScopeVariable_func;         _$variablesScopeVariable.__init()     }     catch(__eArg){         if(__eArg!=="$$$cfclient_abort$$$")             throw __eArg;     }     __$cf.__flush(clientDivStruct) } __startPage__$variablesScopeVariable(); </script>
    The only significant difference (other than function names, based on the file names) between this and the URL-scoped example is the indicated line above is replaced by this in the URL example:
    localdivstruct.outputvar+=__$cf.__arrayGet(URL,"message",true);
    So it's like it's trying to do the right thing, but just failing. I thought it might be because CF does stupid thinks with scope-key casing, and changed the <cfclient> code to expect URL.MESSAGE not URL.message, but this didn't work either.
    So I'm flummoxed. I can't find anything in any documentation which might point me in the right direction, so anyone know what the story is here?
    Update:At Joel's suggestion I tried this:
    <script> message = "G'day World"; </script> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    Thisworked. Which elicits from me a mixture of "heh: cute" and "this is an abomination". 
    Adam

    PaulNibin wrote:
    Hi Adam,
    When you write code inside <cfclient>, it is translated to java script. It cannot access server side variables(defined outside cfclient).
    <script> message = "G'day World"; </script> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    The above code works because, message is defined in a script block and client side CFML is interoprable with javascript. So client side CFML can use variables, functions defined in javascript blocks.
    Thanks,
    Paul
    So you're saying you did not provide a mechanism for transferring the variables from the server-side part of a file's code to the client side part? Is this not a bit of an oversight?
    And what - in your mind - is the point of having a file with blocks of both normal CFML, and then a <cfclient> block, then more CFML, then another <cfclient> block (for example) if the code cannot interact?
    Adam

  • Write a servlet without doGet() and doPost() methods

    Hi,
    Can we write a servlet without doGet() and doPost() methods ?

    public class MyCoolServlet extends HttpServlet
    public void init(ServletConfig servletConfig) throws ServletException
    public void service(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
    // your code here
    }Just an example on how to do it.
    A servlet is loaded by server (before any request). It will run the init function. Then pick up an request, spawn a thread and put this servlet code into the thread, give it session, request and response objects, then call serivce.
    Remember that init is called before, outside the thread, while service is inside the thread and the last to be called. Nice place to put your code.
    If you need to have some sort of init function to be called first on every request PR USER, then make your own function, and call it first in service method.
    Stuff that are put in init() function might only get runned once in the entire server lifetime. Until restart.

  • How do you handle date and time in a global implementation

    Hello:
    Does somebody have a strategy on handling date and time in a global environment? Does Oracle timestamp it based on the Time Zone it is in? If so, if I have a distributed data architecture and data is getting replicated across these sites that are in different time zones, how does it handle the situation?
    Thanks.
    venki

    There are a variety of TIMESTAMP data types-- TIMESTAMP, TIMESTAMP WITH TIME ZONE, and TIMESTAMP WITH LOCAL TIME ZONE. TIMESTAMP WITH TIME ZONE or TIMESTAMP WITH LOCAL TIME ZONE will probably work for you. If you are going to display the data to a user, however, TIMESTAMP WITH LOCAL TIME ZONE is probably the best option since it automatically converts to the local time zone. If you just have application code that is looking at the timestamps, either one will work.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How does impdp handles external tables

    I am just done with schema import and one of the package is invalid because it is referring the External Table. I am getting the error " Table or View does not exist".
    How does impdp handles external tables ?
    Do we need to replicate the directories and files from the source to imported destination ?
    Thanks

    Hi,
    Yes...
    external table directory not available on imported destination operating system
    You need to create the directories and files from the source to imported destination
    Recompile the invalid package
    Thanks

  • How does FCP handle 23.98 DV Files?

    Hi All,
    Has anyone Edited using the DV-NTSC 24P (23.98fps) Easy Setup?
    1) How does FCP handle this video connected to a DV Converter Box like the Canopus ADVC-110?
    2) Does it actually play at 23.98fps on a monitor connected to the DV Converter Box?
    3) Does it get converted to 29.97fps somewhere in the process before it gets displayed?
    4) is it displayed at 29.97fps or is it really being displayed at 23.98fps?
    these are things that I am not sure of.
    sorry if I posted this message a couple of times. I didn't know that hitting the "Tab" Button posts the message, I thought it would just function like the Tab in a normal Text editor and indent a line. But here it doesn't.
    thanks
    Kalagan

    Hi,
    Thanks for the feed back. I guess I should fill in the caps a little.
    *DESCRIPTION OF ISSUE:*
    One of our main Clients Disney, is migrating to a Tapeless Workflow based on ProRes HQ 422 @ 23.98fps. From here on out, they will only send us ProRes HQ 422 1920x1080 files @ 23.98fps and they want us to Edit every project we work on for them @ 23.98fps. At the moment, it doesn't sound like they care if we Edit our projects in ProRes HD or some SD format, but the important thing to them is that we edit @ 23.98fps.
    PROBLEM:
    Our facility doesn't have the infrastructure to support 25 machines accessing ProRes HQ 422 files. Our facility was built to support DV NTSC @ 29.97fps and we have been working this way fairly well, for a number of years.
    SOLUTION:
    I am trying to find a way to continue to us our current equipment and satisfy Disney's request to work on all their projects at 23.98fps, starting from 1920x1080 ProRes HQ 422 files @ 23.98fps. So, it was my hope to be able to take the 23.98fps ProRes files and export them to 23.98fps DV NTSC. This way we wouldn't have to reconfigure our entire Facility (which would cost a couple hundred Thousand dollars).
    My approach was to:
    1) Use Media Manager to render a new DV NTSC file at 23.98fps, which it does pretty well for the most part. It keeps the Timecode consistent between the two files (very important), but doesn't allow you to Letterbox the 16x9 video in the 4x3 frame, it just stretches it to fill the entire 4x3 frame (not so good).
    2) Then import the newly created DV NTSC 23.98fps file into a FCP Project based on the DV NTSC 24(p) 23.98fps EASY SETUP. Which works well. No problems there.
    3) Then Play the file in FCP out through a Firewire based Canopus ADVC-110 DV Converter connected to a SD Sony Monitor. This seemed to worked fine also.
    The fact that it plays is great!!!! But, that brings up the question, is it really playing a 23.98fps?
    My understanding of Standard Definition and specifically DV NTSC, is that it can only be displayed at 29.97fps, it doesn't support 23.98fps natively. So the fact that it played when I tested it got me thinking that I may be missing something here and DV NTSC and other SD equipment (like the Sony SD Monitor) can playback/support 23.98fps SD video. But that goes against everything I know up to this point!!!
    Have I been wrong all this time?
    1) Can SD Video and DV NTSC Video be displayed at 23.98fps?
    2) Or is it getting converted to 29.97fps somewhere in the process before it is getting displayed?
    3) If it is getting converted back to 29.97fps, then where is it getting converted, FCP or in the DV Converter Box?
    I am sorry I went a little long on this email, but it is a problem that will have great influence on they way we work for a couple of years to come!!
    Thanks for your input!!
    Kalagan

  • How do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the onli

    how do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the online photoshop, and I really want to create my own customized url and post photos to my gallery and share them with the world, family, and friends, but i need help because i can't figure how to do any of this, would really appreciate feedback and assistance, thanks, - claire conlon

    To add to sig's reply, "calibrating" does not calibrate Lithiu-Ion batteries, it calibrates the charge reporting circuitry.  If you look at the effect of deep discharging Lithium-Ion batteries in the data from the independent test group, Battery University, you will see that doing so shortens the life of the battery significantly. It looks like an optimum balance between use and life is at a discharge level of 50%.

  • How does Mavericks handle 2nd monitor differently?

    Since I upgraded to Mavericks, I have liked having a 2nd task bar on my 2nd monitor.
    But I haven't figured out how it decides where to put pop up windows.    Sometimes they are on one monitor, other times on the other.   How does it decide?
    And I have one application (SimpleFloatingClock) that used to start up on my 2nd monitor when I reboot, but now starts off on the 1st monitor (where it would boot up when I have to reboot without my 2nd monitor - which in the past has been at the Genius Bar).

    I like to have my iTunes on one monitor, but use my iMac's display for other work.   But when the iMac's display is active, I get a window from my iTunes behind my browser (or whatever) that I'm using on my iMac.    I liked it the old way when it popped up in front of my iTunes and could see it.

  • How to create blocks on Procedures? How does one handle I/U/D on the block?

    Hello Gurus,
    How to create blocks on Procedures? How does one handle I/U/D on the block?
    Please give an example.
    Thank You,

    Hello Gurus,
    How to create blocks on Procedures? How does one handle I/U/D on the block?
    Please give an example.
    Thank You,

  • How does CEF perform equal and unequal cost load balancing?

    hello
    How does CEF perform equal and unequal cost load balancing?
    thanks

    Hello Wang,
    it is only EIGRP that can perform load balancing over unequal cost links.
    For equal cost links CEF allocates 16 buckets and maps them to the the physical links.
    the result of a binary operation is used to associated a packet to an outgoing interface:
    Source IP address EXOR DEstination IP Address EXOR hash
    the hash is a seed that changes only at every reload.
    Actually the last 4 bits are used so that each flow can be classified in one bucket.
    then the outgoing interface is the one asscociated to the result of the exor operation.
    Another way to see is that m bits are used so that 2^m is equal to N number of links (if N is even)
    the rule is simple and pre-established
    Hope to help
    Giuseppe

  • HT1338 How does one uninstall Garageband and other things?

    How does one uninstall Garageband and other things on the Macbook air?

    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash.  Applications may create preference files that are stored in the /Home/Library/Preferences/ folder.  Although they do nothing once you delete the associated application, they do take up some disk space.  If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application.  In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder.  You can also check there to see if the application has created a folder.  You can also delete the folder that's in the Applications Support folder.  Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item.  Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder.  Log In Items are set in the Accounts preferences.  Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab.  Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    Some software use startup daemons or agents that are a new feature of the OS.  Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.  Unfortunately Spotlight will not look in certain folders by default.  You can modify Spotlight's behavior or use a third-party search utility, EasyFind, instead.
    Some applications install a receipt in the /Library/Receipts/ folder.  Usually with the same name as the program or the developer.  The item generally has a ".pkg" extension.  Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are many utilities that can uninstall applications.  Here is a selection:
        1. AppZapper
        2. AppDelete
        3. Automaton
        4. Hazel
        5. AppCleaner
        6. CleanApp
        7. iTrash
        8. Amnesia
        9. Uninstaller
      10. Spring Cleaning
    For more information visit The XLab FAQs and read the FAQ on removing software.

Maybe you are looking for

  • How do I keep watermarks and presets ( with their order ) synched between computers

    I have a desktop which I use for heavy picture editing and a mac book air that I use for on the fly picture editing to show clients during photo trips. I want to figure out a way for keeping my watermarks and presets ( with their order and folders I

  • How can i see flash videos with my iPad 2

    Hi , i need to know if apple fixed the problem with the flash videos

  • How do i mail merge with the new Pages and Numbers?

    How do I mail merge with the new Pages and Numbers? On Pages 09 I have a document that draws variable data from a spreadsheet created in Numbers. With the new Pages and Numbers program update, my links are lost and I am unable to see how to correct t

  • IFrames on Published Site

    I have the site published to folder and FTPed to the domain where I want it. All site functions are active (blog, photo gallery, navigation), yet my two iframes do not work (one is an embedded Google Calendar, the other a Google Spreadsheet). They di

  • Feedback on Targus ultra-slim hard drive

    I have an 80 GB hard drive on my PBook but use only approximately 30 GBs. and that figure, of course, includes all contents of the operating system. At home (in Canada), I have an 80 GB. LaCie external hard drive, enabling me to back up on a regular