Hi Jerry,
This is not an expected behavior. The URL sent to the server should not
depend on whether the code is running in the context of a browser control or
an application. Can you tell us which version of the J# browser control you
are using (the 1.1b release has recently been made available - see
http://msdn.microsoft.com/vjsharp/downloads/browsercontrols/) and whether
you are still experiencing this problem?
thanks
Thomas Alex
Microsoft Visual J# Product Team
This posting is provided "AS IS" with no warranties, and confers no
rights.
>I have an applet that sends data to a web server via the
> query string of the url (HTTP GET). When the query string
[quoted text clipped - 40 lines]
> }
> }
Jerry - 16 Jul 2004 18:09 GMT
Thomas,
I am using version 1.1. I retested the code and I am still having the problem. I capture the network trace this time.
When run as a browser control the http request is formatted as follows:
GET /test.asp?te/st HTTP/1.1
Connection: Keep-Alive
Host: localhost:8080
When run as a stand alone app the http request is formatted as follows:
GET /test.asp?te\st HTTP/1.1
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
Host: localhost:8080
Connection: Keep-Alive
Again in both cases I used the following code:
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.net.URL;
import java.net.*;
import java.io.*;
public class AppletTest extends Applet
{
private void connect()
{
this.add(new Label("test"));
try
{
URL url = new URL("http://localhost:8080/test.asp?te\\st");
URLConnection conn = url.openConnection();
InputStream in = conn.getInputStream();
in.close();
}
catch (Exception e)
{
this.add(new Label(e.getMessage()));
e.printStackTrace();
}
}
public void start()
{
connect();
}
}
Here is the code for the stand alone app:
package AppletTestDriver;
/**
* Summary description for Class1.
*/
public class Class1
{
public Class1()
{
//
// TODO: Add Constructor Logic here
//
}
/** @attribute System.STAThread() */
public static void main(String[] args)
{
AppletTest applet = new AppletTest();
applet.start();
}
}
> Hi Jerry,
>
[quoted text clipped - 56 lines]
> > }
> > }