+ 3
How to insert Java code in HTML
20 Answers
+ 6
Josie Lyobaw We cannot insert java code in Html Because Java is server side language and Html is client side language. But there is a part "Applet" in java which can be embedded with html and Applet mostly use to make desktop applications.
Check this link to know how we can embedded Applet with html.
https://www.google.com/amp/s/www.geeksforgeeks.org/java-applet-basics/amp/
+ 5
Found this article. See if it answers your question.
https://stackoverflow.com/questions/10964693/java-embedding-into-html
+ 3
Josie Lyobaw We can write Java code in JSP which is somehow similar to html but we need application server to run it.
$hardul B Servlets use in back-end not in front-end.
JSP use as front-end.
+ 3
Yep i know Servlet is backend... But he didn't mention his need😅
+ 3
$hardul B 😂😂
+ 2
Applet
Servlet both are useful
+ 1
Mirielle🐶 [Inactive] That's Why I said there is a part of Java. So definitely we are inserting Java not directly but using "Applet"
+ 1
We cannot insert java code in html but we can insert html code in java using applet and then just compile your code with javac compiler and after creating bytecode just get output with appletviewer filename.class
+ 1
By using <script> tag but you have to actually type <script lang="java">,
I hope that MIGHT work though.
0
you may create separate .jsp file and then import to html to load, you will need to pass parameter to the jsp file .. usually by using script easier
0
Google bro
0
Applet
0
What?
0
Maybe you mean JavaScript? in fact, Java is used to develop applications, with the exception of the special server-side language PHP.
0
Brasil
0
JSP is java code embedded into HTML code.
Use JSP. You will need a server for running it.