Home Jsp Free JSP Books
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Free JSP Books

Advertisement
This chapter explores some of JSP?s capabilities, giving you a quick tour of its basic functionality.

Free JSP Books

        

Download the following JSP books.
  1. Handling the client request to form Data
    If you?ve ever used a search engine, visited an on-line bookstore, tracked stocks on the Web, or asked a Web-based site for quotes on plane tickets, you?ve probably seen funny-looking URLs like http://host/path?user=Marty+Hall&origin=bwi&dest=lax. The part after the question mark (i.e., user=Marty+Hall&origin= bwi&dest=lax) is known as form data (or query data) and is the most common way to get information from a Web page to a server-side program. Form data can be attached to the end of the URL after a question mark (as above), for GET requests, or sent to the server on a separate line, for POST requests. One of the nice features of servlets is that all of this form parsing is handled automatically. You simply call the getParameter method of the Http- ServletRequest, supplying the case-sensitive parameter name as an argument. You use getParameter exactly the same way when the data is sent by GET as you do when it is sent by POST.
     
  2. How to using JSP HTML Form
    This chapter discusses using HTML forms as front ends to servlets or other server-side programs. These forms provide simple and reliable user interface controls to collect data from the user and transmit it to the servlet. The following chapter discusses the use of applets as servlet front ends. Using applets in this role requires considerably more effort and has some security limitations. HTML forms let you create a variety of user interface controls to collect input on a Web page. Each of the controls typically has a name and a value, where the name is specified in the HTML and the value comes either from the HTML or by means of user input. The entire form is associated with the URL of a program that will process the data, and when the user submits the form the names and values of the controls are sent to the designated URL as a string of the form.
      
  3. The JSP page Directive: Structuring Generated Servlets
    A JSP directive affects the overall structure of the servlet that results from the JSP page. The following templates show the two possible forms for directives. Single quotes can be substituted for the double quotes around the attribute values, but the quotation marks cannot be omitted altogether. In JSP, there are three types of directives: page, include, and taglib. The page directive lets you control the structure of the servlet by importing classes, customizing the servlet super class, setting the content type, and the like. A page directive can be placed anywhere within the document; its use is the topic of this chapter. The second directive, include, lets you insert a file into the servlet class at the time the JSP file is translated into a servlet. 
     
  4. The JSP Scripting element
    JavaServer Pages (JSP) technology enables you to mix regular, static HTML with dynamically generated content from servlets. You simply write the regular HTML in the normal manner, using familiar Web-page-building tools. You then enclose the code for the dynamic parts in special tags, most of which start with <% and end with. Separating the static HTML from the dynamic content provides a number of benefits over servlets alone, and the approach used in JavaServer Pages offers several advantages over competing technologies such as ASP, PHP, or ColdFusion. Section 1.4  gives some details on these advantages, but they basically boil down to two facts: that JSP is widely supported and thus doesn?t lock you into a particular operating system or Web server and that JSP gives you full access to servlet and Java technology for the dynamic part, rather than requiring you to use an unfamiliar and weaker special- purpose language.
     
  5. The integrating servlet and JSP
    Servlets are great when your application requires a lot of real programming to accomplish its task. As you?ve seen elsewhere in the book, servlets can manipulate HTTP status codes and headers, use cookies, track sessions, save information between requests, compress pages, access databases, generate GIF images on-the-fly, and perform many other tasks flexibly and efficiently. But, generating HTML with servlets can be tedious and can yield a result that is hard to modify. That?s where JSP comes in; it lets you separate much of the presentation from the dynamic content. That way, you can write the HTML in the normal manner, even using HTML-specific tools and putting your Web content developers to work on your JSP documents. JSP expressions, scriptlets, and declarations let you insert simple Java code into the servlet that results from the JSP page, and directives let you control the overall layout of the page. For more complex requirements, you can wrap up Java code inside beans or define your own JSP tags.
      
  6. The including files and applets in JSP Documents
    JSP has three main capabilities for including external pieces into a JSP document. The include directive lets you reuse navigation bars, tables, and other elements in multiple pages. The included elements can contain JSP code and thus are inserted into the page before the page is translated into a servlet. This capability is discussed in Section 12.1. Although including external pieces that use JSP is a powerful capability, other times you would rather sacrifice some power for the convenience of  being able to change the included documents without updating the main JSP page. Although this book is primarily about server-side Java, client-side Java in the form of Web-embedded applets continues to play a role, especially within fast corporate intranets. The jsp:plugin element is used to insert applets that use the Java Plug-In into JSP pages.
     
  7. The Core Servlet and JSP Second edition
    Thorough guide to Web application development with JSP 2.0 and servlets 2.4. Detailed treatment of form processing, HTTP, cookies, session tracking, JDBC, beans, MVC, the JSP 2.0 expression language, and much more. Also gives detailed configuration and usage information for Apache Tomcat, Macromedia JRun, and Caucho Resin. 
     
  8. The Java Servlets programming Second Edition 
    The second edition of this popular book has been completely updated to add the new features of the Java Servlet API Version 2.2, and new chapters on servlet security and advanced communication. In addition to complete coverage of the 2.2 specification, we have included bonus material on the new 2.3 version of the specification.  Servlets are an exciting and important technology that ties Java to the Web, allowing programmers to write Java programs that create dynamic web content. Java Servlet Programming covers everything Java developers need to know to write effective servlets. It explains the servlet lifecycle, showing how to use servlets to maintain state information effortlessly. It also describes how to serve dynamic web content, including both HTML pages and multimedia data, and explores more advanced topics like integrated session tracking, efficient database connectivity.
     
  9. The Using Javabeans with JSP
    The JavaBeans API provides a standard format for Java classes. Visual manipulation tools and other programs can automatically discover information about classes that follow this format and can then create and manipulate the classes without the user having to explicitly write any code. Full coverage of JavaBeans is beyond the scope of this book. The one exception to this naming convention is with boolean properties: they use a method called is Xxx 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 . Although you can use JSP scriptlets or expressions to access arbitrary methods of a class, standard JSP actions for accessing beans can only make use of methods that use the getXxx/setXxx or isXxx/setXxx design pattern.
     
  10. The Servlet and JSP Filters
    Perhaps the single most important new capability in version 2.3 of the servlet API is the ability to define filters for servlets and JSP pages. Filters provide a powerful and standard alternative to the nonstandard ?servlet chaining? supported by some early servers. A filter is a program that runs on the server before the servlet or JSP page with which it is associated. A filter can be attached to one or more servlets or JSP pages and can examine the request information going into these resources. After doing so, it can choose among the following options.
    *  Invoke the resource in the normal manner.
    *  Invoke the resource with modified request information.
    *  Invoke the resource but modify the response before sending it to the client.
    *  Prevent the resource from being invoked and instead redirect to a different resource, return a particular status code, or generate replacement output.
     
  11. The Web Development with JSP
    The second edition of the bestselling Web Development with JavaServer Pages updates and expands the original. In the entirely rewritten first part of the book the authors provide a gentle introduction to the important technologies on which JSP depends. The book then launches into its updated coverage of the JSP 1.2 and Servlet 2.3 standards. New chapters on servlet filters, tag-library validation, and non-HTML content are filled with fresh examples.  This second edition shares the strengths of the first, based on the authors' substantial experience with real-world development. The book covers the complete feature set of JSP 1.2, and both the advantages and the "gotchas" associated with those features. Its depth of coverage has been an important contributor to this book's success.

 
Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 7, 2008

