SCWCD Exercises
SCWCD Exercises
Since these exercises are of the test your setup and deployment process variety, you probably want to do all of them, in order. See C:\Servlets+JSP\Exercise-Solutions\ for solutions.
1. 2.
Open the C:\Servlets+JSP\ directory and double-click the icon to start Tomcat. Verify that the server is running by opening http://localhost/ in your browser. Open http://volume1.coreservlets.com/archive/ in your browser (you probably want to bookmark the location), then right-click on Hello.html and Hello.jsp (Chapter 2) to download them to the C:\Servlets+JSP directory. It might be easier to use Firefox to download, because Internet Explorer sometimes adds .txt to the end of files whose file extensions it does not recognize (e.g., blah.jsp and Blah.java). Copy the files onto the shortcut to webapps/ROOT, then access them in the browser with http://localhost/Hello.html and http://localhost/Hello.jsp. Download HelloServlet.java into the C:\Servlets+JSP directory. Compile it using javac HelloServlet.java (DOS Window) or via Tools --> Compile Java from TextPad. Then, and copy the .class file to the shortcut to webapps/ROOT/WEB-INF/classes. Finally, check that the servlet is working by using the URL http://localhost/servlet/HelloServlet. Download HelloServlet2.java into the C:\Servlets+JSP\coreservlets directory. Compile it, then deploy by copying (not moving!) the entire coreservlets directory onto the shortcut to webapps/ROOT/WEB-INF/classes. One of the easiest ways to copy it is by using the right mouse to drag the coreservlets directory onto the shortcut and selecting Copy. Access it with http://localhost/servlet/coreservlets.HelloServlet2 Download HelloServlet3.java and ServletUtilities.java into the coreservlets directory. Compile HelloServlet3.java, deploy it, and access it in your browser. The only thing we know (yet!) related to the SCWCD exam is a little bit about the structure of Web apps. Look inside the ROOT folder and take note where HTML goes, JSP goes, class files go, and the web.xml file is located.
3.
4.
5. 6.
http://www.coreservlets.com
3. 4.
Create a servlet that uses a loop to output an HTML table with 25 rows and 3 columns. For instance, each row could contain RowX, Col1, RowX Col2, and RowX Col3, where X is the current row number. Create a subdirectory called servletBasics within C:\Servlets+JSP, put a simple servlet in it (be sure to have the package name correspond to the directory name), compile it, and copy the .class file to the appropriate location within the Tomcat directory. The easiest approach is to copy the entire servletBasics directory onto the shortcut to the WEB-INF\classes directory. For the rest of the week, I suggest you make a separate package/directory for each set of exercises. You do not need to use my ServletUtilities class, but if you want to, either copy ServletUtilities to the servletBasics directory and change package coreservlets to package yourPackage, or (better!) leave it in the coreservlets directory and add import coreservlets.* to whichever of your servlets uses ServletUtilities.
5.
If you have some previous servlet/JSP experience and want to try something we havent yet covered in detail in class, try making a custom Web application. See the short summary in the notes (but we will cover it in detail later). You dont need to start from scratch; you can start by copying and renaming the ROOT directory. For the SCWCD exam, make sure you know the method signature of doGet (which is the same as for doPost, doHead, and service). Make sure you know that init gets called only when the servlet is first loaded into the servers memory, and that there is only one servlet instance per URL: servlets do not get reinstantiated for each request.
6.
http://www.coreservlets.com
1.
Download ThreeParamsForm.html from the Core Servlets and JSP archive site and install it in tomcat_install_dir\webapps\ROOT. Load it by means of the URL http://localhost/ThreeParamsForm.html. Install the ThreeParams servlet and verify that you can send data to it from the form. Change the ThreeParams servlet to reside in your package/directory. Make appropriate changes to the form that sends data to it. Test it. Make a variation of the ThreeParams form and servlet that uses POST instead of GET. Use the ThreeParams form to send data to the ThreeParams servlet that contains HTML-specific characters. Verify that this can cause malformed results. Make a variation of the servlet that filters the strings before displaying them. Make a registration form that collects a first name, last name, and email address. Send the data to a servlet that displays it. Feel free to modify the ThreeParams HTML form and servlet to accomplish this. Next, modify the servlet to use a default value (or give an error message) if the user omits any of the three required parameters. [Hard; for the truly inspired.] Make a variation of the previous servlet and accompanying form, but, in this case, if the user fails to supply a value for any of the fields in the form, you should redisplay the form but with an error message saying that the value is missing. Dont make the user reenter values that theyve entered already. Hint: you have two main choices given the tools available to us so far: have one big servlet that generates both the HTML form and the results page (the form submits the data to itself), or two separate servlets (one that generates the HTML form and the other that generates the results page). There is an example of the first approach in the book. If you want to try the second approach, you might want to know about response.sendRedirect, which lets you redirect the browser to a specified page. For example, here is a doGet method that sends the user to www.whitehouse.gov:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect("http://www.whitehouse.gov/"); }
2. 3. 4. 5.
6.
7.
The SCWCD objectives are pretty vague about form processing. They just say you should know how to write code to retrieve HTML form parameters from the request. The most important thing in real life is to know getParameter and the fact that empty fields result in empty strings and missing params result in null. But for the exam, I would know getParameterNames, getParameterMap, getParameterValues, getReader, and getInputStream. You rarely use any of those, but still...
http://www.coreservlets.com
1.
Install the servlet that shows all request headers (ShowRequestHeaders). Access it from both Firefox and Internet Explorer. Remember that, since the servlet is in the coreservlets package, you have to install it in the coreservlets directory and use the URL http://hostname/servlet/coreservlets.ShowRequestHeaders. Make a tiny Web page that contains a hypertext link to the servlet that shows all request headers. What new header shows up that wasnt there previously? Remember that HTML documents (and images, JSP pages, etc.) go in tomcat-install-dir\webapps\ROOT. Write a servlet that just says Hello. Use a red background and a yellow foreground for Internet Explorer users; use a yellow background and a red foreground for Firefox and other non-IE users. If you are a bit rusty with HTML, you set colors as follows:
<BODY BGCOLOR="colorName" TEXT="colorName">
2.
3.
or
<BODY BGCOLOR="#RRGGBB" TEXT="#RRGGBB">
(where R, G, and B are hex values for the red, green and blue components. I.e., #FF00FF is magenta -- 255 for red, 0 for green, and 255 for blue).
4.
Some informational sites want users to access pages in a certain order. They want to prohibit users from jumping directly to a bookmarked page later in the sequence because the data on the pages may have changed since the user bookmarked the page. Create two pages. The first page should have a link to the second page. If a user accesses the first page and then follows the link to the second page, it works normally. But, if the user directly types in the address of the second page (or follows a link from a page with a different name than the first page), they should get sent back to the first page automatically. Hints: - Use response.sendRedirect (as on previous exercise) to send users back to page1 - It is not necessary to make page1 be a servlet.
5.
All the SCWCD exam objectives say is that you have to know how to retrieve HTTP request header information. In real life, getHeader and the need to check for null are the important things. But I would also memorize the names of the methods on page 7 of the slides.
http://www.coreservlets.com
4.
Amazingly, the SCWCD exam objectives do not explicitly mention status codes anywhere. Presumably they are lumped under the HTTP response. At the very least, you should know 200, 301, 302, 404, 403 (covered later), setStatus, sendRedirect, and sendError. Another section mentions the need to understand multithreading problems and race conditions, so make sure you know the issues with instance variables.
http://www.coreservlets.com
5.
http://www.coreservlets.com
Exercises: Cookies
1.
In a previous problem, you had two pages. You used the Referer header to force users to get to page 2 by following a link from page 1. Now, suppose that it is not necessary to always go to page 1 before page 2; you just want to make sure that users have been to page 1 at least once before they are allowed to visit page 2. For example, page 1 might be a page that introduces the site and gives some legal disclaimers, and users are required to visit that page at least once before they can see the second page. Create two pages. If a user visits page 2 before having ever visited page 1, they should get redirected to page 1. Note: some people find this problem easier if they manually delete cookies between tests. To do this in IE 5/6, start at the Tools menu, then select Internet Options, General, and Delete Cookies.With Firefox, click on Tools, then Options, then Privacy, then Cookies youll have various options from there.
2.
Write a servlet that displays the values of the firstName, lastName, and emailAddress request parameters. If a parameter is missing and the client is a first-time visitor, have the servlet list Unknown for the missing values. If a parameter is missing and the client is a repeat visitor, have the servlet use previously-entered values for the missing values. Make a small page that displays some simple information of your choosing. Make another page that lets users choose the foreground and background color that they want the first page to use. For example, if users never visit the the color choice page, the main informational page should use default colors of your choosing. But if a user visits the color choice page and chooses a yellow background and red foreground, all subsequent visits to the main page by that user should result in red on yellow. There is no need to vet the colors; you can accept whatever color values the user gives you. If you are a bit rusty with HTML, you set colors as follows: <BODY BGCOLOR="colorName" TEXT="colorName"> or <BODY BGCOLOR="#RRGGBB" TEXT="#RRGGBB"> (where R, G, and B are hex values for the red, green and blue components. I.e., #FF00FF is magenta -- 255 for red, 0 for green, and 255 for blue).
3.
http://www.coreservlets.com
5.
6.
http://www.coreservlets.com
2.
3.
http://www.coreservlets.com
5.
The SCWCD exam objectives have an entire section on session tracking. Know how sessions get created and destroyed, know the methods on pages 14 and 15 of the slides, and know what URL rewriting entails. The objectives also state you have to know that session values that implement HttpSessionActivationListener are notified when session values move from one VM to another in a cluster.
http://www.coreservlets.com
4.
http://www.coreservlets.com
2. 3. 4.
http://www.coreservlets.com
2. 3.
Make an Excel spreadsheet with a random number of rows. The java.math package has a class called BigInteger that lets you create whole numbers with an arbitrary number of digits. Create a JSP page that makes a large BigInteger from a String you supply as a request parameter, squares it, and prints out the result. Use the online API at http://java.sun.com/j2se/1.5.0/docs/api/ to see the syntax for the BigInteger constructor and squaring operations. Make a JSP page that sleeps for 20 seconds before returning the page. (Call Thread.sleep from inside a try/catch block that catches InterruptedException). Access it simultaneously from Firefox and Internet Explorer. Repeat the experiment with the JSP page not allowing concurrent access. Verify the slower result.
4.
http://www.coreservlets.com
6.
[Just for fun.] Download the ComputeSpeed and SpeedError pages from the archive site. Access the ComputeSpeed page with numeric values for the furlongs and fortnights form parameters attached to the end of the URL. (See page 366 if you want more detail). Now, supply a non-numeric value for one of the parameters. Next, supply a legal number for furlongs, but 0 for fortnights. Can you explain the unexpected result you get? The SCWCD exam objectives say that you have to know the following page directive attributes: import, session, contentType, and isELIgnored (we will cover this one later). It does not mention buffer, errorPage, isErrorPage, extends, or isThreadSafe. Go figure!
7.
http://www.coreservlets.com
4.
Make two separate JSP pages that have bulleted lists containing random integers in a certain range. Avoid repeating code unnecessarily by including a page that defines a randomInt method.
http://www.coreservlets.com
Inclusion, Continued
5.
If you are familiar with applets, make a trivial one that does nothing but set the background color to blue and print a string derived from the MESSAGE parameter embedded in the HTML by means of a PARAM element. Convert it to a version that uses the Java Plug-In. Note that, if this runs at all, it proves that you are correctly accessing the Plug-In. You dont need to use Swing or Java2D to verify that you are using the Plug-In, since the tag generated by jsp:plugin is incompatible with the standard virtual machine used by Firefox and IE. Try both Firefox and Internet Explorer to see which (if any) of them has the Plug-In installed. Reminder: applets run on the client, not on the server. So your applets .class files cant go in the servers WEBINF/classes directory. These .class files work the same way as for regular applets: they go in the same directory as the JSP/HTML file that uses the applet tag. The one exception is if the applets are in a package, in which case they go in a subdirectory (matching the package name) of the directory that contains the JSP file. Again, this is nothing specific to JSP, but is just the normal way applets work. The SCWCD exam objectives state Given a specific design goal for including a JSP segment in another page, write the JSP code that uses the most appropriate inclusion mechanism (the include directive or the jsp:include standard action). Gulp! I hope the exam authors understand the serious maintenance problems with the include directive, and that the scenarios where it is appropriate on the exam are only the scenarios where jsp:include wouldnt work at all (as with the included page defining a variable that the main page accesses). Make sure you understand the table on page 11 of the slides.
6.
http://www.coreservlets.com
Exercises: Beans
For these exercises, avoid any Java code in the JSP pages.
1.
Define a class called ColorBean that stores strings representing a foreground color and a background color. Compile and test it separately (i.e., without using a servlet or JSP page). Note: if your tester class (i.e., the one that has public static void main(String[] args) {...} in it) is in a package, remember that you have to use the package name when you run it from the command line. That is, you have to do javac BeanTester.java and then java yourPackage.BeanTester. Make a color preference form that collects the users preferred foreground and background colors. Send the data to a JSP page that displays some message using those colors. This JSP page should use a default value for any form value that the user fails to supply (but dont worry about empty strings). So, for example, if the user goes directly to the JSP page (bypassing the form), the JSP page should still work fine. For now, dont worry about the user sending you whitespace; just handle totally missing values. Redo the color preference example, but if the user fails to supply either of the colors, use whatever value they gave last time. If you have no previous value, use a default. (Hint: this problem is almost exactly the same difficulty as the previous one.) Redo the color preference example, but if the user fails to supply any of the parameters, use whatever color the most recent user gave last time. Why could this give bad results? Fix problem #2 so that it also handles whitespace. Do so without adding any explicit Java code to the JSP page. The SCWCD exam objectives state you have to know jsp:useBean (and the id, scope, class, and type attributes -- we will cover type in the next section), jsp:setProperty (presumably with all the options discussed in the notes, although they dont say), jsp:getProperty (again, presumably with all attributes, although they dont say), and jsp:param. Another section mentions the need to understand multithreading problems and race conditions, so make sure you know the issues with application-scoped data.
2.
3. 4. 5. 6.
http://www.coreservlets.com
5.
6.
http://www.coreservlets.com
http://www.coreservlets.com
2. 3.
Put a servlet in your Web app and access it. Dont use the invoker servlet (i.e., http:// localhost/webappName/servlet/ServletName). Instead, use a URL that is explicitly registered in web.xml (i.e., http://localhost/webappName/anything). Deploy a second Web app, but use a WAR file this time. If you want to use Java to make the WAR file, open a DOS window, go into the top-level of an existing Web app, and say jar -cvf someName.war *. You can also use WinZip or the Windows XP create compressed folder R-mouse option to make a file called someName.war. Either way, keep the original copy of someName.war in C:\Servlets+JSP. To deploy someName.war, copy it to tomcat_dir/webapps (there is a shortcut in C:\Servlets+JSP), and use the URL http://localhost/someName/.... Try to share data between your Web apps by means of the servlet context. Will the default Tomcat setting let you do this? Make a servlet that creates a cookie. Be sure to set the path appropriately. Make another servlet (or a JSP page) that displays the cookie value. Copy the cookie-displaying program to another Web application and verify that you can see cookies that were created in the first Web app. For the SCWCD exam, you have to know the Web app structure thoroughly. It says you must know how to Construct the file and directory structure of a Web Application that may contain (a) static content [top-level dir or any non-special subdirectory], (b) JSP pages [usually same as (a) but remember JSP pages under WEB-INF for MVC], (c) servlet classes [WEB-INF/classes/subdirMatchingPackage, unless in JAR file], (d) the deployment descriptor [WEB-INF/web.xml], (e) tag libraries [Java classes in normal places; tag files in WEB-INF/tags; TLD files under WEB-INF; covered in later lecture], (d) JAR files [WEB-INF/lib], and (e) Java class files [same as servlet classes mentioned in (c)]; and describe how to protect resource files from HTTP access [put under WEB-INF or use security constraint].
http://www.coreservlets.com
4. 5.
6.
Exercises: web.xml
1.
Make a blank Web application (the easiest way is to copy and rename the app-blank Web app). Copy the servlet your wrote for the previous exercise, give it a custom address in web.xml, and access it using that address.
For the remaining problems, you are the CTO of Enroff, a company that is so popular that other big companies keep buying you out for higher-and-higher prices. Thats the good news. The bad news: the company name keeps changing, making you keep changing your home page.
2. 3. 4. 5. 6. 7. 8.
Make a servlet that reads the company name from an initialization parameter and then uses it in the same page. Repeat problem 2 (using an init parameter), but use a JSP page instead of a servlet. Make sure that this JSP page is displayed if the user requests http://host/yourCompany/, with no filename specified. Turn off the invoker servlet (if you made your own Web app from scratch), or verify that the invoker servlet is already disabled (if you started with app-blank). Have a servlet read the company name from an init parameter, store it in the servlet context, and use it in the servlets output. Have two JSP pages that use the same company name, but dont have the JSP pages re-read the init parameter. Be sure nothing bad happens if someone tries to access the above JSP pages before the above servlet that sets the company name. Make a servlet or JSP page that reads a request parameter and prints a message saying if that value is a substring of the current company name. If the request parameter is missing, display a designated page that is not accessible directly (i.e., there is no URL that the client can supply that directly yields the error page). Dont use any try/ catch blocks or explicit checks for null. The SCWCD exam objectives simply state you must know the semantics of the deployment descriptor. Aaargh. It doesnt say which of the zillions of options you have to know. Id suggest being very familiar with the main ones (servlet, servletmapping, welcome-file-list, and the ones that will show up later for security, filters, and listeners), and skim the others.
9.
http://www.coreservlets.com
1. 2. 3. 4.
Create a JSP page that can be accessed only by registered users or administrators. Use form-based authentication. Repeat the above, but with BASIC authentication. Hint: just copy your Web application, give it a different name, and make one change to the web.xml file. Back to the first Web app (the one that uses form-based authentication): create a servlet that is also accessible only to registered users and administrators. Make a color preference form that collects the users preferred foreground and background colors. Send it to a page that presents some information using those colors. Use the MVC approach, and make sure the resource is accessible only to registered users and administrators. For the SCWCD exam, unfortunately you have to memorize all the login-config, security-constraint, and security role elements and sub-elements. Borrrrrring. Make sure you also know the j_security_check, j_username, and j_password names. You do not need to know anything about the Tomcat-specific user/role/password file.
5.
http://www.coreservlets.com
3. 4.
http://www.coreservlets.com
Exercises: Filters
1. 2.
Download the ReportFilter. Apply it to at least one servlet and at least one JSP page. Check the Tomcat window to verify that it is reporting accesses to those pages. Make a filter that prints a report saying whether or not the user accessing the designated resource is already logged in as an administrator. Test it by applying it to resources from the previous exercise. (Hint: just copy/rename the Web app that supported form-based security, and add in the filter.)7 The name of your CEO keeps changing, but it is already embedded in several pages. Make a filter that updates those pages. Dont hardcode the names into the filter itself. Make a filter that turns the entire page (HTML tags and all) into lower case. Dont worry about whether or not this results in legal HTML (e.g., changing case of the DOCTYPE line is not legal, but you dont have to worry about that). Make a filter that removes all BLINK tags from the resources to which it is applied. Note: the replaceAll method can be used to replace all occurrences of a given substring (regular expression, actually) by another substring. For example, "foobarbazfoobarbaz".replaceAll("foo", "Test"); returns "TestbarbazTestbarbaz" Prepend the first argument with "(?i)" for a case-insensitive replacement.
3. 4. 5.
6.
The SCWCD exam objectives say or imply that you have to know all the methods in the Filter interface, the filter and filter-mapping web.xml elements, and the HttpServletResponseWrapper idea.
http://www.coreservlets.com
Exercises: Listeners
1.
Redo the JSP page that displays the company name. Have it read the company name from a servlet context attribute, and use a listener to set up the attribute. Have the listener also store the current value of the company stock, and display that value in the JSP page. Create a way for an authorized user in the executive role to change the company name. Arrange it so that, whenever the company name changes, the stock value increases by 25%. Make a listener that keeps track of how many sessions are currently active. Make a servlet or JSP page that displays the value.
2. 3. 4. 5.
Create an HTML or JSP page that lets the user put Wonkas Wonder Widget in their shopping cart (thats the only item your site is selling). Use session tracking to show the user how many of these widgets are in their shopping cart you dont have to handle the actual purchase, just the tracking of how many items each person has reserved. One wrinkle, though: if there are more than 20 active sessions, dont let new users create sessions: return an error message instead. Give users a log out of session button to simplify your testing. (Hint: in basic session tracking, you call request.getSession() (equivalent to request.getSession(true)), where the true indicates that the system should make a session if it cannot find a preexisting session for that client. If you call request.getSession(false), the system returns an existing session if it finds it, and returns null otherwise.).
Listeners are boring. I admit it. In real life, I hardly ever see anyone use a listener except for a ServletContextListener with contextIntialized. Sadly, however, for the SCWCD exam, you better memorize the class and method names of all of them.
6.
http://www.coreservlets.com
3.
4. 5.
Redo the previous three tags with JSP 2.0 tag files. The SCWCD exam objectives have two full sections that refer to tag libraries. You have to know Java-based tags, tag files, and (unfortunately!) the older (classic) version of the Java-based tags. You will probably never use the older version of the Java-based tags, so just skim that part. But, even though classic tags are not important in most real apps, tags in general are very important. So, the rest of the effort in learning tags is well worth it, SCWCD exam or no SCWCD exam.
http://www.coreservlets.com
Exercises: JSTL
1. 2. 3. 4.
Make a JSP page that creates a list of 13 random numbers. Use a simple JSP expression for each individual random number: <%= Math.random() %>. Create a servlet that stores a bean containing an array of names, then forwards to a JSP page using RequestDispatcher. In the destination JSP page, loop down the array and put them into a bulleted list. Repeat problem #2 with an ArrayList (or LinkedList or Vector) and HashMap. Create a servlet that stores a bean with two arrays: one with first names and one with the corresponding last names. Have your JSP page make an HTML table with first names in the left table cell and last names in the right table cell. Assume that the arrays have exactly five elements. Create a servlet that makes an array of Name objects, which have firstName and lastName properties. Repeat the HTML table, but this time you dont need to know how many entries you have in the array. Use the JSP 2.0 expression language as well as JSTL. Repeat #4, but if the first name is Marty, add (Monty) between the first and last names. Repeat #4, but If the first name is Marty, replace it with Monty instead. If the first name is Bill, use Microsoft instead. If the first name is Scott, use Sun instead. If the first name is Larry, use Oracle instead. In real life, the looping tags are very important. The conditional evaluation tags are slightly important. The others are virtually useless. However, the SCWCD exam objectives merely say Given a design goal, use an appropriate JSP Standard Tag Library tag.
5.
6. 7.
8.
http://www.coreservlets.com
Student Survey
1.
Please rate the following from 1 (poor) to 5 (great): Instructor:______ Topics:______ Handouts:______ Exercises:______ Book:______ Facilities:______ Overall:______
2.
What are your general comments on the course? (I might quote you, but I wont use your name).
3.
4.
http://www.coreservlets.com