Applet in Google App Engine - java

My aim is to host my applet to google app enigne.
I have made a jar of my applet, I have placed the jar into WEB-INF/lib directory but still when I write applet tag in my jsp page as
<applet code="myPackage.MyClass" archive="myapplet.jar" width="600" height="480"/>
The applet is not showing in the browser.
I am using eclipse with GAE plugin
Please Guide me.

Try puttIng the JAR into the same directory as the JSP file.

Related

How Sencha cmd is worked using jetty web server and jsp file is not recognized by sencha cmd

I have created ExtJS6 app with sencha cmd and I added JSP file to app and try to run application, but it is not recognized by sencha cmd, I want to know how can I integrate JSP and Java action with sencha app.
Yo can add JSP file in your Sencha Application..Try moving code from index.html fiel to your JSP file..say home.JSP file.Copy your index.html file code into home.jsp file and from JAVA call that JSP file initially.Hope this work for you

It's possible to upload a image which is not located in eclipse project to a jsp

Is there a way to upload an image not located in Eclipse project to a jsp?. I have searched that it is possible if image directory is placed in Application Server but that's not what I want, I would like to use a c:\directory in Windows 7. Please find below the code in jsp file I'm using:
<body>
<h1>Image below:</h1>
<img alt="No Image"
src="C:/MauricioFiles/Proyectos_JavaEE7/MusicStore/pics/guitar.png"
width="100" height="100">
</body>
Thank you!!!
The <img src> must refer a public web URL, not a local disk file system path. Your images have to be available by a HTTP request. It's namely the webbrowser who has got to download them, not the webserver who has got to include them somehow.
Yes you can upload it. But I think what you want to do is to access the local file without uploading it.
But as JSP says, JavaServer Pages. That means that you need to have all your files uploaded and ready in your server. What you do at the moment is, that you use a file which is on your computer and not inside your Server-directory. But you can't access local files outside of your server-environment.

GWT: Loading an Applet inside an application

I am trying to integrate an existing applet packaged as jar file in an existing GWT application built with maven.
Now I am not being able to figure out, why the applet class is not being found. A ClassNotFoundException is being thrown when I try to load the applet, saying that the applet class cannot be found.
The GWT Maven project has several modules and the applet I want to integrate is in its own Maven module.
The applet jar file is being signed and packaged as in the final war file for the GWT app by the maven build process.
When I deploy the war file in a Tomcat server I have the following structure under the webapps folder:
webapps
my_gwt_app
WEB-INF
classes
deploy
lib
signed_applet.jar
other_application_dependency.jar
views
web.xml
Here is the HTML result which is being generated by my GWT presenter:
<applet code="com.example.MyApplet.class" archive="/my_gwt_app/WEB-INF/lib/signed_applet.jar" width="1000" height="800" id="my-applet">
<param name="permissions" value="all-permissions">
</applet>
Could someone tell me what I am doing wrong?
Thanks!
Nothing in the lib or classes directory is available to be served to clients that visit the site. It will be necessary to move the Jar to another place on the server.
In addition to that:
The following path is simply wrong.
archive="/my_gwt_app/WEB-INF/lib/signed_applet.jar"
WEB-INF would typically be the 'root' of the site.
<param name="permissions" value="all-permissions">
Whatever you are trying to achieve there, it will not add permissions to the applet.
I added the "applet" folder under the root folder (http://dev-server.com:8080/my_gwt_app/ not under WEB-INF) and called the URL "http://dev-server.com:8080/my_gwt_app/applet/signed_applet.jar" in the browser. The jar could be found.
But when I configure my applet like
<applet id="my-applet" width="1000" height="800"
code="com.example.MyApplet.class"" archive="../applet/signed_applet.jar">
</applet>
I still getting the ClassNotFoundException.
My problem was the jar file path configuration.
I put it in the my_gwt_app/gwt_module/applet directory and configured the applet with this jar path.
Now it works fine.

Could Java applet use other lib for web

This is web code for applet
<applet code=test.class name=test archive="thisDemo.jar">
</applet>
I write a class, and the class access the local data, so I use key to sign the applet. But I need to use other library, like Apache jar.
How to use the the jar in applet?
I can use the Apache jar in eclipse, but can't work in applet when web call the applet.
This works for me:
<applet code=test.class name=test archive="thisDemo.jar,apache.jar" width="800" height="600">
</applet>
and putting apache.jar next to thisDemo.jar
You might need to sign every single dependency jar:
https://stackoverflow.com/questions/14229863/must-sign-all-jars-of-applet

Java applet runs locally but not on the host

I have written an applet application and integrate it to run under a webpage. It runs properly when I am running the webpage as local HTML file (using file:/// protocol). But when I am running it on a host (tested with http://localhost using XAMPP), it does not work anymore and through exception of ClassNotFound.
My applet classes are packaged under a *.jar file. Is not the jar file loaded in this case? Can anyone give me a suggestion that what can I do to deal with this problem?
Update
I have uploaded the jar file into the same folder as the HTML file. In my case, they are in the DocumentRoot of the Apache server. I can double-click on the HTML file, it works.
But when I query like: localhost/test.html, it does not. My code:
<applet
code="package/ClassName.class"
archive="appletfile.jar">
</applet>
I can able load the jar file by: localhost/appletfile.jar
Html document (in which <applet/> tag is used to deploy an applet) and .jar file must be in the same folder.
<applet code ="package.AppletClassName"
archive = "Sample.jar"
width = "200"
height ="200">
</applet>
I do not know why but when I change the name of *.jar file to lowercase (all lower case), then it works.
yes!!
Applets able to run in Apache PHP server.The applet is loading from server when you called the html file the applet execute in browser and gives the out put.must and should update your java plugin before run the applet in browser.put your entire applet folder in to apache htdocs folder ,then access that applet in browser....!!It will work.I am sure..
All the Best
Only self signed applets are able to access in browser with security other wise applet not execute with security.You have to signed the applet to execute.

Categories