Ask Questions?    Discuss: Free JSP Books   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
pratiksha
August 11, 2011
getting input in database through jsp

i wants to know that how i take input from the user(a jsp page)and the info.of the user is stored in underlying database. plz help here i post code... <%-- Document : newjsp Created on : Aug 3, 2011, 4:38:00 PM Author : Administrator --%> <%@page contentType="text/html" pageEncoding="UTF-8" import="java.io.*" %> <%@page import="java.sql.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Registration</title> </head> <body> <form action="registration.jsp"> <h1 align="centre" onmouseclick= "E-Krishi Registration Form" > REGISTRATION FORM </h1> </br> </br> </br> </br> <table width="30%"> <tr> <th width="80%">First Name : </th> <td width="50%"> <input type="text" name="first_name" value="" size="20" /></td> </tr> </br> </br> <tr> <th width="50%">Last Name :</th> <td width="50%"> <input type="text" name="last_name" value="" size="20" /></td> </tr> </br> </br> <tr> <th width="50%">Login Name :</th> <td width="50%"> <input type="text" name="login_name" value="" size="20" />@Ekrishi.com</td> </tr> </br> </br> <tr> <th width="50%">Password:</th> <td width="50%"> <input type="password" name="passwrd" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Re-Enter Password : </th> <td width="50%"> <input type="password" name="re_enter_passwrd" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Security Question :</th> <td width="50%"> <select name="security_ques"> <option>what is your childhood friend name?</option> <option>what is your pet name?</option> <option>what is your favourite dish name?</option> <option>what is your first teacher name?</option> <option>what is your mother favourite dish?</option> </select></td> </tr> </br> </br> </br> <tr> <th width="50%"> Answer : </th> <td width="50%"> <input type="text" name="answer" value="" size="20" /> </td> </tr> </br> </br> </br> <tr> <th width="50%">Recovery E-mail address : </th> <td width="50%"><input type="text" name="recovery_e-mail_add" value="" size="20" /> </td> </tr> </br> </br> </br> <tr> <th width="50%">Profession :</th> <td width="50%"><select name="profession"> <option>FARMER</option> <option>WHOLESALER</option> <option>OTHERS</option> </select></td> </tr> </br> </br> </br> <tr> <th width="50%">State:</th> <td width="50%"><select name="location"> <option>Andhra Pradesh </option> <option>Arunachal Pradesh</option> <option>Assam</option> <option>Bihar</option> <option>Chhattisgarh</option> <option>Goa</option> <option>Gujarat</option> <option>Haryana</option> <option>Himachal Pradesh</option> <option>Jammu and Kashmir</option> <option>Jharkhand</option> <option>Karnataka</option> <option>Kerala</option> <option>Madhya Pradesh</option> <option>Maharashtra</option> <option>Manipur</option> <option>Mizoram</option> <option>Meghalaya</option> <option>Nagaland</option> <option>Orissa</option> <option>Punjab</option> <option>Rajasthan</option> <option>Sikkim</option> <option>Tamil Nadu</option> <option>Tripura </option> <option>Uttar Pradesh</option> <option>Uttarakhand</option> <option>West Bengal </option> </select></td> </tr> </br> </br> <tr> <th width="50%"> Location : </th> <td width="50%"><input type="text" name="location" value="" size="20" /> </td> </tr> </br> </br> <tr> <th width="50%">Contact Number :</th> <td width="50%"><input type="text" name="contact_no" value="" size="20" /> </tr> </br> </br> <tr> <th></th> <td width="50%"> <input type="submit" value="submit" name="reg_submit" /> </td> </tr> </table> <% Connection con; String url = "jdbc:odbc:krishi1"; String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; int sumcount = 0; Statement st; try { Class.forName(driver); } catch (ClassNotFoundException c) { c.printStackTrace(); } con = DriverManager.getConnection(url); PreparedStatement pstatement = null; st = con.createStatement(); int updateQuery = 0; String First_name = request.getParameter("First_name"); String Last_name = request.getParameter("Last_name"); String Login_name = request.getParameter("Login_name"); String Password = request.getParameter("Password"); String re_enter_password = request.getParameter("re_enter_password"); String security_ques = request.getParameter("security_ques"); String answer = request.getParameter("answer"); String recovery_email = request.getParameter("recovery_email"); String profession = request.getParameter("profession"); String state = request.getParameter("state"); String location = request.getParameter("location"); String contact_no = request.getParameter("contact_no"); // if (First_name != null && Last_name != null && Login_name!=null && Password != null && re_enter_password != null && security_ques != null && answer != null && recovery_email != null && profession != null && state != null && location != null && contact_no != null) { // if (First_name != "" && Last_name != "" && Login_name!="" && Password != "" && re_enter_password != "" && security_ques != "" && answer != "" && recovery_email != "" && profession != "" && state != "" && location != "" && contact_no != "") { try { String queryString = "insert into reg (fname,lname,Logname,password,rpassword,sques,ans,remail,profession,state,location,contact) values ('"+First_name+"','"+Last_name+"','"+Login_name+"','"+Password+"','"+re_enter_password+"','"+security_ques+"','"+answer+"','"+recovery_email+"','"+profession+"','"+state+"','"+location+"','"+contact_no+"')"; // ResultSet rs = st.executeQuery("insert into e-krishi_registration (First_name,Last_name,Login_name,Password,Re-enter password,Security question,Answer,Recovery email address,profession,State,Location,contact number) values (?,?,?,?,?,?,?,?,?,?,?,?)"); // ResultSet rs = st.executeUpdate(queryString); pstatement = con.prepareStatement(queryString); // pstatement.setString(1, First_name); // pstatement.setString(2, Last_name ); // pstatement.setString(3, Login_name); // pstatement.setString(4, Password); // pstatement.setString(5, re_enter_password); //pstatement.setString(6, security_ques); // pstatement.setString(7, answer); // pstatement.setString(8, recovery_email); //pstatement.setString(9, profession); //pstatement.setString(10, state); //pstatement.setString(11, location); //pstatement.setString(12, contact_no); updateQuery = pstatement.executeUpdate(); if (updateQuery != 0) { %> <br> <TABLE style="background-color: #E3E4FA;" WIDTH="30%" border="1"> <tr><th>Data is inserted successfully in database.</th></tr> </TABLE> <% } } catch (SQLException e) { e.printStackTrace(); } // }// // } %> </form> </body> </html> tell me where iam wrong... thankyou
nishant
September 8, 2011
jsp

i need jsp book
Reuben Gabolekane
September 26, 2011
i want to learn jsp, asking for a free JSP book

I will appreciate your assistance.
Manjit
February 17, 2012
Java

Likes site
rahul
August 31, 2012
reading

interesting explain of jsp
krishna joshi
January 9, 2014
JSP Ebook

Sir can you plz mail me the ebook of jsp.... I hope this book contains everything from basic about jsp programming with examples.......
DMCA.com