answersLogoWhite

0


Best Answer

Java code can be embedded into HTML and also HTML code can be embedded into java code through Java Server Pages Technology (JSP).

eg: Java code inside HTML.

Hello! The time is now <%= new java.util.Date() %>

This is someHelloJavaProgram.jsp , not someHelloJavaProgram.HTML page

eg: HTML code inside Java code

import javax.servlet.*;

import java.io.*;

public class HelloServlet extends HttpServlet {

public void doGet(HttpServletRequest incoming,

HttpServletResponse outgoing)

throws ServletException, IOException {

outgoing.setContentType("text/HTML");

PrintWriter out = outgoing.getWriter();

out.println("Hello!");

out.println("

Hello Servlet World

");

out.println("");

out.close();

}

}

http://www.wellho.net/resources/ex.php4?item=j906/HelloServlet.java

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Java isn't a page description language like HTML. It's a programming language. Description languages specify content and placement; programming languages describe a process for generating a result. Where there is generally a direct mapping between an HTML description of a document and the result, the relationship between a Java program and its result is likely to be more complex. It's a little like the difference between a list of square roots of numbers from zero to 10 and a program to calculate the list.

This is the code that specifies the Java code to run:

You need a Java-aware browser

The tag specifies the class to load (the CODE= field), URL information (the CODEBASE= field) and the size of the region the applet will own. Notice that Java doesn't exactly integrate with the rest of the page. Within that region of the page Java is king: it decides background color and fonts and does all the mouse and keyboard handling.

Parameters to the applet are placed in tags between the and tags. Anything else between these tags is ignored.

(IGNOU - BCA - CS-74 - Q.2(ii) - 2009)

Visit : www.hamidraza.page.tl

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

You don't insert the Java code directly. First you create an applet in Java, then use an HTML tag to insert the Java Applet into a webpage. The HTML tag for this should look like the following:

Java not enabled...

ClassFile.class would contain the compiled code for your applet and the width and height would define the size of the applet on the webpage. You can pass parameters to the applet using the tag. These parameters appear when calling the getParameter("parameter_name") function.

This is a very basic HTML applet tag. If you are looking for something more complex, I'd suggest that you search "HTML JAVA applet tutorial" or something of the sort in any search engine.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

No you cant since Java is like Flash and HTML code does not appreciete Java.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

HTML is a Hyper Text Markup Language. It is a static language. We can use HTML to create static web pages but we need java to make it dynamic.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

You have to use a third-party API to be able to execute JavaScript commands in Java code.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Java Program could be embedded into a HTML code. This can be done by making the code into a JSP page.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the relationship between Java and HTML?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you give connection between HTML and java servlet?

You cannot. HTML is a static file and it cannot interact with a Java Servlet. A Servlet can always redirect to a HTML page but the other way round cannot happen.


Coding for creating HTML editor using java applet?

&lt;html&gt; &lt;body&gt; java applets&lt;/body&gt;&lt;/html&gt;


Why is important to learn HTML before learning JAVA?

It is not necessary to learn HTML before learning Java. Java is a complete computer programming language. The only reason you would need to know HTML with Java is if you wanted to use Java to generate webpages, or you wanted to create Java applets that you would then embed into webpages using HTML.


Do you have experience in Java or HTML?

I have some experience in HTML but not JavaScript.


What is HTML and how can use in java applications?

HTML is a markup language for the Web. It could be used to create Java applications for the web.


What does it mean to do HTML submit?

HTML means Hypertext Markup Language. The tag is used for various javascripts and Java programs. HTML submit is a form of a script in Java programming.


What is the fullform of REL in HTML?

The REL attribute in HTML is a shortened version of "relationship." REL attributes are used to define the relationship between one file and another.


How does java script ehance the capabilites of HTML?

Javascript can change how HTML will work, alike how CSS makes HTML look flashy.


What is need to build dynamic web documents?

java,html


How do you restrict no of characters in text box in HTML?

by using java script


What is the tag in Html for providing space Similar to t in java?

The answer is : &amp;nbsp;


What should you known to study java script?

Xhtml/html &amp; css