forked from mconf/mconf-mobile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobile.jsp
47 lines (45 loc) · 1.73 KB
/
mobile.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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
%>
<%@page import="org.apache.commons.httpclient.HttpClient"%>
<%@page import="org.apache.commons.httpclient.HttpMethod"%>
<%@page import="org.apache.commons.httpclient.methods.GetMethod"%>
<%@ include file="bbb_api.jsp"%>
<%
if (request.getParameterMap().isEmpty()) {
} else if (request.getParameter("action").equals("getMeetings")) {
String meetings = getMeetings();
%>
<%=meetings%>
<%
} else if (request.getParameter("action").equals("join")) {
String meetingID = request.getParameter("meetingID");
String fullName = request.getParameter("fullName");
String password = request.getParameter("password");
String joinUrl = getJoinMeetingURL(fullName, meetingID, password);
String enterUrl = BigBlueButtonURL + "api/enter";
String result = "<response><returncode>FAILED</returncode><message>Can't join the meeting</message></response>";
try {
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod(joinUrl);
client.executeMethod(method);
method.releaseConnection();
method = new GetMethod(enterUrl);
client.executeMethod(method);
result = method.getResponseBodyAsString();
method.releaseConnection();
} catch (Exception e) {
}
%>
<%=result%>
<%
} else if (request.getParameter("action").equals("create")) {
String meetingID = request.getParameter("meetingID");
String result = createMeeting(meetingID, "", "", "", 0, BigBlueButtonURL);
%>
<%=result%>
<%
}
%>