World Wide Web, , WWW - , . (), . , ( ), , , (. . ). HTML-, , , . / ( ).
, , , . . http , . , , , .
HTML- - WWW- (WWW-browsers). , Microsoft Internet Explorer, Mozilla ( , Fire Fox), Opera, Netscape Navigator.
WWW-, , , Internet. , - HyperText Markup Language (HTML) - . () , , .
HTML. - HTML 4.01, W3C (World Wide Web Consortium), HTML WWW-. XML- HTML, XHTML, . WWW- - HTML 3.2. , HTML-. , HTML- .
, HTML, , , , (murkup tags). , '<' '>'.
|
|
, , , Internet. , '>', .
HTML .html .htm. WWW- , - .
HTML , :
< > & "< > & "
, ( ) .
. ("") . , " / ". :
<html> html </html>, . , <br> .
, , , <pre> </pre>. , , . .
, , .
, <img src="MyFile.gif" width=100 height=40>
MyFile.gif, 100 40 (), . src, , , width height - ( ).
HTML- . <html> </html>
:
<head>, </head>
HTML- , ,
<title> </title>,
. , .
, :
- ISO 1251.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">- UTF-8, ..
:
<body> html-, - . </body> :
html-, - .
|
|
HTML- , Internet. (hypertext link),, . .
, , (URL - 'Uniform Recourses Location') : . , , .
, , . :
<a href="_">_</a>_ - ( ), , , _ - , . . , . URL- .
HTML , . , , . , .
<a href="_#_"></a>,-
<a name="_"> </a> _ - , ( ), _ - ( ), , - . , , . .
: , : , ( ). ( - ), , . , " ", ( ), "" ( ) - ( ).
- " " . :
<p> </p>
<p align=left> </p>
<p align=right> </p>
<p align=center> </p>
</p> .
<hr>
- ( 6 ). 1 6.
<h1> </h1>
<h2> </h2>
<h3> </h3>
<h4> </h4>
<h5> </h5>
<h6> </h6>
- :
<ol> <li>... <li>... <li>...... </ol>HTML-:
: <ol> <li> <li> <li> </ol>:
:
1.
|
|
2.
3.
HTML- :
:
:
o
o
o
HTML :
<b> (bold)</b>
(bold)
<i> (italics)</i>
(italics)
<big> </big>
<small> </small>
<sub>(subscript)</sub>
(subscript)
<sup>(superscript)</sup>
(superscript)
, . <pre>...</pre> , , .
HTML , . :
<img src="_" width= height= border=_ hspase=_ vspase=_>_ - ( ), , - , - , _ - . ( ). width height, .
border , , .
hspase vspase .
, , , . width height , , "" . , , , , , .
, , <img> <a href="" >
HTML- . <table>, a e , border ( border border=_): <table border> </table> , <tr> </tr> (. . "", "") <td> </td> . , , . . :
<table border> <tr> <td>...</td> <td>...</td> <td>...</td> <td>...</td> </tr> <tr> <td>...</td> <td>...</td> <td>...</td> <td>...</td> </tr>...</table>(). HTML , , HTML- , . :
|
|
HTML- (browser), , .
, <hr>...</hr>
(plug-in) <object>:
<object
>
<param name= 1 value= 1 >
<param name= 2 value= 2 >
...
<param name= N value= N >
, ,
</object>
Java, ..
, .
Java , WWW- . , HTML- ( WWW-).
(applications) (applets) Java : . WWW , - WWW , , . WWW , . , , , .
(core library), java.applet , javax.swing.JApplet , Swing / Sun JFC (Java Foundation Classes).
, java.applet.Applet, java.awt.Panel.
:
public class Applet1 extends java.applet.Applet{
public void init(){
// .
//
// start()
}
public void start(){
// .
//
// init().
//
// HTML- .
}
public void update(java.awt.Graphics g){
//
}
public void paint(java.awt.Graphics g){
// .
//
}
public String getAppletInfo(){
return " ";
}
public void stop(){
// .
// ,
// HTML- .
}
public void destroy(){
// .
// , .
//
// stop()
// .
}
}
, , Applet , :
getSize() . getSize().width getSize().height
showStatus(String s) s.
AppletContext getAppletContext() , , .
add(Component comp) .
|
|
AudioClip getAudioClip(URL url) - WWW- url. Java, .
URL getDocumentBase() - WWW-, .
, Panel.
JDK demo/applets.
:
import java.awt.*;
public class Applet1 extends java.applet.Applet{
public void paint(java.awt.Graphics g){
g.setColor(Color.green);
g.fillRect(0,0,getSize().width - 1, getSize().height - 1);
g.setColor(Color.black);
g.drawString(" !",20,20);
this.showStatus(" ");
}
}
HTML-, :
<html>
<body>
<p>
<object
codebase="."
code="Applet1.class"
width=200
height=150
>
, ,
</object>
HTML- example.html, Applet1.class , example.html. example.html. .
, appletviewer. example.html Applet1.class, appletviewer example.html. , Windows
appletviewer.exe example.html
: Windows XP SP1 MS Internet Explorer 6.0 , JDK. Java , . appletviewer . , , . , WWW, JDK, . . , . , HTML JavaScript ( HTML 4.01 JavaScript 1.3 ). , HTML- , .
. , JVM , . .
Java, . , javax.servlet JSP. JSP HTML- XML-, (), Java. , . Java , . , , , Java-. , JDK NetBeans Enterprise Pack j2EE, Bundled Tomcat Server.
, .
, Hello!:
import java.io.*;import javax.servlet.*;import javax.servlet.http.*; public class Hello extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<head>"); out.println("<title>Hello!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Hello!</h1>"); out.println("</body>"); out.println("</html>"); }}
, :
<html>
<head>
<title>Servlet example</title>
</head>
<body bgcolor="#FFFFFF">
<a href="servlet/Hello">Execute servlet</a>
</body>
</html>
, : File/New Project/ Samples/J2EE1.4/Web /Tomcat Servlet Example
The Apache Software Foundation (http://www.apache.org/), , http://www.apache.org/licenses/LICENSE-2.0.
Execute () , HTML-. Hello World. , Source HTML- . , HTML-!- , Projects Web Pages/helloworld.html. , Source Packages/<default package>/HelloWorldExample.java
.
Hello World