Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2004, 09:34 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default connecting a Swing client to an existing servlet a

Hi,

first, sorry for my poor english..


I would like connect my Swing app (when i click on a button) to a servlet

schéma:

1. swing ( pass parameters to a servlet )
2.servlet => call stocked procedure in oracle
          => generate xml
3.report in a browser after processing xml via xlst

Have you some code to propose to me ??

Thanks

Reply With Quote
  #2 (permalink)  
Old June 17th, 2004, 05:33 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Some basic code to start with. You can also use serialization with ObjectInputStream.


    public String talkToServlet() {
        StringBuffer response = new StringBuffer();
        String line = null;
        try {
            URL url = new URL("http://www.website.com/servlet/ServletName");
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            while ((line = in.readLine()) != null) {
                response.append(line + "\n");
            }
            in.close();
        } catch (Exception e) {
            return "error";
        }
        return response.toString();
    }

S. Densmore (SCJP)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting client to client (Socket programming) maricar C# 0 September 25th, 2008 04:34 AM
Connecting existing program to SQL Express DB jscammell VB Databases Basics 2 April 19th, 2007 02:03 PM
Swing Servlet Communication ? ? ? nigam.anand Servlets 0 April 22nd, 2006 02:27 AM
Send file from Servlet to Client End (Swing) nigam.anand Servlets 0 April 22nd, 2006 02:22 AM
sending a file from swing client to servlet sid_ Servlets 0 March 2nd, 2005 05:18 PM



All times are GMT -4. The time now is 04:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.