I too am using Applet+ Plugin+Servlets and this is how I have managed it:
Create a serialized object (by implementing Serializable) MyObj
The Applet contains the foll. code:
MyObj myobj = new MyObj();
try {
URL url = new URL("http://localhost:8080/servlet/YourServlet");
URLConnection con = url.openConnection();
con.setUseCaches(false);
con.setRequestProperty("CONTENT-TYPE", "application/octet-stream");
con.setDoInput(true);
con.setDoOutput(true);
ObjectOutputStream os = new ObjectOutputStream(con.getOutputStream());
os.writeObject(myobj);
os.flush();
os.close();
/* read the object back in from the servlet: */
ObjectInputStream is = new ObjectInputStream(con.getInputStream());
MyObj newobj = (MyObj) is.readObject(con);
} catch.......
In the service method of YourServlet;
try {
ObjectInputStream is = new ObjectInputStream(request.getInputStream());
MyObj obj = (MyObj) is.getInputStream();
// set values of obj
response.setContentType("application/octet-stream");
ObjectOutputStream os = new
ObjectOutputStream(response.getOutputStream());
os.writeObject(obj);
os.flush();
os.close();
}
Go over each syntax and see if you have done anything different. Hope it
helps.
-Shital
----- Original Message -----
From: Peter Pilgrim <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 25, 2000 11:49 AM
Subject: Re: HTTP Tunnelling + Applet + Java Plug1.3 + Servlets 2.0
> Hi
>
> =========================================
> # Is there a SUN ENGINEER lurking this list? #
> =========================================
>
> I am still having problems with this Applet /Plugin and Servlets.
> I have started Debugging with the Plugin as the Jun Doc suggests.
Unfortunately the source code
> for the Java Plugin is not available. So was wondering if an engineer can
help figure out what going on?
> Why do I ultimately get the `FileNotFoundException'?
>
> In particular what is happening at
`sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
Source)'?
>
> When the URL
`http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.A
dminServlet?action=getdefaultview'
> is posted in my IE5.0 it does raise `File Download' dialog box and the
> webserver log shows the servlet was invoked.
> Why is the plugin not accepting this URL ?
>
>
> Here is the C:\winnt\profiles\<user>\plug.trace:
>
> Spawning a thread
> Loading applet..
> Stopped loading...
> Sending events to applet. STOP
> Sending events to applet. DESTROY
> Sending events to applet. DISPOSE
> Sending events to applet. QUIT
>
> Done sending events...
> Finding information...
>
> Done...
>
> Read the Cache option Tag...:null
> Cache Option NOT specified.
> Reverting to default Browser Cache..
> Read the Cache Archive tag ...:null
> Cache Archive Tag Not specified.
> Ignore the Cache option if specified..
> Read the Cache Version tag ...:null
> Cache Version Tag Not specified.
> Ignore the Cache version if specified..
>
> Trying to get an instance of Class :
sun.plugin.cachescheme.BrowserCacheURLConnection
>
> applet initialising class:com.db.docserv.applet.AdminApplet
>
> ==== System properties ====
>
> java.version = 1.3.0
> java.vendor = Sun Microsystems Inc.
> java.vendor.url = http://java.sun.com/
> os.name = Windows NT
> os.arch = x86
> os.version = 4.0
>
> file.separator = \
> path.separator = ;
> line.separator =
>
>
> --------
> askForDefaultViewSet_Server()
url:`http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servl
et.AdminServlet'
> Opening
http://poppy.dev.lon.deuba.com:9090/~pilgpe/docserv/com/oreilly/servlet/Http
Message.class proxy=10.140.201.33:8080
> CacheHandler file name: C:\WINNT\Profiles\pilgpe\Temporary Internet
Files\Content.IE5\5ESWMIH0\HttpMessage[1].class
> Opening
http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.Ad
minServlet?action=getdefaultview proxy=10.140.201.33:8080
> java.io.FileNotFoundException:
http://poppy.dev.lon.deuba.com:9090/pilgpe/servlet/com.db.docserv.servlet.Ad
minServlet?action=getdefaultview
> at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
java:545)
> at
sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
Source)
> at
com.oreilly.servlet.HttpMessage.sendGetMessage(HttpMessage.java:77)
> at
com.db.docserv.applet.AdminApplet.askForDefaultViewSet_Server(AdminApplet.ja
va:1233)
> at
com.db.docserv.applet.AdminApplet.updateViewSetList(AdminApplet.java:1349)
> at
com.db.docserv.applet.AdminApplet.initialiseFromServer(AdminApplet.java:543)
> at com.db.docserv.applet.AdminApplet.init(AdminApplet.java:500)
> at sun.applet.AppletPanel.run(AppletPanel.java:344)
> at java.lang.Thread.run(Thread.java:484)
> Opening
http://poppy.dev.lon.deuba.com:9090/~pilgpe/docserv/com/db/docserv/applet/Ad
minApplet$3.class proxy=10.140.201.33:8080
>
> CacheHandler file name: C:\WINNT\Profiles\pilgpe\Temporary Internet
Files\Content.IE5\OTG927C9\AdminApplet$3[2].class
> applet initialised
>
> --
>
> Peter Pilgrim
> Welcome to the "Me Too" generation.
>
>
>
> ---------------------------------------- Message
History ----------------------------------------
>
>
> From: Rob Griffin <[EMAIL PROTECTED]>@java.sun.com> on 25/09/2000
09:07 ZE11
>
> Please respond to "A mailing list for discussion about Sun Microsystem's
Java Servlet API Technology." <[EMAIL PROTECTED]>
>
> DELEGATED - Sent by: "A mailing list for discussion about Sun
Microsystem's Java Servlet API Technology."@java.sun.com>
>
>
> To: [EMAIL PROTECTED]
> cc:
> Subject: Re: HTTP Tunnelling + Applet + Java Plug1.3 + Servlets 2.0
>
>
> > (3) My servlets are JDK 1.1.7 and the plugin is obvious JDK 1.3, are
> > there any serialisation issues that exists between different Java
> > platforms?
> > Can I sent java object made of 1.1.7 and get it read by VM of 1.3?
>
> You can't really be sure, and must test every combination. I have found
> problems sending Hashtables from 1.2.2 to Internet Explorer 4 (which is
> 1.1.4 I think) so Sun does make version incompatible changes in the base
> classes.
>
> Rob Griffin
> Quest Software
>
> E-mail: [EMAIL PROTECTED]
> Web site: http://www.quest.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
>
> --
>
> This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html