473,569 Members | 2,768 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 HttpRequestList ener'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 < numRequestsToBe Handled; i++)
{
HttpListenerRes ponse response = null;
try
{
// GetContext blocks while waiting for a request.
HttpListenerCon text context = listener.GetCon text();
// Create the response.
response = context.Respons e;
int pos = context.Request .Url.AbsoluteUr i.LastIndexOf("/");
string file = context.Request .Url.AbsoluteUr i.Substring(++p os);
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(buf fer, 0, buffer.Length);
stream.Close();
response.Conten tLength64 = buffer.Length;
System.IO.Strea m output = response.Output Stream;
output.Write(bu ffer, 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 1260

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

Similar topics

5
3371
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: 1. An html page that holds the applet. 2. a php page that accepts data submitted to it by the applet via the $_POST array and writes it to the mysql...
0
9859
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 ********************************** package Celcom.Client;
2
2513
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 grey during the load of the picture. How do I do that? Or even better: How can I display something like a progress bar or at least a temporary,...
3
3262
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 solve the problem. You can find the article at http://www.codeproject.com/java/javaappletwaitmsg.asp I have adapted the code to my situation but...
4
5164
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 example of the code I'm using... <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript"><!--
1
3403
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 controls as the data has bound to each control as some of the data I need to load is very big and takes some time. I have found some code that creates a...
14
2024
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 Java applet in my case) and serve the requests when they arrive? I want to avoid loading the script for each request. In other words, can it...
1
2790
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 include Java Applet jar too, for (int i = 0; i < numRequestsToBeHandled; i++) { HttpListenerResponse response = null;
8
3236
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: class NetCasino.class not found. java.lang.ClassNotFoundException: NetCasino.class at sun.applet.AppletClassLoader.findClass(Unknown Source) at...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.