Can't get any response from HttpsURLConnection

sorry, i've reformat the code here again
Deal frens,
Currently i'm doing a code to get a response from https link in my servlet. I don't know where the lack of my coding, but i don't get any response from the server when i execute my code. here is my code
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.net.ssl.*;
public class Servlet1 extends HttpServlet {
  private static final String CONTENT_TYPE = "text/html";
  //Initialize global variables
  public void init() throws ServletException {
  //Process the HTTP Get request
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    String authentURL = "https://server1.tst.cvs/servlet/RequestHandler?login=admin&pwd=admin&method=viewUser&username=00032a0183db";
    out.println("<html>");
    out.println("<head><title>Servlet1</title></head>");
    URL url = new URL(authentURL);
    HttpsURLConnection URLconn = (HttpsURLConnection) url.openConnection();
   // HttpsURLConnection conn = null;
    URLconn.setDoInput(true);
    URLconn.setDoOutput(true);
    URLconn.setRequestMethod("GET");
    URLconn.setUseCaches(false);
    OutputStream authOut = URLconn.getOutputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(URLconn.getInputStream()));
    out.println("<body bgcolor=\"#ffffff\">");
    out.println("<p>The servlet has received a GET. This is the reply.</p>");
    out.println("output"+authOut);
    out.println("output2"+URLconn.getContent().toString());
    out.println("output3"+reader);
    out.println("</body></html>");
  //Clean up resources
  public void destroy() {
} the result suppose i get when i execute the script is..
userdata=234&uname=00032a0183db&concurrentlogins=1
i don't have any problem when i paste the link
https://server1.tst.cvs/servlet/RequestHandler?login=admin&pwd=admin&method=viewUser&username=00032a0183db
and i able to get the response
userdata=234&uname=00032a0183db&concurrentlogins=1
please..please help..what is wrong with my code

YOU DON'T READ ANYTHING IN YOUR CURRENT CODE !!!
If you use a BufferedReader, then read the input stream via readLine() method.
Default implementation of getContent() method is not generally usable for getting your desired "content". Experiment that.

Similar Messages

  • Can't get any response from the Tuner - is it broken?

    I'm happily chugging away through my new David Nahmani tutorials and I've discovered that I can get no response from the Tuner. The controls in the window appear to be working, but no line appears in the meter and flat lines appear in the center for pitch and octave. The channel strip indicates normal sound input and variation. I don't have any trouble recording (so far anyway). Is there anything I'm not aware of that could cause this?

    Thanks for the reply, Rob. I'm just trying to tune a wind instrument through the built-in mic on my MacBook Pro, but I discovered the answer not too long after submitting the question. As I said, I'm trying to work through the Nahmani Logic Pro and Logic Express 8 book. I've been trying to be very meticulous about the installation and the setup for the tutorials, but I guess I inadvertently made settings changes that interfered with the Tuner, because choosing Logic Express > Preferences > Initialize All Except Key Commands allowed the Tuner to work the way I expected. I assumed the problem must have been bus related after I saw the Tuner respond to internal playback after modifying some bus settings, so I executed that command and all was well (uh, I should probably change that to "most was well", but at least the Tuner is working now). Thanks again.

  • On my Iphone 4, I can not get any response accept the apple logo after recharging for an entire day and trying to connect to iTunes. help?

    On my Iphone 4s, I can not get any response accept the apple logo after recharging for an entire day and trying to connect to iTunes. A few days before that the speaker suddenly stopped working during a call. I also reset everything by connecting to itunes but no luck then. help?

    Hey there xntricj,
    It sounds like you are putting a password for your Apple ID that works without issue on your iPad into your iPhone but get a message saying that the password is incorrect. I recommend the steps from the article named:
    iCloud: "Incorrect Apple ID or Password" alert when setting up iCloud after upgrading to iOS 7
    http://support.apple.com/kb/TS5207
    After completing iOS 7 setup, go to Settings > iCloud.
    Scroll down and tap Delete Account, then enter your previous Apple ID and password.
    If your Apple ID or password are not accepted, follow the steps in iOS 7: If you're asked for your previous Apple ID when signing out of iCloud.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • I have just recently installed ios6 to my iPad 3 an iPhone 4 my iPhone works fine but my iPad is not working at all I can not get a response from it, it seemed to download an then install but did not reset and turn on and will not turn on HELP!! Withdrawa

