JSP Tutorials - Page2

JSP Tutorials page 2

JSP Tutorials - Page2

JSP Tutorials page 2

JSP Examples

  1. Hello World JSP Page
    By this example we are going to teach you that how can you write a "hello world" on your browser. Jsp can be learned very easily. This is just the beginning to learn this exciting language.
     
     
  2. The Page Directive in JSP Page
    This section illustrates you about the page directive of the JSP page which works for the entire JSP page. These directives apply different properties for the page like language support, page information and import etc.
      
  3. The extends Attribute of page Directive In JSP
     
  4. The import Attribute of page Directive In JSP
    This section shows you how to import a java package or the class in your jsp application.
     
  5. The session Attribute of page Directive In JSP
    This section provides you the best illustration of the session attribute of the page directive in JSP. This is the boolean attribute of the directive. It sets a boolean value either true or false.
      
  6. The buffer Attribute of page Directive In JSP
    This section just introduces about the buffer attribute of the page directive in JSP. This attribute sets the buffer size in kilobytes i.e. used by the out object to handle output generated by the JSP page on the client web browser.
      
  7. The autoFlush Attribute of page Directive In JSP
    This section illustrates you about the autoFlush attribute of the page directive in JSP. This is an boolean attribute. This attribute of the page directive supports for flushing buffer automatically when the buffer is full.
      
  8. The isThreadSafe Attribute of page Directive In JSP
    In this section, you will learn about a type of the attribute of the page directive in JSP as known as isThreadSafe attribute.
        
  9. The info Attribute of page Directive In JSP
    This section gives you the introduction about the info attribute of the page directive in JSP. This attribute simply sets the information of the JSP page which is retrieved later by using Servlet.getServletInfo() method.
     
  10. The errorPage Attribute of page Directive In JSP
    This section illustrates you about the errorPage attribute of the page directive in JSP. This attribute sets a url (relative path starting from the "/" which refers from the root directory of your JSP application).
     
  11. The contentType Attribute of page Directive In JSP
    This section gives you the best illustration about the contentType attribute of the page directive in JSP. This attribute specifies the MIME type and the character encoding i.e. used for the JSP response.
      
  12. The isErrorPage Attribute of page Directive In JSP
    This section provides the best illustration of the isErrorPage attribute of the page directive in JSP by providing three JSP pages and it's output. This is a boolean attribute of the page directive.
     
  13. The pageEncoding Attribute of page Directive In JSP
    This section provides the best illustration about the pageEncoding attribute of the page directive in JSP. This attribute specifies the language that the page uses when the page is sent to the browser. This attribute works like the meta tag of the HTML markup language.
     
  14. The isELIgnored Attribute of page Directive In JSP
      
  15. The Include Directive in JSP Page
    This section illustrates you about the include directive of the JSP. You will learn about what is include and how to implement it in the JSP page.
     
  16. How to create a form in JSP
    This section illustrates you about the procedure of the creation of a form through the HTML code in the JSP page. You can simply use the <form></form> tags for creating a from and save the file with the ".jsp" extension.
      
  17. How to handle a form in JSP
    This section teaches you about the creating a from and the procedure of handling the form through the JSP code. This section provides JSP code which used the HTML code for creating a form and this form is handled by the JSP code.
     
  18. Get Method of the Form In JSP
    This section provides you the best illustration of the get method of the form in JSP. The HTTP get method sends data to the server.
      
  19. Post Method of the Form In JSP
    This section provides you the best illustration of the post method of the form in JSP. The HTTP post method sends data to the server from the HTML form elements.
     
  20. What Is Tag Libray In JSP?
    This section provides you the detailed explanation of the Tag Library in JSP. In the Java Server Pages Technology, multiple actions are accessed by using the tags of the JSP whether the tag is standard tag of the JSP or the custom tag that is made by you.
     
  21. Declaring Tag Library In JSP 
    Tag libraries are declared by using the <%@taglib %> directive of the JSP. This tag has some own attributes and it's values are specified attributes specifically of the taglib directive.
      
  22. Request Object In JSP
    This section illustrates more about the JSP implicit object called Request object. This object retrieves values whatever client passes to the server by an HTTP request.
      
  23. getParameter() Method Of The Request Object
    This section illustrates you about the getParameter() method of the request object. This section provides you the best illustration for why the method used or how to use in your JSP application.
      
  24. getParameterNames() Method Of The Request Object
    This section gives you the detailed explanation about the getParameterNames() method of the request object. You will learn more about the procedure of using the getParameterNames() method of the request object.
      
  25. getParameterValues() Method Of The Request Object
    This section illustrates you about the getParameterValues() method of the request object. Here, you will learn more about the getParameterValues() method like what's the need of using the method in your JSP application.
      
  26. getCookies() Method Of The Request Object
      
  27. getQueryString() Method Of The Request Object
    This section describes the getQueryString() method of the request object. Here, you will learn more about the getQueryString() method of the request like what's the need of the method and how to implement it into your JSP application code.
      
  28. getRequestURI() Method Of The Request Object
    This section gives you the detailed explanation of the getRequestURI() method of the request object in JSP. This method is used for getting the information of the URI of the current page of your JSP application.
      
  29. getHeaderNames() Method Of The Request Object
    In this section, you will learn how to get the header name of the host server. This section gives you the brief introduction about the getHeaderNames() method of the request object.
      
  30. getHeader() Method Of The Request Object
    This section gives you the best illustration about the getHeader() method of the request object. Here, you will learn more about the getHeader() method like why is it used and how is it implemented.
     
  31. getAttribute() Method Of The Request Object
    This is the page for the illustration of the getAttribute() method of the request object in JSP. This method retrieves the values corresponding to the given attribute name that is set through the setAttribute() method of the request object.
      
  32. getAttributeNames() Method Of The Request Object
    This section provides you the detailed explanation of the getAttributeNames() method of the request object in JSP. Here, you will learn why this is used and how it is used in the JSP application.
      
  33. setAttribute() Method Of The Request Object
    This section gives you the best illustration about the setAttribute() method of the request object in JSP. This method sets the value of the attribute for the request.
      
  34. removeAttribute() Method Of The Request Object
    This section introduces for the method removeAttribute() of the request object. This method removes the attribute. This method takes a string type parameter i.e. the attribute name that has to be removed.
     
  35. Using  Uppercase To Lowercase Tags of JSTL
    In this section we will learn how to use <fn:toUpperCase> and  <fn:toLowerCase> Tag of JSTL. These tags are used to change case of specified string to upper or lower.
      
  36. Use of <fn:containsIgnoreCase(String, String)> Tag of JSTL
    In this section we will learn how to use <fn:containsIgnoreCase>  Tag of JSTL. This tag is used to check that given string contains the specified sub string or not.
      
  37. Use of <fn:endsWith(String, String)> Tag of JSTL
    In this section we will learn how to use <fn:endsWith>  Tag of JSTL. This tag is used to check that given string ends with the specified sub string or not.
      
  38. Use of <fn:startsWith(String, String)> Tag of JSTL
    In this section we will learn how to use <fn:startssWith>  Tag of JSTL. This tag is used to check that given string starts with the specified sub string or not. 
     
  39. Use of <fn:escapeXml(String)> Tag of JSTL
    In this section we will learn how to use <fn:escapeXml>  Tag of JSTL. This tag is used to escape characters that could be interpreted as XML markup.
      
  40. Use of <fn:indexOf(String, String)> Tag of JSTL
    In this section we will learn how to use <fn:indexOf> Tag of JSTL. This tag returns index of first occurrence of specified sub string in the given string string.
      
  41. Use of <fn:length(String)> Tag of JSTL
    In this section we will learn how to use <fn:length> Tag of JSTL. This tag returns the number of items in a collection, or the number of characters in a string.
       
  42. Use of <fn:replace(String, String, String)> Tag of JSTL
    In this section we will learn how to use <fn:replace> Tag of JSTL. This tag returns a string after replacing the given sub string with specified sub string.
      
  43. Use of <fn:split(String, String)> and <fn:join(String, String)> Tag of JSTL
    In this section we will learn how to use <fn:split>and <fn:join> Tag of JSTL. These tags are used to split and join the specified string according to the given delimeter.
     
  44. Use of <fn:subString(String, int, int)> Tag of JSTL   
    In this section we will learn how to use <fn:subString>  Tag of JSTL. This tag returns a subset of a string of specified length. This takes string and integer type as arguments and return string type.
         
  45. Use of <fn:substringBefore(String, String)> and <fn:subStringAfter(String, String)>JSTL Tag
    In this section we will learn how to use <fn:substringBefore> and <fn:substringAfter> Tag of JSTL.
      
  46. Use of <fn:trim(String)JSTL Tag
    In this section we will learn how to use <fn:trim> Tag of JSTL. This tag removes white spaces from both ends of specified string. This takes string type as arguments and return string type result.
     
     
  47. Response Object In JSP
     
  48. Display image on JSP page using XML
    In this tutorial we are going to know how we can display a image on JSP page by using XML. 
      
  49. Example of printing Text message passed from XML to JSP
    In this tutorial we are going to know how we can pass a text message from XML to JSP.  
      
  50. How to Make a Pdf and inserting data
    In this tutorial you will learn how we can make a pdf file and how we can insert a data into the pdf file. This all be done by using the jsp. 
      
  51. POST METHOD  
    In this example we are going to show how we can make use of the POST in the JSP. After going through this example you will better understand the concept of the POST.
      
  52. Retrieving Data From the XML file 
    In this example we will examine how to parse and expose XML information using the JAXP with a JSP page. This example is only geared towards showing how to construct a Java object from an XML document.
      
  53. JSP With Multiple Forms
    In  this example, you will learn how to make multiple forms in single jsp page. Most of the times people need to use multiple forms on a single page.
     
  54. Implementing JSP and embedding Windows Media Player(wmp)
    Embedding WMP (Windows Media Player) means that you have to attach an external component in your page so that you can play the audio and video files in your JSP page by giving the source path. This will make your JSP page interactive.
     
  55. Connect JSP with mysql
    In this example we will show you how to connect to MySQL database from your JSP code. First, you need to create database and then write jsp code to connect jsp to database.
      
  56. Connect from database using JSP Bean file
    Java Beans are reusable components. It is used to separate Business logic from the Presentation logic. JSP provides three basic tags for working with Beans.
      
  57. Implementing Bean with scriptlet in JSP
    We can use all of the JSP coding while using Java Beans in a JSP page. There are three main kinds of JSP scripting elements in JSP.
      
  58. BodyTagSupport Example
    BodyTagSupport class implements the BodyTag interface and you can add additional functionalities in it to set property of bodyContent. If you want to add other functionalities in this tag then there are some methods which you have to override.
     
  59. Use of Core XML tags in JSP
    Core XML tags provides access to XML data and used to parse these data. There are three tags in this Core XML tag set.
     
  60. XML Transformation in JSP
    This example illustrate use of XML transformation tag in JSP file. This example performs transformation from an XML file to XSLT stylesheet. XML transform tag performs transformation from XML file to XSLT file. 
      
  61. Using JSP in pure XML  generating conforming XHTML
    This JSP example describes how JSP tags for XML can be used in XML generation conforming  XHTML.
      
  62. How to use 'if' statement in jsp page?
    This is detailed java code that shows how to use 'if' statement in jsp page. This statement is used to test conditions. You can understand use of this statement by a real world example.
         
  63. Custom Tag example with no attribute and no body
    This example demonstrates how one can make custom tag in JSP that has no attribute and no body. There are only handful of tags in JSP which may not be sufficient for each and every working.
      
  64. How to use 'for' loop in jsp page?
    This is detailed java code that shows how to use 'for' loop in jsp page. 'if' statement is used to test conditions while 'for' loop is used to define a loop that reiterates statements.
      
  65. Request header display in a jsp page
    This is detailed jsp code that shows how to display request header information in a jsp page. When user request to the server, the request defines an object to provide client request information to a jsp.
     
  66. How to use 'continue' keyword in jsp page?
    This is detailed java code that shows how to use 'continue' keyword in jsp page. The continue statement skips the remaining statements in the body of the loop for the current iteration, and continues with the next iteration of the  same loop.
      
  67. Submit comments in database when user clicks on submit button
    This is detailed java code to show how to submit comments from a jsp page and insert it to the MySql database when user clicks the submit button of the page.
      
  68. Insert data in mysql database through jsp using prepared statement
    This is detailed jsp code that how to insert data into database by using prepared statement instead of statement. 
     
  69. How to work with POST method in jsp page
    This is detailed JSP code, how to use POST method instead of GET method in jsp page. GET is default method for sending the request to the server.
      
  70. Navigation in a database table through jsp
    This is detailed jsp code that shows how to navigate in database. This code shows one by one record of student from database on clicking a button labeled 'next record', so on each click of button application fetches next record from database, this is the navigation in database.
     
  71. Using Applet in JSP
    Applet is java program that can be embedded into HTML pages. Java applets runs on the java enables web browsers such as mozila and internet explorer.
     
  72. Execute SQL Queries with Java Application
    This is detailed java program to connect java application and execute queries like create table in mysql database, insert some values and retrieve values from the table.
     
  73. How to use email validation check through java script in jsp page
    This is detailed java code that explains how to use java script validator in jsp page. This validator checks for valid email given by the user. valid_email.jsp page has 'onSubmit' attribute, which is set to ValidateForm(), in the html 'form' element. 
     
  74. How to create and use custom error page in jsp
    This is detailed java code how to create and use custom error page in jsp and display an error message.
     
  75. Custom Iterator Tag in JSP
    This example will demonstrate you how you can make a custom iterator tag in JSP? You can make your own custom tag in JSP which will have functionality as you want to do with them.
      
  76. JSP forward
    This section illustrates you how you can use JSP forward action to forward to servlet.
      
  77. Scripting Variables in JSP Custom Tag
    Scripting variables are variables that are available to the JSP page when any JSP page is called. Scripting variables may be any scripting variables but when we are dealing in reference of JSP page we mean page level variables declared by the JSP page.
     
  78. Use Session to Track User in JSP
    Session tracking is a mechanism that is used 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. 
     
  79. How to use switch statement in jsp code
    switch is a type of control statement used to control the flow of program execution. Its body is known as a switch block. The block can have one or more case blocks which contains some statements to be executed when the case is selected.
      
  80. Use multiple catch statement in single jsp
    In java a single try can have multiple catch statements. The code bound by the try block need not always throw a single exception so we can use multiple catches or Exception class (base class of all exceptions). When exception occurs while executing any statement within try block, control enters into the catch blocks until it finds its matching block.
     
  81. How to use multiple declaration in jsp
    JSP provide two ways to declare variables or methods.
     
  82. Joins tables in jsp
    When we want to select data from two or more tables to make our result complete. We have to perform a join between tables. In this example we have two tables stu_info and stu_marks.
     
  83. Create a greeting in jsp
    This is sample jsp code that creates a sample Birthday Greeting in jsp. In the code given below we have used an image with some text message.
     
  84. Include Static HTML Page in JSP
    This example shows how to include static html page in jsp.
      
  85. To Upload and insert the CSV file into Database
    In this tutorial, you will learn how to upload a CSV file through JSP and insert it into the database. For this, we have created two jsp pages page.jsp and upload_page.jsp.
     
  86. Use while loop in jsp code
    While loop is a control flow statement that works repeatedly based on a given boolean condition, loop will continuously execute the statements given in the body as long as a given condition is true.
     
  87. JSP Directives and HTML tags
    JSP directives are as a message from a JSP page to the JSP container that control the processing of the entire page. JSP directives control how the JSP compiler generates the servlet.
     
  88. Declare tag methods in jsp
    JSP is a extended technology to the java servlet that allows to keep separate the dynamic part of your pages from the static HTML. In the code of web page HTML will be as it is but dynamic part is enclosed in special tag , most of which start with "<%" and end with "%>".
     
  89. Embed flash file in jsp page
    In this example, we will see how to embed a flash file in jsp page. In the example given below we have used HTML tag in jsp code to embed flash file.
     
  90. Create Data Grid in JSP page
    This is detailed code that how to create data grid that shows data from database table in jsp page. In this jsp code given below we have used a tag library that provide some tags to create data grid.
     

JSP Tutorials Pages: JSP Tutorials Page 1 | JSP Tutorials Page 2 | JSP Tutorials Page 3