Velocity Reviews

Velocity Reviews (
-   Java (
-   -   Appletee, Servletee kind of newbie question! (

Andrew Tucker 08-23-2003 06:16 AM

Appletee, Servletee kind of newbie question!
Hi everyone,

I am having real problems working out whats going on w/ my applet. I want to
be able to send an object from an applet to a servlet, here is the code for
the listener method causing the trouble:

private void addClientListener(java.awt.event.MouseEvent evt) {

System.out.println("Got this far, addClientListener.");
try {
URL fileURL = new URL(getDocumentBase(),
URLConnection conn = fileURL.openConnection();


conn.setRequestProperty("addClient", "true");

ObjectOutputStream out = new ObjectOutputStream(new



} catch( Exception exc ) {
I apologise if my usage of setRequestProperty is incorrect, i need to pass
several different objects to servlet and thought that by using this method
of URLConnection, i could evaluate this at servlet and handle each case
seperately. If there is a better way i would love to know how!

Here is the java console output, it is saying that i need to set doOutput =
true, well i am aren't I?

Thankyou in advance for any direction you can give me!!


Java(TM) Plug-in: Version 1.4.1_02
Using JRE version 1.4.1_02 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Andrew Tucker
Stopping applet ...
Unregistered modality listener
Joining applet thread ...
Destroying applet ...
Disposing applet ...
Joined applet thread ...
Quiting applet ...
Finding information ...
Releasing classloader: sun.plugin.ClassLoaderInfo@4865ce, refcount=0
Caching classloader: sun.plugin.ClassLoaderInfo@4865ce
Current classloader cache size: 1
Done ...
Registered modality listener
Referencing classloader: sun.plugin.ClassLoaderInfo@4865ce, refcount=1
Loading applet ...
Initializing applet ...
Starting applet ...
Got this far, addClientListener. cannot write to a URLConnection if
doOutput=false - call setDoOutput(true)
at AWTMaintSchedGUI.addClientListener(AWTMaintSchedGU
at AWTMaintSchedGUI.access$000( 17)
at AWTMaintSchedGUI$1.mouseClicked(AWTMaintSchedGUI.j ava:51)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at Source)

All times are GMT. The time now is 09:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.