-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from 22hours/Server/Part_of_json
v1.2.8.2 (서버로그 구분자추가, msg와 powerOff Timer에러뜨는 것 해결)
- Loading branch information
Showing
12 changed files
with
417 additions
and
91 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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID"> | ||
<display-name>system_monitor_ver1.1</display-name> | ||
<welcome-file-list> | ||
<welcome-file>index.html</welcome-file> | ||
<welcome-file>index.htm</welcome-file> | ||
<welcome-file>index.jsp</welcome-file> | ||
<welcome-file>default.html</welcome-file> | ||
<welcome-file>default.htm</welcome-file> | ||
<welcome-file>default.jsp</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
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
11 changes: 11 additions & 0 deletions
11
dev/Server/src/main/java/com/hours22/system_monitor_ver11/Application.java
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 |
---|---|---|
@@ -1,13 +1,24 @@ | ||
package com.hours22.system_monitor_ver11; | ||
|
||
import java.nio.charset.Charset; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.http.converter.HttpMessageConverter; | ||
import org.springframework.http.converter.StringHttpMessageConverter; | ||
|
||
|
||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
@Bean | ||
public HttpMessageConverter<String> responseBodyConverter() { | ||
return new StringHttpMessageConverter(Charset.forName("UTF-8")); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
dev/Server/src/main/java/com/hours22/system_monitor_ver11/client/ClientInfoController.java
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,28 @@ | ||
package com.hours22.system_monitor_ver11.client; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.springframework.stereotype.Controller; | ||
|
||
@Controller | ||
public class ClientInfoController { | ||
public static String getClientIp(HttpServletRequest req) { | ||
String ip = req.getHeader("X-Forwarded-For"); | ||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | ||
ip = req.getHeader("Proxy-Client-IP"); | ||
} | ||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | ||
ip = req.getHeader("WL-Proxy-Client-IP"); | ||
} | ||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | ||
ip = req.getHeader("HTTP_CLIENT_IP"); | ||
} | ||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | ||
ip = req.getHeader("HTTP_X_FORWARDED_FOR"); | ||
} | ||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | ||
ip = req.getRemoteAddr(); | ||
} | ||
return ip; | ||
} | ||
} |
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
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
Oops, something went wrong.