95-733 Internet Technologies Getting Started =============== Installation Lab ================ This lab is not to be turned in but needs to be completed as soon as possible. Contact your instructor or the TA if you are having difficulties. Part 1 Download and test. ========================= 0. Download and install the most recent version of Netbeans from http://www.netbeans.org/downloads/index.html. Choose the largest bundle. 1. Publish a simple Java Server Page (JSP). Create a Netbeans project called SuperSimpleJSPProject. Select the category as Java Web and the Project as Web Application. Enter this document in the editor. Call it index.jsp. Test it in a browser. <% java.util.Date d = new java.util.Date(); %> Today is <%= d.toString() %> Part 2 Test a servlet and an index.jsp page. ============================================ 0. Provide the HTML in a JSP page. In a new project, enter this document as index.jsp: Introductions
Please enter name

1. Create a servlet and give it the name HandleForm. Give it the URL pattern /ProcessForm. HandleForm.java is invoked by Glassfish when an HTTP request arrives. // HandleForm.java // An introductory servlet import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HandleForm extends HttpServlet{ public void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { String personName = req.getParameter("personName"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "\n"; out.println(docType + "\n" + "Hi" + personName + "\n" + "\n" + "

Hi"+ personName + "

\n" + ""); } } Part 3. Submission Guide ======================== Blackboard Submission Guide Visit http://www.cmu.edu/blackboard Upload your solution to the Assignment Section of blackboard. ================== 0. Your assignment will normally require that code be well documented. This means that every important section of code will have an explanation in English. Variable names will be well chosen and indentation will be used where appropriate. Of course, the author, date, and project description should always be included. 1. Go to NetBeans project folder (If you can't locate it, right-click on the project, go to 'Properties', select 'Sources' under 'Categories', look under 'Project Folder') 2. Zip up the entire folder. Include screenshots. Screenshots of a working solution make the grader's job much easier. It is always wise to have a happy grader. 3. Rename the file with your name and submit under the Assignments section in blackboard. For example, I might name the first part of project 1 as "mikemccarthyproject1part1.zip". 4. You may place several projects into a folder prior to zipping. You may load this folder directly via the "New project group using folder" feature of net beans. 5. If there are issues not covered by these directions (and there often will be) then use good judgement. Put yourself in the graders position and submit your work in a way that you feel would be easy to grade at scale. If doubts remain, contact your TA or ask your instructor. Guide to successful assignment submissions ========================================== * Never submit your assignments to the digital dropbox. Always submit the assignments in the designated Assignment folder under assignments. * Implement all the parts in an assignment question. * Never double or triple zip your assignment submissions. i.e for one project there should be only one zip and not zip files within zip files. This does not apply to files that are automatically zipped (such as .war files). * Regarding the one week optional extension, your first late submission will take off your one week even it was late by only a few seconds. Any late submission after the first time will lose 10% of grade every day. Hence if you submitted project 2 late by 2 days and project 4 by 5 days, you will use up the one week optional extension on project 2 and in project 5 you will lose 50% of our grade. * Any questions or complaints regarding the grading should reach the TA's within one week of receiving feedback from the TA. See the TA first and try to resolve the issue. If there is still a concern see your instructor without delay. * If you are having trouble with a particular problem, don't try to solve it. Instead, contrive a new, simpler problem and solve it instead. Then, look back at the original problem and attempt to solve it. Of course, you can only take this type of approach if you start early.