20 AnswersNew Answer
20 AnswersNew Answer
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/
Found this article. See if it answers your question. https://stackoverflow.com/questions/10964693/java-embedding-into-html
It is called "applet" in java
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.
Yep i know Servlet is backend... But he didn't mention his need😅
$hardul B 😂😂
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Figuratively, with applet you're inserting JAVA code in html. applet is more of <applet dir="directory.java">....... And that lives in a .html file. Josie Lyobaw , reading your question again, i got another interpretation (since you've got no description for your question). Webview in java are used to write GUI apps in HTML, CSS, JS and maybe XML.
Applet Servlet both are useful
Mirielle🐶 [Inactive] That's Why I said there is a part of Java. So definitely we are inserting Java not directly but using "Applet"
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
By using <script> tag but you have to actually type <script lang="java">, I hope that MIGHT work though.
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
MegaMaster666 it will work if the configurations is okay and also a server is needed
JSP is java code embedded into HTML code. Use JSP. You will need a server for running it.
Learn Playing. Play Learning
Send us a message