    I have just recently installed ios6 to my iPad 3 an iPhone 4 my iPhone works fine but my iPad is not working at all I can not get a response from it, it seemed to download an then install but did not reset and turn on and will not turn on HELP!! Withdrawal or what!! Lol

    Hi there,
    Firstly, try a hard reset. Hold the sleep/wake and home buttons together until the Apple logo appears.
    If this doesn't work, try restoring your device. Put it in recovery mode if iTunes doesn't recognise it, and restore it from there. I have linked to instructions below.
    Recovery Mode and Restore - Apple
    Let me know if this helps,
    Nathan

  • How to change read only folders into normal ones...i can't get any filed from my harddrive

    how to change read only folders into normal ones...i can't get any filed from my hard drive..it shows read only

    Which HDD are you referring to, an external one, or the internal SSD?
    If external, which format is it in?

  • Just upgraded to 10.6.8.  Had to upgrade Adobe flash player.  Now can't get any sound from websites!

    Just upgraded to 10.6.8.  Had to upgrade Adobe flash player.  Now can't get any sound from websites.  Advice please!

    Check System Preferences > Flash Player > Advanced
    Click:  Delete All under Browsing Data and Settings
    Then empty the Safari cache.
    From your Safari menu bar click Safari > Preferences then select the Advanced tab.
    Select:  Show develop menu in menu bar
    Now click Develop > Empty Caches
    Quit and relaunch Safari then try Flash on a website for sound.

  • LR5 won't print, it send print job starts to spool then just dissaperes from the print cue? my printer works fine with other software. I can't get any help from Adobe support can anyone help???

    Hi i need help! I can't print any jobs, LR5 starts to print then the job disappears from the print cue. I can ! print from other application no problem.
    I can't get any support from Adobe. Any ideas would be great.

    Hi,
    Please try the following steps:
    Open the file in Adobe Reader
    Click on File menu - Print
    In the Print Dialog box, select the Printer and then select Advanced button
    In the Advanced print setup, Please check 'Print as Image' (See the Screen shot)
    Click Ok and then Click Print.
    Let me know if this solves the problem.
    ~ Aditya Kalania

  • My UR12 Steinberg interface is recognized by Yosemite but I can't get any output from the device, does anyone know how to fix this problem? Thanks in advance

    My UR12 Steinberg interface is recognized by Yosemite but I can't get any output from the device, does anyone know how to fix this problem? Thanks in advance

    Apparently it's related to the Firefox plug in.
    This isn't exactly a solution but more of a way to avoid opening PDFs with Firefox's plug in.
    1. Highlight "Tools" from the Menu Bar in the top left of the screen (or click "Options" if using the Firefox Compact Menu)
    2. Select to "Options
    3. Select "Applications"
    4. Look for "Adobe Acrobat Document" under Content Type and to the right under Action select "Use Adobe Reader (default)" instead of the using Adobe Acrobat in Firefox
    5. Open a test PDF. It should open in it's own window now.
    Again, not a complete solution but something that'll at least let you scroll with PDFs open.
    More info here: http://forums.mozillazine.org/viewtopic.php?f=38&t=2171033

  • I can't get any response when I try to buy an onli...

    I can't get any response when I try to buy an online number....your response just sits and spins...please advise

    Dream all,
    My advice is don't do it. I wish I had come to the forums first and read about the problems before purchasing a number. When I bought callout credits I've had no problems at all. Now it looks like I'm out $18. I'm just thankful I didn't opt for the whole year.

  • Recently, I can't get any sound from my game applications.  Sound works fine with video, streaming, etc, but not my game applications.  I've tried powering down and re-booting, but the sound does not return.  Can anyone help me?

    Recently, I can't get any sound from my game applications.  Sound works fine with video, streaming, etc, but not my game applications.  I've tried powering down and re-booting, but the sound does not return.  Can anyone help me?

