<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld" 
	version="2.0">
<jsp:directive.page language="java" contentType="application/x-javascript; charset=UTF-8;"
 import="java.util.HashMap,java.util.Iterator" />
<jsp:scriptlet>
	<![CDATA[
		String key = request.getParameter( "key" );
		if( key != null && key.length() > 0 ){
			synchronized( session.toString().intern() ){
				HashMap<String,String> ecmap = (HashMap<String, String>)( session.getAttribute( key ) );
				if( ecmap != null){
					// Map取得直後にsession情報を削除 4.3.6.2 (2009/04/15)
					session.removeAttribute( key );
					Iterator<String> ecIte = ecmap.keySet().iterator();
					String mapKey;
					String mapVal;
					while ( ecIte.hasNext() ) {
						mapKey = ecIte.next();
						mapVal = ecmap.get( mapKey );
						// 改行はスペースに置換してしまう。
						mapVal = mapVal.replace( "\r", "" );
						mapVal = mapVal.replace( "\n", " " );
						// "は\"に変更
						mapVal = mapVal.replace( "\"", "\\\"");
						
						out.println( "EC_" + mapKey + " = \"" + mapVal + "\";");
					}
					response.setHeader("Cache-Control","max-age=0");
				}
			}
		}
	]]>
</jsp:scriptlet>

</jsp:root>