Can't get to the doGet in the servlet

I have a java client using HttpURLConnection to talk to a servlet. No matter I use conn.setRequestMethod("GET"), which is the default method, or not, I always hit the doPost method on the servlet side. What did I miss? How do I get to the doGet method? I need to use the same servlet to get and post data to the server. I don't want to add a parameter telling the servlet that I am uploading or downloading.
Thanks.

Greetings,
Thanks Tony. I didn't set the Content-Type before
seeing your first reply :-). I tried several content
types and none of them helped. This is the code
before.
     conn = (HttpURLConnection)url.openConnection();
conn.setUseCaches(false);
conn.setDoInput(true);
conn.setDoOutput(true);The only other thing that's out of place in the present situation is the call to setDoOutput(true) which is unnecessary since your client is not actually sending data to the server(?). However, I'm not sure this is causing the problem since I never set this for GET requests in my own projects (preferring, instead, to make a distinction in my clients between input - GET - and input/output - POST or PUT - operations and use a "method dispatching" framework in my servlet(s)...). ':) Anyway, the above looks "fine" and should result in a GET request being sent to the server, though you might remove the doOutput setting and see if it makes a difference. If not, then the error would seem to be not in the client but in the servlet...
Regards,
Tony "Vee Schade" Cook

Similar Messages

  • I downloaded 11.1 but now can't access the store, can only view my library. I've reinstalled but still get a blank, white screen when I try to go to the itunes store. How can I get to the store for purchases?

    I downloaded 11.1 but now can't access the store, can only view my library. I've reinstalled but still get a blank, white screen when I try to go to the itunes store. How can I get to the store for purchases?

    In iTunes prefs>Store - is the Store check box unchecked?
    Did you repair pemissions with Disk Utility?
    MJ

  • How can I get just the text to resize, rather than the entire web page?

    I used to be able to re-size just text on a webpage by typing Ctrl + +. Today, the entire webpage re-sizes, and when I move to another page it reverts. (I see this mostly in Facebook.). Why did this change, and can I go back to having just the text re-size?

    ''How can I get just the text to resize -- zoom text only''
    steps
    #"Alt" if no menu bar, then
    # View > Zoom > Zoom Text Only
    Zoom text of web pages - MozillaZine Knowledge Base
    :http://kb.mozillazine.org/Zoom_text_of_web_pages
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • I have an iPhone 4 and my lock button is jammed and I also can not touch anything on the left side of my screen well as any pop ups from the phone itself, so i can not get past the set up stage in reset process...how can i fix it/can it be fixed?

    I have an iPhone 4 and my lock button is jammed and I also can not touch anything on the left side of my screen well as any pop ups from the phone itself, so i can not get past the set up stage in reset process...how can i fix it/can it be fixed?

    Make an appointment at the genius bar and get the phone replaced.

  • We can't get to the camera roll right now

    I have a dell Latitude 10 table with Windows 8.1 RT. Last week I decided to unload all the pictures from the camera roll to my PC and I did it without a problem, but in the process I removed the camera roll folder under the public pictures library. Since
    then, the camera app is not working and it gives me the following message: "We can't get to the camera roll right now". I've re-created the folder, set the default save location and public save locations to the Public Pictures folder but the error
    keeps popping up every time I open the camera application. If I try to shoot a photo or a video it tells me that it couldn't be saved. How do I set the camera app to use the new folder?

    I had the same Problem, and all experts could not help. I even dowloaded tools that say thy would fix the problem. Anyway as a matter of fact it still is a computer, no magic.
    I found a way: Open regedit, search for "User Shell Folders".
    Then check all the directories.
    In my case one of the directories refered to the one I deleted. I just changed it and restarted my computer.
    On my iconia it saves into this key:
    I changed it | Keep the Name of the folder "Camera Roll" depending on your language it will rename the folder in the Explorer library automaticly. (in Germany to Eigene Aufnahmen)
    {AB5FB87B-7CE2-4F83-915D-550846C9537B}
    D:\backup pics\Camera Roll

  • When creating a book how can I get all the photos from an album to show up in the order they were in the album?

    When creating a book in iphoto, how can I get all the photos from the album I want to use to show up in the order that they are in the album?  When I tried to use the option to add my own photos instead of having the program "flow" them, they showed up all mixed up.

    iPhoto puts them in the book in chronological order.  So to get your photos from an album into an iPhoto book in the same order you will need to use the Photos ➙ Batch Change ➙ Date menu option and set them all to the same date with a 1 minute time difference between each. 
    OT

  • Firefox connects to google-analytics for some sites, and then gets stuck, and I can never get onto the site. How do I prevent Firefox from connecting to google-analytics? I use XP with service pak 3 in English

    Firefox connects to google-analytics for some sites,when i click on links in websites or emails and then gets stuck, and I can never get onto the site. Or opens a new bower behind the one i'm usind that's blank i don't even know it's there untill i close the one i'm using. How do I prevent Firefox from connecting to google-analytics? Or opening a blank bowser behind the one i'm using. I use XP with service pak 3 in English
    == This happened ==
    A few times a week
    == a couple months ago

    I got the same issue.
    I go on a website and all the sudden another window pops up with "results.google-analytics.com" or "search.google-analytics.com". It has often ads for other sites for example. black single dating site
    how can I can I stop that from happening again?
    I didn't download or do anything, just visit websites, that I visit on a regular basis.
    OS: Windows XP
    Firefox Version: 3.6.6

  • I have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    i have made with iweb a website on my macbook, now i want to change it, through my imac, how can I get in the program , which is on the mac book. On both computer I have Lion

    You need to transfer your domain.sites file from your MacBook to your iMac.  This is the file where iWeb stores all info and can be found under User/Library/Application Support/iWeb/domain.sites.
    Transfer this file from your MacBook to the same place on your iMac and double click the domain.sites file and iWeb will open it on your iMac and you can update your site from there too.

  • After upgrading to Mountain Lion, I repurchased Garageband and I can't get passed the complete installation. I don't seem to have the "com.apple.garageband.plist" file that has been a common solution. Any suggestions?

    After upgrading to Mountain Lion, I repurchased Garageband and I can't get passed the complete installation. I've read through several posts that all reference the "com.apple.garageband.plist" solution. I don't seem to have the referenced .plist. Any solutions or suggestions?

    Did you upgrade from SnowLeopard?
    I can't get passed the complete installation
    What exactly is happening? Is GarageBand trying to download over and over again?
    all reference the "com.apple.garageband.plist" solution. I don't seem to have the referenced .plist.
    The property list stores your preferences, but also the settings from the last run of the application.  If that file is corrupted in some way, you might see third behaviour.
    You must have this file, for it will be recreated automatically, if it is missing, or you have a permissions problem with your user library.
    Perhaps you did look in he wrong place.
    in MacOS 10.7. or later the User Library is hidden. To find the Preferences Files use the Finder's "Go" menu:
    Quit GarageBand, if it is running.
    Click onto you Desktop to bring the Finder forward.
    In the Finder Menu press "Go" and hold down the "option/alt" key, until your user library appears in the drop-down menu
    Select "Library" and in the Finder window that opens navigate to the "Prederences" folder; move com.apple.garageband.plist to the Desktop.
    Log off and on again (don't skip that step!). Retry GarageBand and see if it GarageBand is now downloading the missing content properly.
    If that does not fix the problem, post back and explain in more detail what the download problem is.
    Why did you "repurchase" GarageBand? If you already owned GarageBand '11, it should be unnecessary.
    Regards
    Léonie

  • I have a issue with my mac book pro. For some reason it won't stay powered on. I can't get past the apple loading logo. The battery is fully charged so it is not the problem. Can anyone tell me what the problem may be and how can i get it resolved?

    I have a issue with my mac book pro. For some reason it won't stay powered on. I can't get past the apple loading logo. The battery is fully charged so it is not the problem. Can anyone tell me what the problem may be and how can i get it resolved?

    The battery is fully charged so it is not the problem.
    What happens when you use the MagSafe?

  • I downloaded pictures onto my iPhone from computer twice by mistake now when i uncheck/sync then check and sync again  i keep getting two lots of pics..how can i get just the one set again? thnx

    I downloaded pictures onto my iPhone from computer twice by mistake now when i uncheck/sync then check and sync again  i keep getting two lots of pics..how can i get just the one set again? thnx

    You're welcome.
    All photos transferred from your computer are stored in the iPhone's Photo Library regardless if you select a single album or folder of photos to be transferred or multiple albums or folders. The photos on the albums or folders of photos include a pointer to the original photos stored in the Photo Library. The photos are not duplicated taking up double the storage space. This way you can view the photos in an album or folder of photos only by selecting the album or folder, or all photos in all albums or folders by selecting Photo Library.
    Makes more sense when transferring multiple albums or folders of photos which cannot be changed when transferring only a single album or folder of photos.
    The same applies with iTunes and music playlists. A song can't be in a playlist unless it is in the main iTunes library. Placing a song in a playlist does not duplicate the song.

  • HT4759 Please I need a help I cannot backup my ipad and can not get into the icloud storage.  What would I do to get into my ipad?  please I need your help

    Please I need a help.  I cannot backup my ipad and can not get into the iclous storage to delet them, because its read icloud storage is full.  Please do you have a knowledge of how I can get rid of the message and get into the ipad?

    Welcome to the Apple Community.
    You might try a forced shutdown to begin with, hold down the top and home buttons together until the device shuts down, then restart it.

  • HT201365 I've forgotten my passcode and can't get into the phone to turn off "find my iphone" in order to restore it... Help Please

    I've forgotten my passcode and can't get into the phone to turn off "find my iphone" in order to restore it... Can anyone help?

    If you know the password to your apple id login - you can then do a restoration once you have put your device into recovery mode using itunes.
    read this article to give you direction how to put your device into recovery mode.
    Once you have put in your apple id login and password this then will allow you to restore the device once the device is placed in recovery mode.
    good luck!
    http://support.apple.com/kb/ht1808

  • How can I get only the music I want onto my iPhone using iTunes Match

    how can I get only the music I want onto my iPhone using iTunes Match?  At present it is putting a random selection on; it has none of the same control as iTunes on my Mac.  And although I uploaded all my album artwork to iCloud, it is not transferring it back to my iPhone

    Iphone are meant to be sync to one itunes library only.
    You can copy those songs to a cd and then put a copy to your itunes media library.

  • Can I get all the ipads in school (18) to access the same itunes playlist?

    Can I get all the ipads in school (18) to access the same itunes playlist? We want to use the ipads to create movies but need music, we want to legally download music and let the children have access to the same playlist, can we do this and how? preferably without downloading the same track 18 times?

    we would ideally use Icloud, my home account has 1 iphone and two ipods that share the same user and playlists etc, ideally I would want to create this but over the 18 ipads in school, I do however use the usb to update them so If i can do it via a sync on Icloud that would be better?

  • My hard drive crashed and I have lost my Itunes library. How can I get my the music that I loaded from my own CDs back on my PC from my iPod?

    My hard drived crashed in my HP Pavilion desktop and I have installed a new one. I have Windows 2007. My Itunes library is gone. How can I get all the music that I loaded onto my iPod from my own CD's back into an Itunes library?

    The loading of audio files to iPod is designed to go one way only: computer to iPod. There are some third-party applications available which will rescue an audio library and write the files back to a PC HDD. The playlists might not copy, nor the album art work, nor videos but you might be able to recover all audio files. Some apps are open source and available for free download, for example: Senuti, Onyx. There are others which are  Windows-based; do a Google search to find out. 

Maybe you are looking for