<HTML>
<HEAD>
<TITLE>Registration Form</TITLE>
<link rel="stylesheet" type="text/css" href="/Project/html/Style.css"/>
</HEAD>
<BODY>
<FORM METHOD="POST"
ACTION="AddData"
name="myform">
<H3>Choose and Insert GPSData:</H3>
<SELECT NAME = "gpsdata">
<OPTION>$GPRMC,194932.530,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*7A</OPTION>
<OPTION>$GPRMC,194934.530,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*7C</OPTION>
<OPTION>$GPRMC,194936.530,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*7E</OPTION>
<OPTION>$GPRMC,194938.529,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*78</OPTION>
<OPTION>$GPRMC,194940.529,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*77</OPTION>
<OPTION>$GPRMC,194942.528,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*74</OPTION>
<OPTION>$GPRMC,194944.528,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*72</OPTION>
<OPTION>$GPRMC,194946.528,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*70</OPTION>
<OPTION>$GPRMC,194948.527,A,5049.5330,N,00109.9218,W,0.00,131.16,170206,,,D*71</OPTION>
<OPTION>$GPRMC,194950.527,A,5049.5330,N,00109.9217,W,0.00,131.16,170206,,,D*77</OPTION>
<OPTION>$GPRMC,194952.527,A,5049.5329,N,00109.9217,W,0.00,131.16,170206,,,D*7D</OPTION>
<OPTION>$GPRMC,194954.526,A,5049.5329,N,00109.9217,W,0.00,131.16,170206,,,D*7A</OPTION>
<OPTION>$GPRMC,194956.526,A,5049.5329,N,00109.9217,W,0.00,131.16,170206,,,D*78</OPTION>
</SELECT>
<BR><INPUT TYPE="submit" value="Submit Form">
<INPUT TYPE="reset" value="Clear Form">
</FORM>
</BODY>
</HTML>
<?xml version = '1.0'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>Deployment Descriptor</display-name>
<description>Servlet Examples for EE557</description>
<servlet>
<servlet-name>AddData</servlet-name>
<servlet-class>com.project.controller.AddData</servlet-class>
</servlet>
<servlet>
<servlet-name>SelectTable</servlet-name>
<servlet-class>com.project.controller.SelectTable</servlet-class>
</servlet>
<servlet>
<servlet-name>ViewTable</servlet-name>
<servlet-class>com.project.controller.ViewTable</servlet-class>
</servlet>
</web-app>
package com.project.controller;
import java.io.*;
import java.util.Vector;
import javax.servlet.*;
import javax.servlet.http.*;
public class AddData extends HttpServlet {
private static final long serialVersionUID = 1L;
DBManager a = new DBManager();
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
String NMEAData = req.getParameter("gpsdata");
GPSData b = a.ParseData(NMEAData);
System.out.println(b.getLong_Dir());
a.Connect();
a.Insert(b);
a.Disconnect();
res.sendRedirect("/StudentRegistration/index.html");
//System.out.println(b.getLat());
}
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE