How to host an applet on google app engine? - java

I've downloaded the google plugin for eclipse, along with the necessary app engine stuff. Now the question is, is it possible to host a pre-made applet using google app engine, and if so, how?

An applet is just a jar or a series of jars that must be downloaded by the browser. Put the jar(s) in your web archive just as you would put a HTML, CSS, image or JS file, and include the markup for the applet in the appropriate page.
See http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/using_tags.html for details.

Related

Working with HTML and images on Google App Engine

I am a bit confused about how to deal with html and images on Google App Engine:
I am displaying a simple website on my naked domain (example.com), which is hosted on my Google App Engine directly in the war directory. This is working fine.
I have also built an API which I host on Google App Engine, and is available on example.com/api/v1/. Now, I am building a functionality in which a new user is being created and a registration confirmation mail is sent to the new user.
This email is a plain HTML page, which I load from war/WEB-INF/mail/register.html, because I do not seem to be able to get it from the war directory. In this HTML I just refer to an image with <img src="images/image.png" />, assuming GAE will search for it in /war/WEB-INF/mail/images/image.png, but this is not working. The image is never found.
I also looked at <static-files>, which needs to be placed in the app engine-web.xml, but I am a bit confused which home directory is used in this.
My question is: Can anyone explain how App Engine handles html and images in the war and WEB-INF directories?
Any help is greatly appreciated!
Note: My homepage is just working fine, so these images and css files work without any editing in the appengine-web.xml.
Note: I am using Java.
If this html is for an email, the image paths need to be the full url and not relative to the html file. For example, use:
<img src="http://example.com/images/image.png"/>
Also, images cannot be served if they are under the WEB-INF directory. Create a static directory to serve the images from.

Possible to Run Normal Java File Via Browser?

I've coded a game in Eclipse (still working on it), is it possible to run it's jar file in browser so that anyone can play right from their browsers instead of downloading jar file?
I.e I upload it on my website so that anyone can play right from the link I provide them.
Consider using Java Web Start with JNLP. You can host a JNLP file on a web server somewhere, along with your jar, and users can use a desktop shortcut pointing to the link, or a browser to open your app. (Using a browser will require having a web page with an applet tag: the article mentions how to do this but doesn't separate the two.)

Integrate signed applet in java web application

I have a java applet project whichs starts a webcam and displays it on a window. I am trying to integrate this applet into my web-app, for that I have exported my applet as a JAR and included in my web-app and used it on my JSP page by using applet tag. Now I got a message that the digital signature cannot be verified. I am currently trying to sign my applet and use it, but I don't find any tutorials for that.
Can somebody please guide me that?
What I am trying to do is legal or can I try some other way to integrate my applet into JSP page or any other way to have webcam capture functionality in Java web application.
You need to sign an applet jar before running it as an applet. This is a link for your reff.:
http://docs.oracle.com/javase/tutorial/deployment/jar/signing.html
Once jar is signed you can run it, if it still does not work try options for running signed content under: control Panel: Java
Emm... I do suppose so when you 'exported' your applet to JAR the signature became invalid or something; actually any modifications make it invalid... so I guess you need to
A) As a tip, first clean your JRE certificates cache (then try to restart your JSP;
if it won't do then read B,C points)
B) Pack your (with blank manifest) applet into JAR
C) If you have the keystore sign the applet JAR with jarsigner util
Report if that helped

How to include user interface into eclipse for google app engine java?

I had design my User Interface in dreamweaver and I hope to include the User Interface that I had design into eclipse for google app engine java, is it possible to do so?
You can put all HTML/CSS/Javascript into the "war" or "web" directory of the App Engine project (next to the index.jsp or index.html which is probably already there). Those files will be uploaded and served as static files when deployed.
I assume that you will have to modify at least some of those files, though, to make them "active". For example by turning the HTML into JSP and wiring them up with some servlets that do the server-side processing.

Embed Java applet in a website

Recently, I had came across an open source a Java applet. I wanted to know is there somehow I could create a script that could be distributed and the applet could be embedded in any website?
I have been able to inject JQuery and JS scripts into websites by placing a <script> tag pointing to a Javascript file and placing it in the header of the page but I don't know how a java applet can be injected.
You can take a look at corresponding tutorial page: http://download.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html
General steps are the following:
Build applet JAR file
Create a JNLP file, which describes your applet
Create web page, which includes script, which starts applet
Deploy all these artifacts on some web server

Categories

Resources