Cant get inputstream in servlet

Hi,
I am using tomcat 5.0 and trying to get inputstream in servlet to print the content which i got from client..
Here is the code of my doGet()
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
     System.out.println("In Doget");
     try
          InputStream in = request.getInputStream();
          BufferedReader br = new BufferedReader(new InputStreamReader(in));
          String line = br.readLine();
          System.out.println("Line :"+line);
          while (line != null)
               System.out.println("Line :"+line);
               line=br.readLine();
     catch (Exception e)
          System.out.println("Exception occured in doGet:");
          e.printStackTrace();
     System.out.println("End of doGet :::");
When it try to invoke above servlet with this URL( http://localhost:8080/USUResetPasswordServlet?afadfasfd ), it is suppose to print me "afadfasfd" in the server console..But is not..Any idea, why it is failing...
Thanks in advance
Satya

Hi,
Thanks for the response..
It is some thing confusing..Let me put it this way..I
am trying to contact the servlet from a java
program..Here is the code for it..
URL servlet = new
URL("http://127.0.0.1:8080//USUResetPasswordServlet");
String xmlStr = "<hai>hasafd</hai>";
URLConnection connect = servlet.openConnection();
               connect.setDoOutput(true);
               connect.setDoInput(true);
               //connect.connect();
               OutputStream outStr = connect.getOutputStream();
               //PrintWriter out = new PrintWriter(outStr);
               outStr.write(xmlStr.getBytes());
               outStr.flush();
               outStr.close();
InputStream is = connect.getInputStream();
Any idea, why it is not priting content in servlet
console??
SatyaThat would cause your servlet's doPost method to be invoked, not doGet. So what is your doPost doing?

Similar Messages

  • How to get InputStream of uploaded file from request?

    The situation:
    Client is uploading xml file to server.
    <form METHOD=POST ENCTYPE = "multipart/form-data" action="SendFile" accept="text/xml">
              <input type="file" name="SentFile" />
              <input type="submit" value="go"/>
    </form>Then I need to parse data from file.
    I want to use method javax.xml.parsers.DocumentBuilder.parse(InputStream is)
    But, how to get InputStream of uploaded file from request?

    You cannot get the InputStream of the uploaded file directly. The InputStream you can obtain from request.getInputStream() contains a lot of other data as well as the uploaded file. You will have to parse the data in the InputStream to find the data that belongs to the file.
    A short cut is to use the HTTP Multipart File Upload available from www.jenkov.com. It simplifies file upload and makes it easy to obtain an InputStream for only the uploaded file. It also handles upload of multiple files. It is free, open source, Apache license, so if it doesn't fit your needs, you can always read the code and see how it works. Then write your own upload servlet.

  • [pppacker] ERROR: Failed to pack public part: Failed to get InputStream fo

    Dear Friends,
                  I have downloaded the ECC_PURCHASEORDER002QR from HU2 system (wadmin)  & saved on Local PC with extension as .xml.
    I have created External Service by picking up this WSDL from Local pc.
    When i try to build this its giving me packing error
    error text
    [pppacker] ERROR: Failed to pack public part: Failed to get InputStream for resource C:\Documents and Settings\chandra.dasari\.dtc\LocalDevelopment\t\8A377BFE144E14E551EDE29FADD14317\classes\com\sap\es_po\extsrv\purchaseorderbyidqueryresponse__in\input\Ns1_parameters$Ns1_PurchaseOrderByIDQueryMessage__sync$PurchaseOrderSelectionByID$Ns1_PurchaseOrderID.class
    We are currently using NWDS v7.0.07 with java SP 12.
    Any pointers to resolve this issue.
    Regards shekar chandra

    just out of curiosity why don't you use the RFC connection instead of web service? you seem to be calling an abap system.
    anyway, just to be sure i guess you mean importing a web service into CAF Core as external service. Right?
    what's the nature of your import parameters and your table definitions?
    See there're limitations using complex types with web services. you have less problems if you're importing RFC into CAF Core. My guess is that you're using complex types in your RFC definition that cause problems when translated into WSDL. Can you try at least to the tutorial 85 "Using RFCs as External Services (Service)" https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3529fea-0c01-0010-76a5-cf1239e38fd9?

  • My macbook pro no longer connects to my TV with the mini dvi to hdmi adapter. It was working fine now I cant get it to output to the Tv. Any ideas?

    My Macbook pro no longer outputs to my vizio led tv. It was working fine now I cant get any picture. It just says no signal. It is not the hdmi or the adapter because it works fine with my other tv. Any ideas on how to resolve this would be greatly appreciated. Please be as specific as possible. Thanks. BTW--I am using the mini dvi to hdmi adapter in case that was unclear.

    Since you say that the same connectors work on your other TV is suggests that the fault is not in the connectors but your Vizio TV.  I would check the settings on the Vizio TV.  Verify that is is set to receive HDMI input.  Perhaps you or some one else has inadvertently changed them.  Pressing the wrong buttons on a remote control device can do that.  (I am assuming no changes were made in SYSTEM PREFERENCES>DISPLAYS)
    Ciao.

  • I cant get itunes on my new laptop.  My laptop says I have to remove itunes from another computer as I can only have it on 5.  Problem is that apart from my ipad, I no longer have the others as they were either broken beyond repair or lost.  Any ideas?

    I am not good with computers.  I am trying to get my iTunes onto this new laptop but it says I am only allowed to have it on 5 computers and I must take it off one to ut it on this new laptop.  Problem is, apart from my iPad, I have lost one laptop and two have been broken beyond repair so I am unable to take it off!  Anyone any ideas?  I have tried to get iTunes support but cant get past the "date of purchase" as I can only guess when I bought my ipod (2009)

    Hang on...
    You can only authorise the songs you purchase from the iTunes Store to play on five computers.
    You can download and install iTunes (the iTunes programme) onto as many computers as you wish.
    Two different things.
    Assuming therefore, that your problem is that you have authorised five computers, but now no longer have some of them, you need to de-authorise all your computers and then re-authorise the computers you still have.
    To de-authorise your computers, go to your account in the iTunes Store and look for the Deauthorise All button.

  • I tried downloading a free app and it asked for my billing information and when i entered it, it says that there was a billing problem with a previoud purchase and i have to update it. I keep updating it and it wont let me verify it and i cant get apps

    I tried downloading a free app and it asked for my billing information and when I entered it, it said that there was a billing problem with a previous purchase and I have to update it. I keep updating it and it wont let me verify it and I cant get any apps even if they are free, and I just Deleted some apps to make room for my new upate!

    The message says: "The payment method has been denied, try another method"
    I'm living in the same country and city since I was born, so I don't think the location is the problem.
    And yes, I paid with the card a meal in Burguer King today. And nothing more.

  • How do I get my new iphone restored with my old backup? my old iphone had ios5 and the replacement phone i got has ios4 and it wont let me backup my phone because it doesnt have ios4... i cant get ios5 without restoring my iphone and backing it uo

    Basically, i need all my old stuff from my iphone 4 with ios5 onto my new iphone 4.  The new phone i received only had ios4. I went to get all my contacts and backup from my old phone onto my new phone and it wont let me because my new phone is only ios4 and my backup from my old phone was in ios5.  I cant get ios5 on my phone without creating a new backup of my new phone, which has nothing on it.  If i restore it as a new phone and backup virtually nothing from my new phone, will that get rid of all my old backup stuff from my old iphone?

    Bottom line is you CANNOT restore to a phone from a backup that has a more recent iOS which is what you're trying to do.  Just can't be done.

  • How do I connect my Mac Book Pro to a projector I have the adapter but cant get anything on the screen

    How do I connect my Mac Book Pro to a projector I have the adapter but cant get anything on the screen

    Go to your "screen settings". then chose "find screen" then you vill find the prosjector.
    this will probably fix your problem.
    if this dont works can it be something wrong with your adapter.
    hope it helps

  • I cant get two monitors to work on one pc.

    Does anyone know why i cant get two monitors working on one pc?
    I have a HP P6 2000 UKM computer, running windows 7 and it has a DVI D socket as well as the standard VGA (which i am using for my primary monitor)  I have got the right DVI  to VGA adaptor and have followed various instructions to set up duel disply but every tutorial i have seen says use the multiple display option,  but the option dropdown box is not there!
    Iv'e tried two different monitors but he same problem. If my graphics card does not suport 2 monitors then why is there a DVI D socket?
    Have never had this problem in the past!
    Please help.
    Nobby

    Hi,
    Please post the exact HP product number for your PC.
    VGA is analog and DVI-D is digital.  If you have two monitors then one of them needs to support a digital video signal if you want to use two monitors
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • HT1420 Cant get itunes to open.Error message:"its on a locked Cant get itunes to

    Cant get itunes to open.Error message:"its on a locked disk." What does this mean??!!

    ok heres what u gotta do
    yes i know its alot of steps but if you do them right it will work.
    1.remove all active versions of itunes
    2.then restart as it asks you to do, if it doesnt ask do it your self
    3.unplug ipod
    4.remove ipod software
    5. restart
    6.install the cd the ipod came w/
    7.when it asks you if you want to upgrade itunes say yes
    8.download the file
    9.intall the newest version
    10.restart
    if you have done exactly these steps(exactly in this order)then itunes should be working now

  • Help! I can't delete my neighbors email from my iPhone 5 icloud account after I sold it to him after restoring it to factory settings.  Now he's on my iCloud account and it cannot be deleted.  Its impossible.  help. It seems the first one cant get delete

    Help Please, I sold my iphone 4 to my neighbor after I restored it to factory settings.  I just bought a new iphone 5 and decided to check out the icloud "stuff' so that I can use 'find my iphone' because I have 2 kids.  I went to check out my icloud on my imac and in the address bar put icloud.com then signed in, double clicked on mail went accounts then clicked on the gear in the right hand corner and there it was.  My neighbor had his email in the icloud and there absolutely was no way to delete his info off of my new phone.  I guess once the first person enters their info you absolutely cant get rid of it.  you can get rid of aliases but just not the original one. WHY!!  Is there any brilliant, wonderful,generous person out there that would know how to delete him from my account.  The genius bar said that they've never seen this before.  If someone can help I'm taking the info to the apple stores that I went to so that I can teach them how to do it.  Of course, I will tell them who showed me. I give you my word.

    As far as I know you can't delete the primary email address for an iCloud account.  It's assigned when the account is created.  But your neighbor wouldn't have been able to get into your iCloud account without your Apple ID and password.  Are you sure the account wasn't still on your phone when you gave it to him?
    You could migrate a copy of your data to a new iCloud account but I would still be concerned that someone else was using my old account, which presumably still has your data in it.
    I'm fairly certain that you're going to have to have iCloud support help you sort this one out as they may have the ability to make changes to an existing account that users can't.  Make an appointment with the genius bar at a nearby Apple store and have them take a look at it.  If necessary, they should be able to contact iCloud support for you.

  • On set up I am frozen on screen which ioS 6 cant get itunes to sync

    On set up I am frozen on screen which ioS 6 cant get itunes to sync and I can turn the IPAD mini on but has no apps and is un responsive. When checking with computer its downloaded my pictures from Old ipad but I can see no apps or differing screens.
    It is basically just a zombie machine with a screen with IOS6 on it. I have left it on with WIFI over night and still nothing.
    I only bought this yesterday
    Help

    In windows goto control panel>add and remove and uninstall itunes AND quicktime.
    Now go here and follow ALL steps for cleaning itunes and quicktime out (Don't download or install yet) http://docs.info.apple.com/article.html?artnum=93976
    Scan for malware with ewido http://www.ewido.com
    DISABLE ANTIVIRUS and security programs, then go here and instal "Quicktime WITHOUT itunes" http://www.apple.com/quicktime/download/standalone.html
    Reboot, disable antivirus again then goto apple.com and download/install itunes

  • Hi everybody.. i have a problem nad i need help a.s.a.p ... i forgut my ipad passcode and tryed to remember it tell it locked and i cant get open .. it says connect to itunes .. i did that and its still not opening? what can i do? thanks

    hi everybody.. i have a problem nad i need help a.s.a.p ... i forgut my ipad passcode and tryed to remember it tell it locked and i cant get open .. it says connect to itunes .. i did that and its still not opening? what can i do? thanks

    http://support.apple.com/kb/HT1808
    Regards.

  • I cant get past the Find my iphone message in itunes when installing! any help????, I cant get past the Find my iphone message in itunes when installing! any help????

    I cant get past this message when I am installing my iphone on itunes? I click on any links and nothing happens.... please help me!
    Free Find My iPhone
    Set up Find My iPhone for free so you can locate your device if you lose it, remotely lock the screen, or wipe its data. You can also find your iPad or iPod touch. Learn More
    Not Now
    Set up Find My iPhone
    Find My iPhone (or iPad or iPod touch) enables you to locate your iPad with Wi-Fi or iPod touch only when it is on and connected to a registered Wi-Fi network. Find My iPhone is not available in all countries.

    Check out this link https://discussions.apple.com/message/12835691#12835691

  • I just bought the new ipodtouch5 and i cant get my music onto it and i have no idea how to get it to sync, any ideas on what i can do to help?

    okat title says all, now
    i cant get it to sync it showed welcome to your new ipod and i put it as a new ipod, and i thought that if i just plugged it in it would work, and well its not
    can someone please help me solve this,

    What happens when you plug it in?
    iOS: Syncing your data with iTunes - Support - Apple

Maybe you are looking for

  • How to print the content of LinkedList int[] and LinkedList LinkedList ?

    Hi guys, its been a long time since i posted here, and now im coming back to programming using java. My problem is, how can i print the content of the list? Example: LinkedList<int[]> list = new LinkedList<int[]>; int[] input = {1,2,3,4,5}; int[] inp

  • Fixed Length of a field in the File-XI-RFC Scenario

    Dear All, I am doing one File-XI-RFC scenario in which user is sending me the file with some delivery nos (VBELN) in it and I am sending those all delivery nos to my RFC in R/3. Now I want one conition to be put that if any delivery no is of less tha

  • Cannot get full widescreen picture (16:9) via VGA

    I'm trying to setup my LCD HDTV as an external monitor for my MacBook. The issue is that the TV is not displaying a full 16:9 image from the MacBook; it's only showing a 4:3 image, so there are large black bars on the side of the picture. Setup - TV:

  • Intermittent external monitor

    I have a brand new Intel based iMac 24" that I want to connect to my several month old Dell 22" widescreen monitor. I have the mini-DVI to DVI adapter. The monitor has three inputs, VGA, DVI and HDMI. I initially tried the HDMI (so I could keep the P

  • How do I best implement a comparable parameterized class?

    I am trying to implement a parameterized Wrapper class that I want to make Comparable, and the ordering is supposed to be consistent with equals(). How can this be done? I'm kind of lost ... My first approach looked like this: class Wrapper<T> implem