Applet not running in Openbravo - java

As per my requirement, i want to call applet from servlet/jsp, I followed below steps,
Created Applet java class file and copied in web/jsp
Then called that applet class in jsp file using
But getting ClassNotFoundException, same code running other than openbravo project, working fine.
I am unable to find the root cause. Please help me.
<html>
<head>
<title>Welcome JSP-Applet Page</title>
</head>
<body>
<jsp:plugin type="applet" code="ButtonMoveApplet.class" width="400" height="400">
<jsp:fallback>
<p>Unable to load applet</p>
</jsp:fallback>
</jsp:plugin>
</body>
</html>

Related

How to call a jar applet file in html

I have copied a very simple applet (just a written message) in java and created a jar file. I called the jar file with the following code but when I opened the file in a browser nothing's appearing (apart from the header). What beginners mistake am I making?
<html>
<head>
Chess App
</head>
<body>
<applet code="Main.class" archive="JavaChessGradeApplet.jar" width=640 height=480></applet>
</body>
</head>
</html>

deploying angular to weblogic

I have an angular app that works absolutely fine on Eclipse (Neon) + Tomcat environment.
But when I export the project as a WAR file and deploy it on a Weblogic server (10.3.6) it does not load the app. It doesn't throw any error message as well. It just gives me a blank page on IE without loading any of the contents of the html.
It looks like I am missing some kind of configuration while exporting this to weblogic as a WAR file. How can I fix this?
Sample Code - index.html
<html ng-app="testapp" lang="en">
<head>
<title>New App</title>
<script src="angular.min.js"></script>
<script src="controller.js"></script>
</head>
<body ng-controller="ctrl">
{{var}}
</body>
</html>
controller.js
var app = angular.module('testapp', []);
app.controller('ctrl', function($scope, $http) {
$scope.var = 'wat2do';
});

HTTP Status 500 - Unable to compile class for JSP Java8, Tomcat8.5

I have a main jsp file which makes use of java class in the boxers package. But when I try to run jsp, the following error occures:
HTTP Status 500 - Unable to compile class for JSP:in the jsp file: /web/date_info.jsp boxers.B cannot be resolved to a type.
date_info.jsp
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<p><%= boxers.B.voice()%></p>
</body>
</html>
B class:
package boxers;
public class B {
public static String voice()
{
return "HELLO";
}
}
I've read the conflict between versions can cause this; my Java version is 8, Tomcat 8.5..
I've looked into webapps/my_app/build/web/WEB-INF/classes/boxers folder and there is a B.class file...
EDIT: I wonder if those who downvote at least know the answer to the question.
Figured it out. The application wasn't deployed correctly. The deployment process, described here helped me out. In particular - copying web application archive file (.war) and copying unpacked web application directory. My main mistake was that initially I applied the second method in the wrong way - copied all the folders in the app directory, created by Netbeans (build, src, web etc), while only NetbeansProjects/app_name/build/web's content should have been copied into tomcat/app_name/.
Or just copy the war-file of NebeansProjects/app_name/dist/ into tomcat/webapps - the tomcat will create the appropriate folder with the files himself seconds later.
tl;dr: wrong deploment, copypaste war or web's content.

Tomcat: HTTP Status 404 [duplicate]

This question already has answers here:
JSP in /WEB-INF returns "HTTP Status 404 The requested resource is not available"
(3 answers)
Closed 6 years ago.
I'm following this example, I created a index.jsp file in the project WebApplication1 with the following code:
<%#page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>First JSP Page</title>
</head>
<body>
<h1>Today's date</h1>
Date and Time: <%= (new java.util.Date().toString())%>
</body>
</html>
The file is located in WEB-INF folder. Following the tutorial instructions, I built the project (success), then I ran it (also no exceptions). But when I go to localhost:8080/WebApplication1' it shows 404 mistake. I also tried the localhost:8080/WebApplication1/index with the same result..
EDIT1: I also tried to copy the WebApplication1 folder from where Netbeans places it and pasting it into tomcat/webapps and running the simpliest index.html with the same (404) result..
EDIT2: Figured out the solution - the localhost:8080/WebApplication1/web/index.jsp works fine!
Move your index.jsp outside the WEB-INF folder. According to the Tutorial, the index.jsp is not IN the WEB-INF folder but actually it is IN the web folder.
web/WEB-INF/index.jsp should be web/index.jsp

Java Applet Application Error

I'm getting this error while I'm trying to view an applet using my browser. Has anybody gone through this problem before?
This is the HTML file saved as index.html. I've created it using eclipse within the bin folder in which starApplet.class file exists.
<html>
<applet code="starApplet.class" width="500" height="500">
</applet>
</html>
I don't know if your file name is right or wrong, but assuming it's right, you have to remove the .class extension:
<html>
<applet code="starApplet" width="500" height="500">
</applet>
</html>

Categories

Resources