Java Applet - Arduino Web Server

Hi,

I'm fairly new to using arduinos so bare with me. Basically I want to use an Arduino Uno with an ethernet shield to run a web server that can serve Java applets. I have been able to set up a web server running plain HTML and I know how to create/implement a Java applet on a standard web server. However I'm not too sure how I would combine the two so that when someone connects to the arduino, they will load the Java applet.

I understand that Arduino is programmed in C++ and that using the Web libraries you can implement HTML, however the HTML code would need to call a .CLASS file stored somewhere on the arduino. I'm assuming the easiest way to store this .CLASS file would be on the MicroSD card (on the Ethernet shield), but I'm not to sure how that would work. There's no reason why this shouldn't be possible seeing as all the Java Applet is is just a ByteCode file which isn't handled by the Arduino but rather by the JVM on the client machine.

I have had a quick look into how to use and SD cards using the SDfatLib but I don't know if that would be enough to access the .CLASS file.

Any advice would be greatly appreciated,

Alex

I have had a quick look into how to use and SD cards using the SDfatLib but I don't know if that would be enough to access the .CLASS file.

The SD library accesses bytes on the SD card. Whether those bytes are in the range that make them look like characters, or not, is irrelevant.

What is this applet going to do in/on the browser?

I haven't got a specific idea for the applet, I just want to understand how it would be done so that I can play around with it. If I were to save the .CLASS ByteCode file in the home directory of the SD card, would the HTML code be able to access it directly?

Alex

If I were to save the .CLASS ByteCode file in the home directory of the SD card, would the HTML code be able to access it directly?

Do you understand how a browser works? Specifically, have you ever looked at how a browser fetches a page? There is not a single GET request made. Instead, the main page is fetched, using a GET request. Then, that data is scanned for aref tags and linked files. Separate requests are made for each file. Similarly,

It is up to you to write code, on the Arduino, to parse the GET requests, and return the proper file.

Often, that file is simply constructed on-the-fly. But, it need not be. It could be fetched from the SD card, instead. But, the browser has no idea where the requested data comes from. It is simply a stream of data that the server sends.

So, yes, the .CLASS file can be stored on the SD card. But, no, the browser can't access it directly.

I don't have a strong understanding of how browsers work but what you said made a least some sense to me. I'll look into it a bit more and see where I get to.

Thanks a lot,

Alex