CONTENT
2) HTML
3) JSP
5) REFERENCE
6) CONCLUSION
INTRODUCTION
OVERVIEW:
This is dynamic website which gives all the information about a book store, helps the user to find books of their choice with little bit of introduction about the book with ease.
The website has been developed in HTML, JSP and HTML is a markup language which is in reality a backbone of any site, every site can’t structured without the knowledge of html.
If we make our web page only with the help of html, than we can’t add many of the effective features in a web page, for making a web page more effective we use various platforms such as JSP.
So here we are using these entire features to make our web pages more effective as well as efficient.
And to make our web pages dynamic we are using JSP here.
ADVANTAGES
Requirements
HTML (HYPERTEXTMARKUP LANGUAGE)
HTML stands for Hypertext Markup Language, and it is the language in which, until recently, virtually all Web pages were written. Now, don’t break out in hives when you hear the word “language.” You don’t need complex logical or mathematical formulas to work with HTML, and you don’t need to think like a programmer to use it. Computer programmers must think through the tasks that they want their programs to perform, and then develop an elaborate (and usually complicated) series of instructions to tell the computer what to do. Although you do need to do some thinking and planning when you use HTML, it is not nearly that difficult. So, how does Hypertext Markup Language work?
Hypertext refers to the way in which Web pages (HTML documents) are linked together. When you click a link in a Web page, you are using hypertext. It is this system of linking documents that has made the World Wide Web the global phenomenon it has become.
Markup Language describes how HTML works. With a markup language, you simply “mark up” a text document with tags that tell a Web browser how to structure it. HTML originally was developed with the intent of defining the structure of documents (headings, paragraphs, lists, and so forth) to facilitate the sharing of scientific information between researchers. All you need to do to use HTML is to learn what type of markup to use to get the results you want
The first step toward understanding and working with HTML is learning the basic terms that describe most of the functions of this language. You will come across these terms repeatedly as you use HTML and if you understand them, you will have progressed a long way toward comprehending HTML, not to mention XHTML.
All HTML pages are made up of elements. Think of an element as a container in which a portion of a page is placed. Whatever is contained inside the element will take on the characteristics of that element. For example, to identify a heading on a page, you would enclose it in a heading element <h1> </h1>. If you want to create a table, you put the table information inside the table element <table> </table>. To construct a form, you need the form element <form> </form>.
Often, you’ll find the terms element and tag used interchangeably. It’s fairly common, but not strictly accurate. An element is made up of two tags: an opening tag and a closing tag. Although it might seem somewhat picky to make this distinction, when you begin to work with XHTML (Extensible Hypertext Markup Language), it will be a very important difference to remember. If you get into the habit of distinguishing elements and tags from the very beginning, you’ll save yourself some confusion down the line.
All tags are constructed the same way. The tag begins with a “less than” sign (<), then the element name, followed by a “greater than” sign (>). For example, an opening tag for the paragraph element would look like this: <p>. The only difference in a closing tag is that the closing tag includes a slash (/) before the element name: </p>. Your content goes between the tags. A simple paragraph might look like this:
<p>This is an HTML paragraph.</p>
Some elements do not use closing tags because they do not enclose content. These are called empty elements. For example, the line break element <br> does not require a closing tag. In the case of empty elements, add a closing slash after the element name, like this: <br />. When a browser sees the slash, it will recognize the element as one that does not need a separate, closing tag.
Attributes are another important part of HTML markup. An attribute is used to define the characteristics of an element and is placed inside the element’s opening tag. For example, to specify the size of an image or graphic on your page, you would use the image element <img /> along with the height and width attributes:
<img height=" " width=" " />
Be sure to notice that an equals sign and a set of quotation marks follow both the height and the width attributes. That’s because attributes need values to go with them. In the case of the preceding illustration, you might add a value of 200 to cause your image to display at a size of 200 x 200 pixels:
<img height="200" width="200" />
vlues work together with attributes to complete the definition of an element’s characteristics. An easy way to think of how attributes and values work together is to compare them with nouns and adjectives. A noun names something; an adjective describes it. An attribute names a characteristic; a value describes it. Imagine that you are trying to identify a person’s hair color with a markup language. Hair would be the element, color the attribute, and red the value. You might write such a description as follows:
<hair color="red">Red-headed Person</hair>
Often you will want to apply more than one element to a portion of your page. An essential concept to understand is nesting. Nesting simply means that elements must never overlap. Properly nested elements are contained inside one another, as in the following:
<a> <b> <c> </c> </b> </a>
Sometimes it’s easier to understand the concept if the elements are displayed vertically, like this:
<a><b><C>
</c>
</b>
</a>
The following elements, on the other hand, are overlapping:
<a>
<b>
</a>
<c>
</b>
</c>
Web browsers displaying an HTML page can be pretty forgiving if your elements are not properly nested; however, overlapped elements can create garbled results, particularly if you are trying to construct frames or tables. Also, when you become familiar with XHTML’s stricter standards, you’ll discover that overlapping elements are an absolute “no-no.”
Why JSP?
Javaserver pages enable you to mix regular, static HTML with dynamically generated content. We can simply write the regular HTML in the normal manner using familiar Web-page building tools. We then enclose the code for the dynamic part in special tags.
BENEFITS OF JSP
JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything we can do on a particular computer platform in the Java programming language we could also do in assembly language. But it still matters which we choose.
JSP provides the following benefits over servlets alone:
• It is easier to write and maintain the HTML.
Our static code is Ordinary HTML: no extra backslashes, no double quotes, and no Lurking Java syntax.
• We can use standard Web-site development tools.
For example, We use Macromedia Dream weaver for most of the JSP pages in theBook.
Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.
• We can divide up our development team.
The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of our team and the complexity of our project, we can enforce a weaker or stronger separation between the static HTML and the dynamic content.
ADVANTAGES OF JSP OVER
COMPETING TECHNOLOGIES
VERSUS .NET AND ACTIVE SERVER PAGES (ASP)
ASP.NET is the part that directly competes with servlets and JSP. The advantages of JSP are –
VERSUS PHP -
PHP (a recursive acronym for “PHP: Hypertext Preprocessor”) is a free, open-source,
HTML-embedded scripting language that is somewhat similar to both ASP and JSP.
One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.
TECHNOLOGY USED
HTTP is a “stateless” protocol: each time a client retrieves a Web page, the client opens a separate connection to the Web server and the server does not automatically maintain contextual information about the client. Even with servers that support persistent (keep-alive) HTTP connections and keep sockets open
for multiple client requests that occur in rapid succession, there is no built-in support for maintaining contextual information. This lack of context causes a number of difficulties. For example, when clients at an online store add an item to their shopping carts, how does the server know what’s already in the carts?
Similarly, when clients decide to proceed to checkout, how can the server determine which previously created shopping carts are theirs? There are three typical solutions to this problem: cookies, URL rewriting, and hidden form fields. The following subsections quickly summarize what would be required if you had to implement session tracking yourself (without using the built-in session-tracking API) for each of the three ways.
We can use cookies to store an ID for a shopping session; with each subsequent connection, we can look up the current session ID and then use that ID to extract information about that session from a lookup table on the server machine. So, there would really be two tables: one that associates session IDs with user tables, and the user tables themselves that store user-specific data. Using cookies in this manner is an excellent solution and is the most widely used approach for session handling. Still, it is nice but we are not using this technique in our project because of the following reason-
1. Cookies can be disabled by the client at any time.
2. We can’t store the personal and private information of the client because anyone can hack those details.
3. Only 4 cookies per server are accepted by the browser.
With this approach, the client appends some extra data on the end of each URL. That data identifies the session, and the server associates that identifier with user-specific data it has stored. For example, with http://host/path/file.html;jsessionid=a1234, the session identifier is attached as jsessionid=a1234, so a1234 is the ID that uniquely identifies the table of data associated with that user.
<INPUT TYPE="HIDDEN" NAME="session" VALUE="a1234">
This entry means that, when the form is submitted, the specified name and value are automatically included in the GET or POST data. This hidden field can be used to store information about the session but has the major disadvantage that it only works if every page is dynamically generated by a form submission. Clicking on a regular (<A HREF...>) hypertext link does not result in a form submission, so hidden form fields cannot support general session tracking, only tracking within a specific series of operations such as checking out at a store.
Session Tracking Basics
Session tracking is a mechanism that servlets use to maintain state about a series of requests from the same user(that is, requests originating from the same browser) across some period of time Using sessions in servlets is straightforward and involves four basic steps.
1. Accessing the session object associated with the current request.
Call request.getSession to get an HttpSession
object, which is a simple hash table for storing user-specific data.
2. Looking up information associated with a session. Call
getAttribute on the HttpSession object, cast the return value
to the appropriate type, and check whether the result is null.
3. Storing information in a session.
Use setAttribute with a key
and a value.
4. Discarding session data.
Call removeAttribute to discard a specific
value. Call invalidate to discard an entire session. Call
logout to log the client out of the Web server and invalidate all sessions
associated with that user.
METHODS OF ACCESSING SESSION OBJECT
1. Public Object getAttribute(String name)
This method extracts a previously stored value from a session object. It returns null if no value is associated with the given name.
2. Public Enumeration getAttributeNames()
This method returns the names of all attributes in the session.
3. Public void setAttribute(String name, Object value)
This method associates a value with a name. If the object supplied to setAttribute implements the HttpSessionBindingListener interface, the object’s valueBound method is called after it is stored in the session. Similarly, if the previous value implements HttpSessionBindingListener,
its valueUnbound method is called.
4. Public void removeAttribute(String name)
This method removes any values associated with the designated name. If the value being removed implements HttpSessionBindingListener, its valueUnbound method is called.
5. Public void invalidate()
This method invalidates the session and unbinds all objects associated with it. Use this method with caution; remember that sessions are associated with users (i.e., clients), not with individual servlets or JSP pages.
So, if you invalidate a session, you might be destroying data that another servlet or JSP page is using.
6. Public void logout()
This method logs the client out of the Web server and invalidates all sessions associated with that client.
The scope of the logout is the same as the scope of the authentication. For example, if the server implements single sign-on, calling logout logs the client out of all Web applications on the server and invalidates all sessions (at most one per Web application) associated with the client.
7. Public String getId()
This method returns the unique identifier generated for each session. It is useful for debugging or logging or, in rare cases, for programmatically moving values out of memory and into a database (however, some J2EE servers can do this automatically).
8. Public boolean isNew()
This method returns true if the client (browser) has never seen the session, usually because the session
was just created rather than being referenced by an incoming client request. It returns false for preexisting sessions.
9. Public long getCreationTime()
This method returns the time in milliseconds since midnight, January 1, 1970 (GMT) at which the session
was first built. To get a value useful for printing,pass the value to the Date constructor or the setTimeInMillis method of GregorianCalendar.
10. Public long getLastAccessedTime()
This method returns the time in milliseconds since midnight, January 1, 1970 (GMT) at which the session
was last accessed by the client.
11. Public int getMaxInactiveInterval()
Public void setMaxInactiveInterval(int seconds)
These methods get or set the length of time, in seconds, that a session should go without access before being automatically invalidated. A negative value specifies that the session should never time out. Note that the timeout is maintained on the server and is not the same as the cookie expiration date. For one thing, sessions are normally based on in-memory cookies, not persistent cookies, so there is no expiration date.
B. Java beans
Why Use Beans?
Beans are merely Java classes that are written in a standard format, there are several advantages to their use. With beans in general, visual manipulation tools and other programs can automatically discover information about classes that follow this format and can create and manipulate the classes without the user having to explicitly write any code. In JSP in particular, use of JavaBeans components provides three advantages over scriptlets and JSP expressions that refer to normal Java classes.
1) No Java syntax.
By using beans, page authors can manipulate Java objects using only XML-compatible syntax: no parentheses, semicolons, or curly braces. This promotes a stronger separation between the content and the presentation and is especially useful in large development teams that have separate Web and Java developers.
2) Simpler object sharing.
When you use the JSP bean constructs, you can much more easily share objects among multiple pages or between requests than if you use the equivalent explicit Java code.
The JSP bean constructs greatly simplify the process of reading request parameters, converting from strings, and putting the results inside objects.
What Are Beans?
Beans are simply Java classes that are written in a standard format. Beans are the three simple points outlined in the following list.
• A bean class must have a zero-argument (default) constructor.
You can satisfy this requirement either by explicitly defining such a constructor or by omitting all constructors, which results in a zero-argument constructor being created automatically. The default constructor will be called when JSP elements create beans. : The Model View Controller (MVC) Architecture), it is quite common for a servlet to create a bean, from which a JSP page merely looks up data. In that case, the requirement that the bean have a zero-argument constructor is waived.
• A bean class should have no public instance variables (fields).
To be a bean that is accessible from JSP, a class should use accessor methods instead of allowing direct access to the instance variables. We hope you already follow this practice since it is an important design
strategy in object-oriented programming. In general, use of accessor methods lets you do three things without users of your class changing their code:
(a) impose constraints on variable values (e.g., have the setSpeed method of your Car class disallow negative speeds);
(b) change your internal data structures (e.g., change from English units to metric units internally, but still have getSpeedInMPH and getSpeedInKPH methods); (c) perform side effects automatically when values change (e.g., update the user interface when setPosition is called).
• Persistent values should be accessed through methods called getXxx and setXxx.
For example, if your Car class stores the current number of passengers, you might have methods named
getNumPassengers (which takes no arguments and returns an int) and setNumPassengers (which takes an int and has a void return type). In such a case, the Car class is said to have a property named numPassengers (notice the lowercase n in the property name, but the uppercase N in the method names). If the class has a getXxx method but no corresponding setXxx, the class is said to have a read-only property named xxx. The one exception to this naming convention is with boolean
properties: they are permitted to use a method called isXxx to look up their values. So, for example, your Car class might have methods called isLeased (which takes no arguments and returns a boolean) and setLeased (which takes a boolean and has a void return type), and would be said to have a boolean property named leased (again, notice the lowercase leading letter in the property name).
DATA-BASE
Six tables are used to form data base. They are-
This table is used for storing the information of the user/customers. It has eleven attributes.The table is shown bellow.
Id | Password | Name | Country | State | City | Address | Sequrity_q | Ans | ph | |
Query used to make this table is:
create table user_info(id varchar(30)primary key not null,password varchar(30)not null,name varchar(30),country varchar(30),state varchar(30),city varchar(30),address varchar(30)not null,sequrity_q varchar(70)not null,ans varchar(150)not null,email varchar(70)not null,ph_no varchar(20));
This table is used for storing the information about the books.It has eleven attributes.The table is shown bellow.
Id | S_no | Name | author | publisher | category | price | S_path | L_path | description |
For making this table we have used this query-
create table book(id varchar(10) primary key not null,s_no integer,name varchar(50),author varchar(50),publisher varchar(50),catagory varchar(20),price money,descript varchar(3000),s_path varchar(150),l_path varchar(150));
3. Bank
This table is used for storing the info about bank.This type of table is provided by the internet service provider.
Bank_name | Acc_no | Credit_no | Password | amount |
For making this table we have used this query-
create table bank(bank_name varchar(50)not null,acc_no varchar(50)not null,credit_no varchar(50)not null,password varchar(50)not null,amount money not null);
4. bill
This table is used for making the bill.
Bill_no | Sys_date | Bank_name | User_id | Book_id | quantity | Total_amount |
For making this table we have used this query-
create table bill(bill_no int primary key not null,sys_date datetime not null,bank_name varchar(50),user_id varchar(30)not null,book_id varchar(10)not null,quantity integer not null,total_amount money);
5. Entries
This table is used to store total no of entries.
Bill_no | Book_id | Quantity | Total_amount | Sys_date |
For making this table we have used this query
create table entries(bill_no varchar(30)primary key not null,book_id varchar(10)not null,quantity integer not null, total_amount money)
6. Temp
This table is used to store temporary entries made by the user.
User_id | I_no | Quantity | |
making this table we have used this query
create table temp(user_id varchar (30)primary key not null ,i_no int not null ,quantity integer not null,)
FEATURES OF ONLINE BOOK SHOPPING
HOME PAGE:
LOGIN PAGE OF THE WEB SITE:
REGISTRATION FORM OF THE WEB SITE:
SHOPPING CART OF USER:
UPDATE FACILITY OF SITE:
DELETION FACILITY OF THE SITE:
FULL INFO ABOUT THE BOOK:
CREDIT INFO OF THE USER:
IF THE CREDIT ENTRIES ARE INCORRECT:
BILL:-
BIBLOGRAPHY:
CONCLUSION
By using the defined technologies we have created a website (ebooks.com), right now we are developing some more WebPages, and now working on adding further services such as Downloading and online reading. In the end, we want to conclude that practical training is of great importance as it gives the exposure and an opportunity of presenting a seminar before the audience. It develops a sense of responsibility and a feeling of togetherness of working together thereby developing a team spirit for the successful completion of the project. It is an important opportunity which provides the working environment of an organization as to how to deal with the professionals and the customers which plays an important role in building customer satisfaction.
6