Link to home
Start Free TrialLog in
Avatar of chenwei
chenwei

asked on

Can I use JAVA code in HTML?

I konw one can use Java code in JSP with tags like

<%@ page language="java" %>
...
<%
  response.setHeader("Pragma", "No-cache");
  response.setHeader("Cache-Control", "no-cache");
  response.setDateHeader("Expires", 0);
%>

Can I use these code in HTML as well?
ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of iagorubio
iagorubio

This jsp code is embeded in an HTML page, but you need a Java enabled server, to parse the java code and send a response to the client.

If your server is not Java enbled, you can not run Java Server Pages.

In fact, even if  your server have java support, some scripting and compiling Java Servlets or Beans should be necesary to give full Java power (data base acces, ...) to your pages.

You can dowload the Java 1.3 SDK from http://java.sun.com/j2se/1.3/  by choosing your OS and providing them an e-mail address (you set, this way, an account that gives you full acces to documentation pages. It's free).

It came with some documentation packaged, and development tools as a compiler, debbuger, appletviewer, .. and more. You can also develope Java applets to directly embed it in any web page, with no matter about the server. But the client may be java enabled (Netscape, Explorer,Hot Java, AOL and others are Java enabled Browsers).
You can see the documentation packaged with the SDK in http://java.sun.com/docs/books/tutorial/ 
More Info about Java in http://developer.java.sun.com/developer/infodocs/  (Require logging).

Hope this heps.

- Iago -