-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.sai.servlet; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
|
||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.servlet.http.HttpSession; | ||
|
||
import org.json.simple.JSONObject; | ||
|
||
public class GetSession implements Action { | ||
|
||
@Override | ||
public String execute(HttpSession session, HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
response.setContentType("text/html;charset=UTF-8"); | ||
|
||
String sessId = (String) session.getAttribute("sessId"); | ||
String sessPw = (String) session.getAttribute("sessPw"); | ||
String sessName = (String) session.getAttribute("sessName"); | ||
String sessPhone = (String) session.getAttribute("sessPhone"); | ||
String sessStation = (String) session.getAttribute("sessStation"); | ||
|
||
JSONObject json = new JSONObject(); | ||
|
||
json.put("sessId", sessId); | ||
json.put("sessPw", sessPw); | ||
json.put("sessName", sessName); | ||
json.put("sessPhone", sessPhone); | ||
json.put("sessStation", sessStation); | ||
|
||
PrintWriter out = response.getWriter(); | ||
out.println(json); | ||
|
||
return null; | ||
} | ||
|
||
} |