please follow the steps and make sure you do the Optional

I’m stuck on a Computer Science question and need an explanation.

  1. You will be working towards Project 2 part 1 that is posted in Assignments section. You need to complete the two JSP files where you see the ######## markings. You also will complete #1, #2, and attempt #3 in the file.
  1. This lab will involve the following new features:
    1. REST web service.

  1. First go to C:Program FilesApache Software FoundationTomcat 8.5 … and change the security settings on the “webapps” folder to allow full control to users as we’ve done before.
  2. Unzip the zip file into your tomcat “webapps” folder.
    1. Your path should then be:
      1. C:Program FilesApache Software FoundationTomcat 8.5webappsdronerecon
        1. Inside the dronerecon folder, you should then have your JSPs, WEB-INF folder, etc. that are all included in the zip file.
      2. NOTE: You may have a different version than 8.5 above for your path.
  1. You will fill in code where you see the ######## markings in the following files:
    2. In the zip file:
      1. drone_launch.jsp
      2. drone_sim.jsp
  2. If you’ve properly updated the JSP files…
    1. You should be able to go to the following when Tomcat is running:
    2. After entering info and submitting, then you should see a grid printed with the proper number of cols and rows that you entered on the drone_sim.jsp page.
  3. For editing…
    1. Create a new java project (if using NetBeans, choose a “class library” type of project) because you will be eventually creating a JAR file when done to deploy to Tomcat.
    2. In the src folder in your project, create a folder structure of comdronereconws, or you can create a new package by right clicking on src if using IntelliJ and entering in – you will see this already at the top of the file:


This represents the folder structure in your src folder.

  1. Put the java file that is on the Assignments page for Project 2 into the ws folder.
  2. It should appear in your IDE project.
  1. In the java file, edit and complete #1 and #2, and then try to make an attempt at #3, but if you don’t complete it properly, that’s okay! And don’t worry about #4 unless you want to try to get it all working before next class. We will finish this file in class next time.
  2. OPTIONAL: If you do happen to finish the file and want to see if you can get it to work, then you would…
    1. Add the servlet api jar from tomcat to your project library by doing this:
      1. IntelliJ: Look back at the posted instructions from Week 11’s module.
      2. NetBeans IDE: Right click the “Libraries” folder in your NetBeans project and choose “Add JAR/Folder”, and then navigate to your Tomcat folder in the lib folder and choose “servlet-api.jar”.
    2. Build this project so that a JAR file is created.
      1. IntelliJ: Same instruction file from Week 11’s module.
    3. And then you would put this JAR file in your dronereconWEB-INFlib folder.
    4. (HINT: if you’re going to take on this then the JSON string you build has to be returned correctly, and to include quotes as part of your string you have to escape it, which just means a before the quote like this … String sExample = “this quote ” is ignored as an ending java quote mark because of the slash”;)
  1. Turn in the above 3 files (2 JSPs and 1 java file) into your lab 10 assignment spot in Canvas.
  2. IMPORTANT: DO NOT ZIP your folders/files please.