Professional Documents
Culture Documents
into HTML pages. JavaScript inserted into HTML pages, can be executed by all modern web
browsers. JavaScript is easy to learn. JavaScript is the most popular scripting language on
the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome,
commonly used as a part of web pages, whose implementations Opera, and Safari.
JavaScript was designed to add interactivity to HTML pages before you start this lesson you
should already know HTML. It's important to understand the difference between Java and
formal structures, etc. Most JavaScript must be written in the HTML document between
<SCRIPT> tags. You open with a <SCRIPT> tag, write your JavaScript, and write a closing
</SCRIPT> tag. allow client-side script to interact with the user and make dynamic pages. It
JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript,
possibly because of the excitement being generated by Java. JavaScript made its first
appearance in Netscape 2.0 in 1995 with the nameLiveScript. The general-purpose core of
the language has been embedded in Netscape, Internet Explorer, and other web browsers.
SERVLET:-
Servlets are most often used to [citation needed]. Process or store data that was submitted
from an HTML form Provide dynamic content such as the results of a database query.
Manage state information that does not exist in the stateless HTTP protocol, such as filling
the articles into the shopping cart of the appropriate customer. Technically speaking, a
"servlet" is a Java class in Java EE that conforms to the Java Servlet API, a standard for
communicate over any client–server protocol, but they are most often used with the HTTP
protocol. Thus "servlet" is often used as shorthand for "HTTP servlet". Thus, a software
developer may use a servlet to add dynamic content to a web server using the Java platform.
To deploy and run a servlet, a web container must be used. A web container (also known as a
servlet container) is essentially the component of a web server that interacts with the servlets.
The web container is responsible for managing the lifecycle of servlets, mapping a URL to a
particular servlet and ensuring that the URL requester has the correct access rights. The
Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected
interactions of the web container and a servlet. A Servlet is an object that receives a request
and generates a response based on that request. The basic Servlet package defines Java
objects to represent servlet requests and responses, as well as objects to reflect the servlet's
objects that track multiple requests and responses between the web server and a client.
Servlets may be packaged in a WAR file as a web application. Servlets can be generated
automatically from Java Server Pages (JSP) by the JavaServer Pages compiler. The difference
between servlets and JSP is that servlets typically embed HTML inside Java code, while JSPs
embed Java code in HTML. While the direct usage of servlets to generate HTML (as shown
in the example below) has become rare, the higher level MVC web framework in Java EE
(JSF) still explicitly uses the servlet technology for the low level request/response handling
via the Faces Servlet. A somewhat older usage is to use servlets in conjunction with JSPs in a
pattern called "Model 2", which is a flavor of the model–view–controller pattern. The current
version of Servlet is 3.1. Servlet can be described in many ways, depending on the context.
Servlet is an API that provides many interfaces and classes including documentations.
Servlet is a class that extend the capabilities of the servers and respond to the
Servlet is a web component that is deployed on the server to create dynamic web
page.
INTRODUCTION TO OPEN SOURCE:-
Open source describes practices in production and development that promote access to the end
product's source materials. Some consider open source a philosophy, others consider it a
pragmatic methodology. Before the term open source became widely adopted, developers and
producers used a variety of phrases to describe the concept; open source gained hold with the
rise of the Internet, and the attendant need for massive retooling of the computing source code.
communication paths, and interactive communities. Before the term open source became
widely adopted, developers and producers used a variety of phrases to describe the concept;
open source gained hold with the rise of the Internet, and the attendant need for massive
retooling of the computing source code. Opening the source code enabled a self-enhancing
CONNECTING TO SERVER
GLASSFISH:-GlassFish is an open-source application server project started by Sun
e Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free
software, dual-licensed under two free software licences: the Common Development and
Distribution License (CDDL) and the GNU General Public License (GPL) with the classpath
exception.
APACHE TOMCAT:-Apache Tomcat (or simply Tomcat, formerly also Jakarta Tomcat) is
an open source web server and servlet container developed by the Apache Software
Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP)
specifications from Sun Microsystems, and provides a "pure Java" HTTP web server
environment for Java code to run in. In the simplest config Tomcat runs in a single operating
system process. The process runs a Java virtual machine (JVM). Every single HTTP request
Now that you have some data in the database, you probably want to retrieve it. You use the
SELECT statement to choose data that fits your criteria. Typical syntax for this command is
as follow:
SELECT [fieldnames]
AS [alias]
FROM [tablename]
WHERE [criteria]
You can set numerous other parameters, but these are the most commonly used:
? SELECT [fieldnames]: First decide what specific fieldnames you want to retrieve; if you
? AS: You use the alias to group two or more fieldnames together so that you can reference
You cannot use the AS parameter with the WHERE parameter, because this is a limitation of
MySQL.When the WHERE clause is executed, the column value may not be known.
? FROM: This is pretty self-explanatory: You just need to name the table or tables you are
? WHERE: List your criteria for filtering out the data, as described in the following section.
? ORDER BY: Use this parameter if you want the data sorted on a particular field; if you
? LIMIT: This enables you to limit the number of results returned and offset the first record
This would show records 10 through 19. This is a useful feature for showing only a certain
number of records on a page, and then allowing the user to click a “next page” link to see
more.
WHERE: The beast clause called WHERE deserves its own little section because it’s really
? LIKE and %: Oh how we like LIKE. LIKE lets you compare a piece of text or number and
Example:
This gives you any records that have the word or text pattern of “shirt” in the description,
such as “t-shirt,” “blue shirts,” or “no shirts here.” Without the %s you would get only those
FORM
JAVA uses a set of simple yet powerful expressions that, once combined, provide you with
the means to do virtually anything you want. In this chapter, you begin to build a simple
application that allows you to add, edit, or delete members of a data set (in this instance,
movies, actors, and directors). This chapter welcomes you into a world of JAVA/MySQL
? Creating forms using buttons, text boxes, and other form elements
? Passing hidden information to the form processing script via hidden form controls and a
journey, you will focus on a very simple form. It will include only a text field and a submit
button in a table layout. The processing script will display only the value entered in the text
field. Try It Out Say My Name In this part, you are going to get JAVA to respond to a name
entered in a form. This is a simple variation of the typical “hello world” program, allowing
you to take your first step into interactivity. This is a simple variation of the typical “hello
world” program, allowing you to take your first step into interactivity.
value="Register" name="btnRegister"/></tr>
</Form>
HOW IT WORKS
As with any recipe, it’s a good idea to start working on forms by understanding the
ingredients. To familiarize yourself with forms, you’ll need some background information
about HTML form elements and a few new JAVA functions. Let’s start with the HTML form
itself.
FORM ELEMENT
First, we’ll introduce the first HTML element you’ll need: FORM. It delimits the form area in
the page and holds the fields you want your Web site users to fill in.
<form action=”formprocess1.php” method=”post”>
</form>
Notice that the FORM element has an ending tag and two attributes. The first attribute