• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Lab work servlets and jsp

Lab work servlets and jsp



Lab work servlets and jsp

Lab work servlets and jsp



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Lab work servlets and jsp Lab work servlets and jsp Document Transcript

    • Labs work: Servlet & JSPExcercise 1Purpose : hello world applictionsHello World ServletServlet that produce nice HtmlHello World JSP :printing current date and time
    • Exercise-2Purpose: form processingCollecting three parametersJob entry formShow request header
    • Exercise-3Purpose :form processingCustomer RegistrationVote applicationExercise-4Purpose: Connection pooling jdbc programmingPurpose: Connection pooling jdbc programming using Listner for loading driver and stroing connectionStep1: create an mysql database exp121CREATE TABLE BOOKS( ISBN VARCHAR(20) NOT NULL , TITLE VARCHAR(70) NULL , AUTHOR VARCHAR(50) NULL , PRICE FLOAT NULL , PRIMARY KEY (ISBN));INSERT INTO books VALUES (123, JAVA, foo, 2500.00);INSERT INTO books VALUES (456, SOA, bar , 3000.00) ;Step2: create an html form
    • Step3: Put connection pooling information in context.xmlMention connection pooling infromation in web.xml of projectStep 4:create AddBookServlet.java servletNote: Don’t forget to put mysql connector jar in lib of tomcatExercise-5Purpose: Understanding Session MgtHttpSession Object Cookies UrlRewriting
    • Simplest shopping cart Cookies approach Url ReWriting approachExcercise 6Purpose: Understanding MVCAdd two no program using mvc
    • Book Advice Application Using MVCExample 3: Simple bank applicationExercise 7Purpose : Understanding FiltersFilter for basic securityExercise 8Purpose : understanding scriptlet, expression and decleration tagSimple login application
    • Exercise 9Purpose : understanding useBean tagsExcercise 10Purpose : Understanding EL and JSTLForcing scriptless jsp pagesDemo EL
    • Using database JSTLExcercise 12Simple Book Shopping cart applicationExercise 13Simple bank application
    • Excercise 11Purpose : Understanding Custom tagWhat if I want to print “I love india” ten times?What about this approach:-We need custom tag……….Steps: 1. Create tag class NameTagHandler ie extends SimpleTagSupport 2. Override doTag method accordingly 3. Create tld file ….Case study:Create an dynamic web application using servlet jsp such as book management system or employee mgt system etc.Application must use: 1. MVC 2 model 2. Connection pooling 3. Filter for securityScriptlet should not to be used at any cost,use JSTL and EL