-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdegree.jsp
52 lines (47 loc) · 1.85 KB
/
degree.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<%@page import="support.*, java.util.*, gradstudent.*" %>
<html>
<head>
<link rel="stylesheet" href="css/bootstrap.css" type="text/css">
</head>
<body>
<div class="container" style="margin-top:20px">
<div class="row-fluid">
<div class="span12">
<%
// grab old info
GradStudent student = (GradStudent) application.getAttribute("student");
// set new info
student.setAddress(request.getParameter("streetNumber"), request.getParameter("streetName"), request.getParameter("city"), request.getParameter("zipcode"), request.getParameter("areaCode"), request.getParameter("phoneNumber"));
// record new info
application.setAttribute("student", student);
%>
<%-- display old info --%>
<h1>Welcome <%= student.getFirstName() %> <%= student.getLastName() %>!<br></h1>
citizenship: <%= student.getCitizenship() %><br>
residence: <%= student.getResidence() %><br>
address: <%= student.getAddress().getStreetNumber() %> <%= student.getAddress().getStreetName() %> <Br>
<%= student.getAddress().getCity() %>, <%= student.getAddress().getZipcode() %><br>
(<%= student.getAddress().getAreaCode() %>) <%= student.getAddress().getPhoneNumber() %><br>
<%-- gather new info --%>
<%
support s = new support();
Vector universities = s.getUniversities(config.getServletContext().getRealPath("universities.txt"));
%>
<%
for (int i=0; i<universities.size(); i++){
//each entry in the universities vector is a tuple with the first entry being the country/state
//and the second entry being a vector of the universities as String's
Vector tuple = (Vector)universities.get(i);
String state = (String)tuple.get(0);
out.println("<br>"+state+"<br>");
Vector u = (Vector)tuple.get(1);
for(int j=0; j<u.size(); j++){%>
<%=u.get(j)%><br>
<%}
}
%>
</div>
</div>
</div>
</body>
</html>