Download presentation
Presentation is loading. Please wait.
Published byElfrieda Heath Modified over 9 years ago
1
1 Web Programming with Servlets & JSP ASSIGNMENT GUIDELINE
2
Objectives Assignment Guideline 1 Assignment Guideline 2 Assignment Guideline 3 Assignment Guideline 4 Assignment Guideline 5 Assignment Guideline 6 Assignment Guideline 7 Assignment Guideline 8 2 Assignment Guideline 9 Assignment Guideline 10 Assignment Guideline 11 Assignment Guideline 12 Assignment Guideline 13 Assignment Guideline 14 Assignment Guideline 15
3
Assignment Guideline 1 3
4
Assignment Guideline 2 4 Using methods Remote Host: request.getRemoteHost() Remote Port: request.getRemotePort() Request URI: request.getRequestURI() Server name: request.getServerName() Server port: request.getServerPort()
5
Assignment Guideline 3 – 1 5 Building 2 servlets InputServlet includes the form and inputted controls DisplayServlet presents the inputted value
6
Assignment Guideline 3 – 2 6 301 (Moved Permanently) Requested document permanently moved elsewhere (indicated in Location header). Browsers go to new location automatically Hints: Using setStatus and setHeader as following response.setStatus(301); response.setHeader( "Location", "http://localhost:8084/AssM3/MovePermanently.html" ); response.setHeader(“Connection”, “close”); Using sendError with the same status code
7
Assignment Guideline 4 – 1 7 Building 2 servlets CookiesServlet includes the form and inputted controls depending on the checking cookies result WelcomeServlet checking the user in cookies to show welcome message and add the cookie if the new user is
8
Assignment Guideline 4 – 2 8 Building a servlet Session Tracking applies the HttpSession interface methods and Session technologies to view above GUI
9
Assignment Guideline 5 9 Building html file same as the left above image Building 2 servlet First Servlet Using the getParameter method of request object Then using the setAttribute and getRequestDispatch methods of ServletContext Interface to store the parameter and forward the Second Servlet Second Servlet: retrieve the object using the getAttribute method, then print it
10
Assignment Guideline 6_1 10 Building a servlet uses the “Basic” header and Base64Decoder to checking username and password from users The results should be presented as above images
11
Assignment Guideline 6_2 11
12
Assignment Guideline 6_2 (cont) 12
13
Assignment Guideline 6_2 (cont) 13 Creating a html file with form including 3 text box (name, age, address), and a button Submit Building a CheckingServlet uses validation the inputted information Do not allow null with name and age fields The age value must be a numeric and larger than 18 The Welcome message will be present with the link transfer to the protect resource (test.html in admin directory) Configuring the web deployment descriptor to the BASIC authentication with role as manager, users The test.html file only present the message The results should be presented as above images
14
Assignment Guideline 7 14 Creating a index.jsp file present the current Date applying the Calendar and Date package of java.util library Creating a second.jsp file includes the image control which gets the image from the images directory at your web page directory
15
Assignment Guideline 8_1 15 Creating a index.jsp file present header using (reference request object in chapter 2) request.getHeaderNames () request.getHeader() request.getHeaders
16
Assignment Guideline 8_2 16 Creating 02 index.jsp page First, the Login form with action the process.jsp Second, the process.jsp file is implemented the session mechanism with cookies same as the chapter 4 The results are similar to the above images
17
Assignment Guideline 9_1 17 Creating a JavaBean named AmountBean include the amount property with int data-type and the DISCOUNT is 30% Creating includeForward.jsp file are the form with textbox and button, and applying the AmountBean to calculate the returned amount after the user submit Creating the products.jsp file using jsp:include applying the includeForward.jsp file Creating the forward.jsp file using jsp:forward applying the products.jsp file. The forward.jsp file is the default page of application
18
Assignment Guideline 9_2 18 Creating first.jsp file using request.setAttribute with value of “user” attribute is “Aptechie” and using jsp:forward to the second.jsp file The second.jsp file uses jsp:include the lastPage.html file and present the value of “user” attribute to the browser The lastPage.html presents the message This is the last page of this WebSite The results of program should be same as the image
19
Assignment Guideline 10_1 19 Creating the JSP page using The Arithmetic Operations The Logic Operations The header – EL Implicit Object with the “User-Agent” value The Result must be same as the image
20
Assignment Guideline 10_2 20 Creating the JSP page using The param – EL Implicit Object to process the inputted value Applying the addition series calculation for Total Amount The Result must be same as the image
21
Assignment Guideline 11_1 21 Creating the JSP page using Declaring the String array with form of each elements as productName:price Using c:forEach, c:forTokens, and c:out to traverse and print each element of array as above image
22
Assignment Guideline 11_2 22 Creating the JSP page using Declaring the String array with form of each elements as destinationName:price Building the form with a textbox and a button Using c:forEach, c:forTokens, c:if, c:set, and c:out to traverse, checking the existing destination and print as above image
23
Assignment Guideline 12_1 23 Creating the I18N in Servlets as the above image using Servlets Should reference the steps in Workshop. However, convert the reference code to the servlet
24
Assignment Guideline 12_2 24 Creating the JSP page using I18N and formatting Tag library to do the exercise (using format setLocale, formatNumer and Decision making tag library to present the result)
25
Assignment Guideline 13 25 Do it again the workshop 3 of Chapter 13 in CD with construct if Cond Then Else
26
Assignment Guideline 14 26 Do it again the workshop 2 of Chapter 13 in CD that creating the custom Tag with upper case all the body content using BodyTagSupport Class
27
Assignment Guideline 15 27 Building 03 tag files and a JSP file can do Upper case all the body content in tag The heading row with 6 columns (6 attributes) The column row with 5 inputted column, and the 6 th column averaged from 3 last column and format as a images (using JSTL tag lib) The JSP file is contains the combination of 3 above tags same as the image
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.