Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2007, 02:27 AM
Member
 
Join Date: Nov 2007
Location: Bay Area, CA
Posts: 13
ibanez270dx is on a distinguished road
Probably a really simple question...
Hello,
I have an applet which POSTs data to a PHP page, and I think the code is ok. However, it doesn't redirect to that page. I need it to close the applet and redirect to posttest.php with the POST info. I did a stacktrace and nothing came up ... Here is my code:

Code:
if (f.exists()) { overallLayout.show(cardPanel, "3"); //show scanning files, please wait try { // Construct data String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8"); data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8"); // Send data URL url = new URL("posttest.php"); URLConnection conn = url.openConnection(); conn.setDoOutput(true); OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(data); wr.flush(); // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = rd.readLine()) != null) { // Process line... } wr.close(); rd.close(); } catch (Exception ex) { } } else { overallLayout.show(cardPanel, "2"); //show that it doesn't exist }
Any help is appreciated!

Thank you,
- Jeff

Last edited by ibanez270dx : 11-16-2007 at 02:45 AM. Reason: just did a stacktrace
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Method Question Froz3n777 New To Java 2 02-13-2008 03:39 AM
simple GUI dim_ath New To Java 3 01-07-2008 04:00 PM
Simple append question Rageagainst20 New To Java 0 12-21-2007 12:40 AM
Simple question of JTable carl AWT / Swing 1 08-07-2007 08:07 AM
Question mark colon operator question orchid Advanced Java 3 04-30-2007 11:37 PM


All times are GMT +3. The time now is 09:22 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org