473,503 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpListener loading Java Applet in html page

Reg
I have a following code in HttpRequestListener's ProcessRequest method which
is a Windows
Console Application. I'm trying to read html page with browser (Opera) and
html file contains tags to include
Java Applet jar too,
for (int i = 0; i < numRequestsToBeHandled; i++)
{
HttpListenerResponse response = null;
try
{
// GetContext blocks while waiting for a request.
HttpListenerContext context = listener.GetContext();
// Create the response.
response = context.Response;
int pos = context.Request.Url.AbsoluteUri.LastIndexOf("/");
string file = context.Request.Url.AbsoluteUri.Substring(++pos);
byte[] buffer = new byte[32768];
// Reading html and Java Applet Jar file from file system
FileStream stream = new FileStream(file, FileMode.Open, FileAccess.Read);
int read = stream.Read(buffer, 0, buffer.Length);
stream.Close();
response.ContentLength64 = buffer.Length;
System.IO.Stream output = response.OutputStream;
output.Write(buffer, 0, buffer.Length);
output.Close();

Problem is that I get "Invalid Bytecode" error in Opera and IE shows
nothing.

Something missing, can anyone tell me what?

Cheers,
Sep 4 '07 #1
0 1247

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3366
by: apchar | last post by:
I am trying to use php as a kind of servlet to act as a middle man between a java applet and mysql. I know java has jdbc but it's flakey and painful. php access to mysql is much nicer. So I have:...
0
9857
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
2
2508
by: Mark Richards | last post by:
An applet on one of my pages uses a big picture as background. I want to load it before the applet and the rest of the html source. By doing this I want to avoid that the pane of the applet is...
3
3248
by: Jacques Chaurette | last post by:
Hello all , thanks in advance for any help. While looking for a solution to how to replace the grey box while an applet loads, a search of Google got me an article by Glenn s. Peffers that claims to...
4
5151
by: google | last post by:
I have a page that requires 2 controls to be loaded... one is a Java Applet, the other is an ActiveX control. The ActiveX control is dependent on the Java applet being loaded first. Here is an...
1
3392
by: Alixx Skevington | last post by:
I want to be able to have a page that has several controls on on it, but I want the page to load first of all and display a loading image on each control and then I want to then display teh...
14
2019
by: DavidNorep | last post by:
I do not know PHP, consider to write a CGI with this technology and have the following question. Is it possible to invoke a PHP script and let it endlessly wait for requests from a website (a...
1
2777
by: Reg | last post by:
I have a following code in HttpRequestListener's ProcessRequest method which is a Windows Console Application. I'm trying to read html page with browser (Opera) and html file contains tags to...
8
3233
by: drsmooth | last post by:
this is rather frustrating...i have tried numerous different things in a futile attempt to get a japplet packaged in a jar file to load on my site. everytime i try a new thing i get: load:...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.