    Have you got notifications muted ? Only notifications (including games) get muted, so the Music and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad above the volume switch, or via control centre : swipe up from the bottom edge of the screen and it's the right-most of the 5 icons in the middle of it (if the icon is white then it's 'on', tap it to turn it grey and 'off'). The function that isn't on the side switch is set via control centre instead : http://support.apple.com/kb/HT4085

  • I can't get any sound from ITunes. The computer's internal speakers are fine (they play utube sound, for example). And the sound bar on itunes is all the way to the right. Still no sound from the music library. Any insights?

    I can't get any sound from my ITunes library. The IMac is set to internal speakers, the volume bar on ITunes itself is all the way to the right, there seems to be no problem with the speakers themselves (they play sound from internet videos, for example), but I can't play music from the ITunes library on the IMac. Please help!

    Is it possible that you have iTunes set to send audio through AirPlay to an AirPort Express, Apple TV, or other AirPlay device (which is itself not turned up so you can hear it)?

  • I can't get any sounds from my ipod, only through earphones

    I can't get any sounds from my itouch. I can only hear through my headphones. I completely reset my itouch and still nothing

    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so. There is a little switch in the headphone jack that disconnects the speaker when the headphone jack is inserted.
    Try the following to rule out a software problem. I do not know what you meant by "completely reset my itouch".
    - Reset the iOS device. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store. Seems you have a bad headphone jack or other hardware problem.
    Apple Retail Store - Genius Bar

  • HT5312 My rescue email address is no longer used, I can't get any emails from apple about my security questions. What shall I do?

    My rescue email address is no longer used, I can't get any emails from apple about my security questions. What shall I do?

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (104597)

  • I bought and was charged for bingo chips in bingo bash and have not received the chips.. I can't get a response from bingo bash! How do I get my chips?

    I bought and was charged for bingo chips in bingo bash and have not received the chips.. I can't get a response from bingo bash! How do I get my chips?

    Welcome to the Apple Support Communities
    If I have understood you properly, to do that, you have to create a new administrator user with your name and for your uses. Follow these steps:
    1. Open System Preferences > Users & Groups, and press the + button to create a new administrator account.
    2. When you have finished creating that user, open  > Log Out, and log in your new user.
    3. Open System Preferences > Users & Groups, select the old user and press the - button to remove the user. If you want, you can select the option to remove the Home folder of this user, so you will only have the Home folder for your account

  • CAS and three primary hierarchy SCCM 2012 r2 can i get any runbook from microsoft for Step by step installation

    Hi All
    need CAS and three primary hierarchy SCCM 2012 r2 can i get any runbook from microsoft for Step by step installation
    need step by step installation guide with screenshots.

    There's a lots of installation guide but each guide is for a "standard" installation, your environment is unique and you should get help to be sure to implement SCCM to fulfill your needs.
    Installing SCCM without any experience will be tricky and maintain it will be even harder. This is not a simple product.
    http://sccmentor.wordpress.com/2014/01/08/sccm-2012-r2-step-by-step-installation-guide/
    http://www.windows-noob.com/forums/index.php?/topic/4045-system-center-2012-configuration-manager-step-by-step-guides/
    Benoit Lecours | Blog: System Center Dudes

Maybe you are looking for

  • Oracle Secure Backup 10.3.0.3.0 in Windows 2003 with IBM Tape Not Working

    Hi, I am currently implementing Oracle Secure Backup. My environment is this: OS: Windows Server 2003 (32Bit) for all servers Database: Oracle Database 11.2.0.1.0 Tape Library: IBM-ULT 3580-TD4 I will have to configure 2 machines to work with OSB: se

  • I can't believe it and it's legal

    This phone Revolution LG is the worst smartphone on the market(.) my WiFi doesn't connect and when it does the 4G will not go away so it just loops and loops and nothing happens for hours... it just shuts off for no reason is another issue.I have to

  • New to mac and iWeb

    Can I use iWeb with third party CSS? We have bought a set of pre-configured CSS web templates for our business, and would like to use iWeb's ease of use to manage and update, but can not seem to find a way for iWeb to recognize them.

  • Collaboration Launch Pad With Error.

    Hi Friends....           I have error when i click the team members to send a message like System Error An exception occurred during the program execution. Below you will find technical information pertaining to this exception that you might want to

  • Embedding traditional chinese fonts in pdf

    Hi, I am trying to embed traditional chinese fonts in the mdf template. I created a soft font catridge using Angsana font and with symbolsets big5 and GB. I have also made the registry changes as mentioned in the below specified article: http://www.a