Re: J# app and J# Browser Control behave differently
From: Jerry (Jerry_at_discussions.microsoft.com)
Date: 07/16/04
- Previous message: Gene Black: "RE: J# Browser Controls v1.1b Official Release"
- In reply to: Thomas Alex [MSFT]: "Re: J# app and J# Browser Control behave differently"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 10:09:02 -0700
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();
}
}
"Thomas Alex [MSFT]" wrote:
> 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.
>
>
> "Jerry" <anonymous@discussions.microsoft.com> wrote in message
> news:1ceb101c45325$98b3c4b0$a501280a@phx.gbl...
> >I have an applet that sends data to a web server via the
> > query string of the url (HTTP GET). When the query string
> > data contains a backslash (\) it is sent to the web server
> > differently depending on whether the code is running as a
> > browser control or a standalone application. If the code
> > is running as a browser control all backslashes are
> > replaced with a fowardslash (/). If the code is running
> > as a standalone application the backslashes are not
> > replaced. Any ideas as to why the code is behaving
> > differently in the different environments?
> >
> > Here is the code that I am using:
> >
> > import java.applet.Applet;
> > import java.applet.AppletContext;
> > import java.awt.*;
> > import java.net.URL;
> > import java.net.*;
> > import java.io.*;
> >
> > public class TestApplet extends Applet
> > {
> > private void connect()
> > {
> > try
> > {
> > URL url = new URL
> > ("http://localhost/test/printreq.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();
> > }
> > }
> >
> >
>
>
>
- Previous message: Gene Black: "RE: J# Browser Controls v1.1b Official Release"
- In reply to: Thomas Alex [MSFT]: "Re: J# app and J# Browser Control behave differently"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|