Introduction
The web page is rendered in the browser by interpreting the page syntax and communicate with the server where the page content is stored and includes plig ins and access to facilities needed to process all components of the webpage.
Host and Paths
The hostname is case insensitive and the path is case sensitive. For domain and host space is not allowed. The below code shows the JSP module that echo back the HTTP request parameters.
- <%@ page import = " java.io.", java.util.*"%>
- <%
- out.println ("Method : "+ request.getMethod() + "</br>");
- Enumeration pars = request.getParmeterNames ();
- While (pars.hasMoreElements ())
- {
- String parName = (String) pars.nextElement ();
- String [] parValues = request.getParameterValues (parName);
- out.print (parName + " = ");
- for ( int k = 0; k< parValues.length(); k++)
- {
- out.println ("</br>");
- }
- %>
HTML Elements and Tags
HTML documents consist of content enclosed between a pair of start and end tags. The start tag includes element attributes, and some elements are empty. The end tag consists of slash before the closing bracket of the start tag. Elements can be nested.
Content
An HTML document consists of text, images, audio, and video content such as script and executables. The brower intercepts and render the component in order and without inserting any empty space between them. The browser render every component to series of default specified in html standard. The object element is used to insert any component and the below code is used to play video content in flash type.
- < object type = "appication/x-shockwave-flash" >
- data = " myclip.swf " width = "400" height = "300" >
- <param name = "movie" value = "myClip.swf">
- <p> Video is playing in the web page . . . </P>
- </object>
Tables
Table element is used to display tabular data. tr and td are the table row and table data element iwithin the rows. The below code show the table which shows the content in the table with the table row, table column, and table heading.
- < table border = "1" >
- < tr style = "background-color: #cococo">
- < th> name </th>
- < th align = "center" colspan = "2"> marks </th>
- < /tr>
- < tr>
- < td> ram </td>
- < td> 50 </td>
- < td> 60 </td>
- </tr>
- </table>
Forms
The form element is used to the type specification, upload specification, and choice specification. It accepts data from the user and sends the data to the server. The control elements are defined inside the form element. The input element is used to enter the text, passwords, checkbox, radio button, uploading a document. The text area is used to enter the text content with many lines and the fieldset is used to group several input fields.
Style Syntax
The selector is html element and property is the element attribute, value is the attribute value. The several attributes are defined for same element. To define more than one style for same element, can associate a class name to separate style.
- < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict .dtd" >
- " http://www.w.org/TR/xhtml1/strict.dtd" >
- < html >
- < head >
- < title > Styled paragraphs </title >
- <style type = "text/CSS" >
- P { font-size : 130% }
- p.bold { font-weight : bold }
- p.italic { font-style : italic }
- p.p123 { font-size : 100%; font-weight : normal; font-style :normal
- }
- </style>
- </head>
- <body>
- <p> This is a small paragraph </p>
- <p class ="bold"> Bold the paragraph </p>
- <p class = "bold italic" > Italic paragraph </p>
- </body>
- </html>
Javascript Inside a Web Page
The script is included in the web pages in two ways, by writing the script inside or placing the script inside the head or body. When the script is placed inside the body tag, the browser will execute it on the loading page.
- <script type = "text/javascript " >
-
- </script>