Rev 2047 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2028 | es | 1 | package pt.estgp.es.exemplos.hibernate.web.login; |
2 | |||
3 | import org.json.JSONException; |
||
4 | import org.json.JSONObject; |
||
5 | import pt.estgp.es.exemplos.hibernate.web.rest.AbstractRestServlet; |
||
6 | |||
7 | import javax.servlet.http.HttpServletRequest; |
||
8 | import javax.servlet.http.HttpServletResponse; |
||
9 | |||
10 | public class LoginRest extends AbstractRestServlet |
||
11 | { |
||
12 | public JSONObject login(JSONObject data, HttpServletRequest req, HttpServletResponse resp) throws JSONException |
||
13 | { |
||
14 | 1.5.0/docs/api/java/lang/String.html">String username = data.getString("username"); |
||
15 | 1.5.0/docs/api/java/lang/String.html">String password = data.getString("password"); |
||
16 | |||
17 | 1.5.0/docs/api/java/lang/System.html">System.out.println(username); |
||
18 | 1.5.0/docs/api/java/lang/System.html">System.out.println(password); |
||
19 | |||
20 | JSONObject js = new JSONObject(); |
||
21 | js.put("result","ok"); |
||
22 | |||
23 | return js; |
||
24 | } |
||
25 | } |