fullstack

'session'에 해당되는 글 1건

  1. [JSP] Google App Engine에서 Session 사용시 Error

[JSP] Google App Engine에서 Session 사용시 Error

Web

Google App Engine에서 JSP를 할때 Session 사용시 다음과 같은 500 Server Error가 발생한다.



해당 프로젝트 폴더의 war - WEB-INF 경로에 있는 appengine-web.xml 을 보면 다음과 같은 주석을 볼 수 있다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <!--
    HTTP Sessions are disabled by default. To enable HTTP sessions specify:
      <sessions-enabled>true</sessions-enabled>
    It's possible to reduce request latency by configuring your application to
    asynchronously write HTTP session data to the datastore:
      <async-session-persistence enabled="true" />
    With this feature enabled, there is a very small chance your app will see
    stale session data. For details, see
    http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions
  -->



이는 App Engine에서는 기본적으로 Session을 비활성화 한다고 되어있는데, 이유는 쓸모없이 낭비하는 자원을 막기 위해서인것 같다.

위의 주석을 해제하거나 아래 구문을 추가해주면 이제 Session을 사용할 수 있다.


1
<sessions-enabled>true</sessions-enabled>