001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.hayabusa.taglib;
017    
018    import static org.opengion.fukurou.util.StringUtil.nval;
019    
020    import java.io.IOException;
021    import java.io.ObjectInputStream;
022    import java.io.ObjectOutputStream;
023    
024    import javax.mail.internet.MimeUtility;
025    import javax.servlet.ServletException;
026    import javax.servlet.http.HttpServletRequest;
027    import javax.servlet.http.HttpServletResponse;
028    
029    import org.opengion.fukurou.util.LogWriter;
030    import org.opengion.fukurou.util.StringUtil;
031    import org.opengion.fukurou.util.XHTMLTag;
032    import org.opengion.hayabusa.common.HybsSystem;
033    import org.opengion.hayabusa.common.HybsSystemException;
034    import org.opengion.hayabusa.db.DBTableModel;
035    import org.opengion.hayabusa.resource.GUIInfo;
036    
037    /**
038     * 制御を別の画面にフォワードするå?合に使用するタグでã�?通常は、entry.jsp で使用しまã�?ã€?
039     *
040     * フォワード時に、指定ã?引数をセãƒ?ƒˆできますã?
041     *
042     * @og.formSample
043     * ●形式ï¼?lt;og:forward page="…" gamenId="[…]" />
044     * ●body?šなã�?
045     *
046     * ●Tag定義??
047     *   <og:forward
048     *       gamenId            【TAG】gamenId 属æ?を登録しまã�?
049     *       page             ○ã?TAG】転送å?URLを指定しまã�?å¿??)ã€?
050     *       keys               【TAG】キーã‚?CSV 形式でセãƒ?ƒˆしまã�?
051     *       vals               【TAG】キーに対応するå?ã‚?CSV 形式でセãƒ?ƒˆしまã�?
052     *       dbkeys             【TAG】DBキーをCSV 形式でセãƒ?ƒˆしまã�?
053     *       scope              【TAG】キャãƒ?‚·ュする場合ã?スコープ[request/page/session/applicaton]を指定しまã�?初期値:session)
054     *       useRedirect        【TAG】response.sendRedirect するかどã�?�‹[true/false]を指定しまã�?初期値:false)
055     *       target             【TAG】サブミãƒ?ƒˆ先ã?æ–?›¸を表示させるフレーãƒ??またã?ウィンドウの名前を指定しまã�?
056     *       filename           【TAG】ファイル転送時にファイル名ã?別名をæŒ?®šしまã�?初期値:null)
057     *       noTransition       【TAGã€?通常は使ã�?�¾せん)画面遷移を行わなã�?½¢式ã?登録方法を使用するかをæŒ?®šしまã�?
058     *       useAjaxSubmit      【TAGã€?通常は使ã�?�¾せん)ajaxを利用したsubmitを利用するかどã�?�‹を指定しまã�?
059     *       redirectEncode     【TAGã€?通常は使ã�?�¾せん)useRedirect=true時に 日本語を含ã‚?»¢送å?(page)をバイナリ変換するときã?コード名[UTF-8/Windows-31J]など(初期値:null)
060     *       debug              【TAG】デバッグæƒ??をå?力するかどã�?�‹[true/false]を指定しまã�?初期値:false)
061     *   />
062     *
063     * ●使用ä¾?
064     *       <og:forward
065     *          page          = "転送å?URLを指定しまã�?å¿??)ã€?
066     *          dbkeys        = "DBキーをCSV 形式でセãƒ?ƒˆしますã?"
067     *          keys          = "キーã‚?CSV 形式でセãƒ?ƒˆしますã?"
068     *          vals          = "キーに対応するå?ã‚?CSV 形式でセãƒ?ƒˆしますã?"
069     *          scope         = "キャãƒ?‚·ュする場合ã?スコーãƒ?request,page,session,applicaton)を指定しまã�?初期値:session)ã€?
070     *          gamenId       = "gamenId 属æ?を登録しますã?"
071     *          useRedirect   = "useRedirect 属æ?を登録しますã?"
072     *          filename      = "ファイル転送時にファイル名をæŒ?®šするå?合に設定しますã?"
073     *          target        = "taregt 属æ?を登録しますã?"
074     *          noTransition  = "実際にforwardせずに、id="forwardUrl"属æ?のbody部åˆ?�«遷移先ã?URLをå?力しますã?(画面遷移なしモード時に使用しまã�?"
075     *       />
076     *
077     * @og.group 画面制御
078     *
079     * @version  4.0
080     * @author       Kazuhiko Hasegawa
081     * @since    JDK5.0,
082     */
083    public class ForwardTag extends CommonTagSupport {
084            //* こã?プログラãƒ??VERSIONæ–?­—å?を設定しますã?       {@value} */
085            private static final String VERSION = "5.6.5.0 (2013/06/07)" ;
086    
087            private static final long serialVersionUID = 565020130607L ;
088    
089            private transient DBTableModel  table   = null;
090            private String          tableId         = HybsSystem.TBL_MDL_KEY;
091            private String          page            = null;
092            private String          keys            = null;
093            private String          dbkeys          = null;
094            private String[]        vals            = null;
095            private String          gamenId         = null;         // 3.5.4.9 (2004/02/25) 追åŠ?
096            private boolean         useRedirect = false;    // 3.5.6.6 (2004/08/23) 追åŠ?
097            private String          target          = null;         // 3.8.0.4 (2005/08/08) 追åŠ?
098            private String          filename        = null;         // 4.0.0 (2005/11/30) 追åŠ?
099            private static final String             disposition = "inline"; // 固å®?
100            private boolean         noTransition= false;    // 4.3.3.0 (2008/10/01) 追åŠ?
101            private boolean         useAjaxSubmit           = false;        // 4.3.8.0 (2009/08/01) 追åŠ?
102    //      private boolean         useEncodeRedirect       = true;         // 5.6.5.0 (2013/06/07) 追åŠ??即å»?­¢
103            private String          redirectEncode  = null;                 // 5.6.5.0 (2013/06/07) 追åŠ?
104    
105            /**
106             * Taglibの終äº?‚¿グが見つかったときに処ç�?�™ã‚?doEndTag() ã‚?オーバã?ライドしますã?
107             *
108             * @og.rev 2.1.0.0 (2002/10/11) 戻りå?の先é?の "?" を追åŠ?�—なã�?‚ˆã�?�«変更ã€?
109             * @og.rev 3.0.1.3 (2003/03/11) 直接転送したå?合ã?整合æ?を取る為の対応ã?
110             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()で呼ぶã€?
111             * @og.rev 3.1.2.0 (2003/04/07) ソースコード中の固定å?をã?定義ファイルを使用するように変更するã€?
112             * @og.rev 3.5.4.9 (2004/02/25) gamenId を指定して、フォワードできるようにしますã?
113             * @og.rev 3.5.6.6 (2004/08/23) useRedirect 属æ?を追åŠ?�—ますã?
114             * @og.rev 4.3.3.0 (2008/10/01) noTransition 属æ?を追åŠ?�—ますã?
115             * @og.rev 4.3.7.1 (2009/06/08) target属æ?に絶対パス及ã?"_"で始まる予ç´?ªžをæŒ?®šできるようにしますã?
116             * @og.rev 4.3.8.0 (2009/08/01) useAjaxSubmit対応ã?noTransition値取得メソãƒ?ƒ‰名変更
117             * @og.rev 5.0.0.4 (2009/10/01) 画面遷移なし登録で戻った際にæœ?µ‚行が選択されるバグを修正
118             * @og.rev 5.1.3.0 (2010/02/01) noTransition、ajaxSubmitのコントロールは、requestで行うã€?
119             * @og.rev 5.1.6.0 (2010/05/01) IE以外ã?、MIMEエンコードするã?(RFC2231に従う)
120             * @og.rev 5.1.7.0 (2010/06/01) 画面IDをパラメーターに付加するã€?
121             * @og.rev 5.1.7.0 (2010/06/01) 遷移先がJSP以外ã?場合ã?、フォワードã?ージのキャãƒ?‚·ュをしなã�??
122             * @og.rev 5.1.8.0 (2010/07/01) httpが指定されてã�?�Ÿ場合に、è?身の画面IDが付加されるバグを修正
123             * @og.rev 5.3.8.0 (2011/08/01) ファイル名指定でIEの場合ã?URLエンコードすると途中でåˆ?‚Œるたã‚?IE7のバグ)、Shift_JIS(WIndows-31J)で直接æŒ?®šするã?
124             * @og.rev 5.6.5.0 (2013/06/07) redirectEncode 属æ?を追åŠ?�—ますã?
125             *
126             * @return      後続å?ç�??æŒ?¤º
127             */
128            @Override
129            public int doEndTag() {
130                    debugPrint();           // 4.0.0 (2005/02/28)
131                    // noTransition = isNoTransitionRequest() || noTransition; // 4.3.3.0 (2008/10/01) 追åŠ?
132    //              noTransition = isNoTransitionSession() || noTransition; // 4.3.8.0 (2009/08/01) メソãƒ?ƒ‰名変更
133    //              useAjaxSubmit    = isAjaxSubmitSession() || useAjaxSubmit; // 4.3.8.0 (2009/08/01) 追åŠ?
134                    noTransition = isNoTransitionRequest(); // 5.1.3.0 (2010/02/01)
135                    useAjaxSubmit = isAjaxSubmitRequest(); // 5.1.3.0 (2010/02/01)
136    
137                    String urlEnc = getUrlEncode();
138                    String fwdUrl = makeGamenLink();                // 3.5.4.9 (2004/02/25)
139    
140                    HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
141                    try {
142                            String url = response.encodeRedirectURL( fwdUrl );      // 3.5.4.9 (2004/02/25)
143    
144                            if( filename != null ) {
145                                    // 5.1.6.0 (2010/05/01) IE以外ã?、MIMEエンコードするã?(RFC2231に従う)
146                                    if( ( (HttpServletRequest)pageContext.getRequest() ).getHeader( "User-Agent" ).indexOf( "MSIE" ) == -1 ) {
147                                            filename = MimeUtility.encodeWord( filename, "UTF-8", "B" );
148                                    }
149                                    else {
150                                            // 5.3.8.0 (2011/08/01) IEの場合ã?URLエンコードすると途中でåˆ?‚Œるたã‚?IE7のバグ)、Shift_JIS(WIndows-31J)で直接æŒ?®šするã?
151    //                                      filename = StringUtil.urlEncode( filename );
152                                            filename = new String( filename.getBytes("Windows-31J"), "ISO-8859-1" );
153                                    }
154                                    (response).setHeader( "Content-Disposition",disposition + "; filename=\"" + filename + "\"" );
155                            }
156                            // 5.1.7.0 (2010/06/01) 画面IDをパラメーターに付加するã€?
157                            // 5.1.8.0 (2010/07/01) httpが指定されてã�?�Ÿ場合に、è?身の画面IDが付加されるバグを修正
158                            else {
159    //                              if( page.endsWith( ".jsp" ) ) {
160                                    if( !page.startsWith( "http" ) && page.endsWith( ".jsp" ) ) {
161                                            if( keys == null || keys.length() == 0 || ( "," + keys + "," ).indexOf( ",GAMENID," ) < 0 ) {
162                                                    if( gamenId != null && gamenId.length() > 0 ) {
163                                                            url = XHTMLTag.addUrlEncode( url, "GAMENID=" + gamenId );
164                                                    }
165                                                    // useRedirect=trueでGAMENIDを指定せずã?../GF9100/index.jsp等と書かれてã�?‚‹場合ã?対å¿?
166                                                    else if( !useRedirect ) {
167                                                            url = XHTMLTag.addUrlEncode( url, "GAMENID=" + getGUIInfoAttri( "KEY" ) );
168                                                    }
169                                            }
170                                    }
171                            }
172    
173                            // 3.5.6.6 (2004/08/23) useRedirect 属æ?を追åŠ?
174                            String url2 = XHTMLTag.addUrlEncode( url , urlEnc );
175                            // 4.3.3.0 (2008/10/01) 追åŠ?
176                            // if( noTransition ) {
177                            if( noTransition || useAjaxSubmit ) { // 4.3.8.0 (2009/08/01) useAjaxSubmitと共用
178                                    // 5.0.0.4 (2009/10/01)
179                                    if( noTransition ) {
180                                            int selRow = nval( getRequestValue( "SEL_ROW" ),-1 );
181                                            if( selRow > 0 ) {
182                                                    url2 = XHTMLTag.addUrlEncode( url2, "SEL_ROW=" + selRow );
183                                            }
184                                    }
185                                    jspPrint( "<div id=\"noTransitionUrl\">" + url2 + "</div>" );
186                                    jspPrint( "<div id=\"noTransitionTarget\">" + target + "</div>" );
187                            }
188                            // 3.8.0.4 (2005/08/08) target 属æ?を追åŠ?�—ますã?
189    //                      else if( target != null ) {
190                            else if( target != null && target.length() > 0 ) {
191                                    // 4.3.7.1 (2009/06/08)
192                                    String src = null;
193                                    if( target.startsWith( "_b" ) ) { // "_blank"
194                                            src = "window.open(\"" + url2 + "\", \"_blank\") ";
195                                    }
196                                    else {
197                                            String frameTop = "";
198                                            if( target.indexOf('.') < 0 ) { frameTop = "top."; }
199                                            src = frameTop + target + ".location.href=\"" + url2 + "\"" + HybsSystem.CR;
200                                    }
201    //                              String script = "<script language=\"JavaScript\" ><!-- " + HybsSystem.CR
202                                    String script = "<script type=\"text/javascript\" ><!-- " + HybsSystem.CR
203                                                                    + src + HybsSystem.CR
204                                                            + "// --></script>" ;
205                                    jspPrint( script );
206                            }
207                            else if( useRedirect ) {
208                                    // 5.6.5.0 (2013/06/07) redirectEncode 属æ?追åŠ?
209                                    if( redirectEncode != null ) {
210                                            url2 = new String( url2.getBytes( redirectEncode ), "ISO-8859-1" );
211                                    }
212                                    response.sendRedirect( url2  );
213                            }
214                            else {
215                                    pageContext.forward( url2 );
216                            }
217                    } catch(IOException ex) {
218                            String errMsg = "フォワーãƒ?リãƒ?‚¤レクトでIOエラーが発生しましたã€?
219                                                                    + HybsSystem.CR
220                                                                    + fwdUrl + "?" + urlEnc ;
221                            throw new HybsSystemException( errMsg,ex );             // 3.5.5.4 (2004/04/15) 引数の並びé ?¤‰更
222                    } catch( ServletException ex) {
223                            String errMsg = "フォワーãƒ?リãƒ?‚¤レクトでServletエラーが発生しましたã€?
224                                                                    + HybsSystem.CR
225                                                                    + fwdUrl + "?" + urlEnc ;
226                            throw new HybsSystemException( errMsg,ex );             // 3.5.5.4 (2004/04/15) 引数の並びé ?¤‰更
227                    }
228    
229                    // 3.0.1.3 (2003/03/11) forward で直接転送したå?合ã?整合æ?を取る為の対応ã?
230                    // 5.1.7.0 (2010/06/01) 遷移先がJSP以外ã?場合ã?、フォワードã?ージのキャãƒ?‚·ュをしなã�??
231                    if( fwdUrl != null && fwdUrl.endsWith( ".jsp" ) ) {
232                            setSessionAttribute( HybsSystem.FORWARD_PAGE_KEY, fwdUrl );     // 3.5.4.9 (2004/02/25)
233                    }
234    
235                    return(SKIP_PAGE);              // ペã?ジの残りの処ç�?‚’行わなã�??
236            }
237    
238            /**
239             * タグリブオブジェクトをリリースしますã?
240             * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
241             *
242             * @og.rev 2.0.0.4 (2002/09/27) カスタãƒ?‚¿グの release() メソãƒ?ƒ‰をã?追åŠ?
243             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()で呼ぶã€?
244             * @og.rev 3.5.4.9 (2004/02/25) 画面ID属æ?(gamenId)を追åŠ?
245             * @og.rev 3.8.5.0 (2006/03/06) filename 属æ?を追åŠ?�—ますã?
246             * @og.rev 4.3.3.0 (2008/10/01) noTransition 属æ?を追åŠ?�—ますã?
247             * @og.rev 5.6.5.0 (2013/06/07) redirectEncode 属æ?を追åŠ?�—ますã?
248             *
249             */
250            @Override
251            protected void release2() {
252                    super.release2();
253                    tableId         = HybsSystem.TBL_MDL_KEY;
254                    page            = null;
255                    keys            = null;
256                    dbkeys          = null;
257                    vals            = null;
258                    table           = null;
259                    gamenId         = null;
260                    useRedirect = false;    // 3.5.6.6 (2004/08/23) 追åŠ?
261                    target          = null;         // 3.8.0.4 (2005/08/08) 追åŠ?
262                    filename        = null;
263                    noTransition= false;    // 4.3.3.0 (2008/10/01) 追åŠ?
264                    useAjaxSubmit           = false;        // 4.3.8.0 (2009/08/01) 追åŠ?
265                    redirectEncode  = null;                 // 5.6.5.0 (2013/06/07) 追åŠ?
266            }
267    
268            /**
269             * keys 属æ? をå?に、requestæƒ??より values の値を取り込ã‚??
270             *
271             * keys属æ?は キーæƒ??がカンマ区åˆ?‚Šになってã�?‚‹為,ばらして
272             * values属æ?の配å?にä¸?�¤づつ設定してã�?��ますã?
273             *
274             * @og.rev 3.1.7.0 (2003/05/02) 戻るã?タン用のBACK_GAMENID をã?引数に追åŠ?�—ますã?
275             * @og.rev 3.1.8.0 (2003/05/16) 戻るã?タン用のBACK_GAMENID の自動登録をå»?­¢しますã?
276             * @og.rev 4.0.0.0 (2005/01/31) getParameterRows() を使用するように変更
277             *
278             * @return      URLエンコードされたæ–?­—å?
279             */
280            private String getUrlEncode() {
281                    String[] dbkey = StringUtil.csv2Array( dbkeys );
282                    String[] key   = StringUtil.csv2Array( keys );
283    
284    //              int dbCount = (dbkey != null) ? dbkey.length : 0 ;
285    //              int count   = (key   != null) ? key.length   : 0 ;
286                    int dbCount = dbkey.length;
287                    int count   = key.length  ;
288    
289                    String[] allKey = new String[ dbCount + count ];
290                    String[] allval = new String[ dbCount + count ];
291    
292                    int[] rowNo = getParameterRows();               // 4.0.0 (2005/01/31)
293                    if( dbCount > 0 && dbkey[0] != null && dbkey[0].length() > 0 && rowNo.length > 0 ) {
294                            table = (DBTableModel)getObject( tableId );
295                            if( table != null ) {
296                                    for( int i=0; i<dbCount; i++ ) {
297                                            allKey[i] = dbkey[i];
298                                            allval[i] = table.getValue(rowNo[0],table.getColumnNo( dbkey[i] ));
299                                    }
300                            }
301                    }
302    
303                    if( count > 0 ) {
304                            for( int i=0; i<count; i++ ) {
305                                    allKey[i+dbCount] = key[i];
306                                    allval[i+dbCount] = vals[i];
307                            }
308                    }
309    
310                    return XHTMLTag.urlEncode( allKey,allval );
311            }
312    
313            /**
314             * 【TAG】転送å?URLを指定しますã?
315             *
316             * @og.tag 転送å?URLを指定しますã?
317             *
318             * @param       url 転送å?URL
319             */
320            public void setPage( final String url ) {
321                    page = getRequestParameter( url );
322            }
323    
324            /**
325             * 【TAG】DBキーをCSV 形式でセãƒ?ƒˆしますã?
326             *
327             * @og.tag
328             * URI の引数にセãƒ?ƒˆするキーã‚?CSV 形式でセãƒ?ƒˆしますã?
329             * ここのæŒ?®šã?,DBTableModel 上ã?ãƒ??タを取り込みますã?
330             *
331             * @param       key DBキー(CSV 形å¼?
332             */
333            public void setDbkeys( final String key ) {
334                    dbkeys = getRequestParameter( key ) ;
335            }
336    
337            /**
338             * 【TAG】キーã‚?CSV 形式でセãƒ?ƒˆしますã?
339             *
340             * @og.tag
341             * URI の引数にセãƒ?ƒˆするキーã‚?CSV 形式でセãƒ?ƒˆしますã?
342             *
343             * @param       key キー(CSV 形å¼?
344             */
345            public void setKeys( final String key ) {
346                    keys = getRequestParameter( key ) ;
347            }
348    
349            /**
350             * 【TAG】キーに対応するå?ã‚?CSV 形式でセãƒ?ƒˆしますã?
351             *
352             * @og.tag
353             * URI の引数にセãƒ?ƒˆする値ã‚?CSV 形式でセãƒ?ƒˆしますã?
354             * åˆ?§£方法ã?、CSV変数をå?にåˆ?§£してから、getRequestParameter で値を取得しますã?
355             * こうしなã�?�¨ãƒ??タ自身にカンマを持ってã�?‚‹場合にåˆ?§£をミスる為ですã?
356             *
357             * @og.rev 3.5.6.2 (2004/07/05) CommonTagSupport#getCSVParameter を使用
358             *
359             * @param       val 値(CSV 形å¼?
360             */
361            public void setVals( final String val ) {
362                    vals = getCSVParameter( val );
363    
364                    // 先にåˆ?§£しなã�?�¨ãƒ??タ自身にカンマを持ってã�?‚‹場合にåˆ?§£をミスるã?
365            }
366    
367            /**
368             * 画面?©?¤とpage から、フォワードするU?²?¬を作æ?しますã?
369             * page ã�?null の場合ã?、index.jsp に転送されますã?
370             *
371             * @og.rev 3.5.4.9 (2004/02/25) 新規追åŠ?
372             * @og.rev 3.5.5.0 (2004/03/12) URLを求めるã?に、GUIInfo#getRealAddress() を使用するã€?
373             * @og.rev 4.0.0.0 (2005/01/31) GUIInfoの実アドレスのパラメータをè?慮するã€?
374             *
375             * @return      フォワードするU?²?¬(転送å?URL)
376             */
377            private String makeGamenLink() {
378                    if( page == null ) { page = "index.jsp"; }
379    
380                    if( gamenId == null || gamenId.length() == 0 ) { return page; }
381    
382                    GUIInfo guiInfo = getGUIInfo( gamenId );
383                    if( guiInfo == null ) { // 見つからなã�??合ã?、転送しなã�?
384                            LogWriter.log( "Forward[" + gamenId + "]先にはアクセス不可ですã?" );
385                            return page;
386                    }
387    
388                    String address = guiInfo.getRealAddress( page );
389                    String link = getRequestParameter( address );
390    
391                    // Ver 4.0.0 (2007/06/12) gamenId を使用する場合ã?、useRedirect = true をセãƒ?ƒˆ
392                    useRedirect = true;
393                    return link;
394            }
395    
396            /**
397             * 【TAG】gamenId 属æ?を登録しますã?
398             *
399             * @og.tag
400             * gamenId 属æ?は、画面IDをキーに、実アドレスを求めるã?に使用しますã?
401             * 画面IDが指定された場合ã?、実アドレスに変換する。指定されなã�??合ã?ã€?
402             * page 属æ?をそのままリãƒ?‚¤レクトアドレスとしますã?
403             * gamenId を指定したå?合ã?、このuseRedirect属æ?に関係なくã?Redirect されますã?
404             *
405             * @og.rev 3.5.4.9 (2004/02/25) 新規追åŠ?
406             *
407             * @param   id gamenId 属æ?
408             * @see         #setUseRedirect( String )
409             */
410            public void setGamenId( final String id ) {
411                    gamenId = nval( getRequestParameter( id ),gamenId );
412            }
413    
414            /**
415             * 【TAG】response.sendRedirect するかどã�?�‹[true/false]を指定しまã�?初期値:false)ã€?
416             *
417             * @og.tag
418             * useRedirect 属æ?は、URLの転送方式をæŒ?®šできますã?
419             * 通常は、pageContext.forward しますが、この属æ?に true ã‚?
420             * 設定すると、response.sendRedirect しますã?
421             * gamenId を指定したå?合ã?、この属æ?に関係なくã?Redirect されますã?
422             * 初期値は、false (forward) ですã?
423             *
424             * @og.rev 3.5.6.6 (2004/08/23) 新規追åŠ?
425             *
426             * @param   flag useRedirect 属æ? [false:forwrd/true:redirect]
427             * @see         #setGamenId( String )
428             */
429            public void setUseRedirect( final String flag ) {
430                    useRedirect = nval( getRequestParameter( flag ),useRedirect );
431            }
432    
433            /**
434             * 【TAG】サブミãƒ?ƒˆ先ã?æ–?›¸を表示させるフレーãƒ??またã?ウィンドウの名前を指定しますã?
435             *
436             * @og.tag サブミãƒ?ƒˆ先ã?フレーãƒ?��(ターゲãƒ?ƒˆ属æ?)を設定しますã?
437             *
438             * @og.rev 3.8.0.4 (2005/08/08) 新規追åŠ?
439             *
440             * @param       flag サブミãƒ?ƒˆ先ã?æ–?›¸のフレーãƒ?��(ターゲãƒ?ƒˆ属æ?)
441             */
442            public void setTarget( final String flag ) {
443                    target = nval( getRequestParameter( flag ),target );
444            }
445    
446            /**
447             * 【TAG】ファイル転送時にファイル名ã?別名をæŒ?®šしまã�?初期値:null)ã€?
448             *
449             * @og.tag
450             * ファイルを転送するå?合に、オープンさせるファイル名をæŒ?®šしますã?
451             * æŒ?®šしなã�??合ã?、フォラード前に呼び出されたアドレスがそのまま使用されますã?
452             *
453             * @param   name ファイルå�?
454             */
455            public void setFilename( final String name ) {
456                    filename = nval( getRequestParameter( name ),filename );
457            }
458    
459            /**
460             * 【TAGã€?通常は使ã�?�¾せん)画面遷移を行わなã�?½¢式ã?登録方法を使用するかをæŒ?®šしますã?
461             *
462             * @og.tag
463             * 画面遷移なしã?登録を行うかどã�?�‹を指定しますã?
464             * trueが指定された場合ã?forwardタグでは、実際の画面遷移は行わずに、forward先ã?
465             * URLã‚?div id="noTransitionUrl">[URL]</div>の形でHTMLとして出力し、JavaScript側で
466             * 実際の画面遷移を発生させますã?target属æ?は<div id="noTransitionTarget">[TARGET]</div>で
467             * 出力されますã?
468             *
469             * こã?値は、og:headタグで設定å?、またã?前画面からの値を継承するためã€??常、この属æ?ではセãƒ?ƒˆしませんã€?
470             *
471             * @og.rev 4.3.3.0 (2008/10/01) 新規追åŠ?
472             * @og.rev 5.1.3.0 (2010/02/01) noTransition、ajaxSubmitのコントロールは、requestで行うã€?
473             *
474             * @param   noTrnstn 画面遷移を行わなã�?½¢式ã?登録方法を使用するã�?
475             */
476            public void setNoTransition( final String noTrnstn ) {
477    //              noTransition = nval( getRequestParameter( noTrnstn ), noTransition );
478                    setNoTransitionRequest( nval( getRequestParameter( noTrnstn ), isNoTransitionRequest() ) );
479            }
480    
481            /**
482             * 【TAGã€?通常は使ã�?�¾せん)ajaxを利用したsubmitを利用するかどã�?�‹を指定しますã?
483             *
484             * @og.tag
485             * ajaxを利用したSubmit処ç�?‚’行うかどã�?�‹を指定しますã?
486             * setNoTransitionをtrueにした場合と同様ã?処ç�?‚’行いますã?
487             * (forwardせずにURLをDIVタグで出力すã‚?
488             *
489             * こã?値は、og:headタグで設定å?、またã?前画面からの値を継承するためã€??常、この属æ?ではセãƒ?ƒˆしませんã€?
490             *
491             * @og.rev 4.3.8.0 (2009/08/01) 新規追åŠ?
492             * @og.rev 5.1.3.0 (2010/02/01) noTransition、ajaxSubmitのコントロールは、requestで行うã€?
493             *
494             * @param   ajaxSubmit ajaxを利用したsubmitを利用するかどã�?�‹
495             */
496            public void setUseAjaxSubmit( final String ajaxSubmit ) {
497    //              useAjaxSubmit = nval( getRequestParameter( ajaxSubmit ), useAjaxSubmit );
498                    setAjaxSubmitRequest( nval( getRequestParameter( ajaxSubmit ), isAjaxSubmitRequest() ) );
499            }
500    
501            /**
502             * 【TAGã€?通常は使ã�?�¾せん)useRedirect=true時に 日本語を含ã‚?»¢送å?(page)をバイナリ変換するときã?コード名[UTF-8/Windows-31J]など(初期値:null)
503             *
504             * @og.tag
505             * 日本語ファイル名を持つ URL ã‚?useRedirect で転送するå?合に、転送å?(page)をバイナリ変換しなã�?�¨、転送できなã�?‚±ースがありますã?
506             * こã?あたりã?、ブラウザにも依存するã?で、既存ã?処ç�?�«影響しなã�?§˜に、このパラメータを使用する場合ã?み
507             * 処ç�?‚’実行しますã?
508             * IEでの日本語ファイル転送で、うまくいかなã�??合ã?、暫定å?置ですã?
509             * IEの場合ã?、redirectEncode="UTF-8" で、日本語ファイルを転送できますã?
510             * ただしã?useRedirect=true時に filename 属æ?によるファイル名ã?書き換えå?ç�??できませんので、ご注意くã�?�•ã�??
511             * 初期値は、null で、バイナリエンコードしません。(互換性ありの状態ですã???
512             *
513             * @og.rev 5.6.5.0 (2013/06/07) 新規追åŠ?
514             *
515             * @param   redEnc URL ã‚?転送するå?合に、日本語を含ã‚?»¢送å?(page)をバイナリ変換するときã?コード名
516             */
517            public void setRedirectEncode( final String redEnc ) {
518                    redirectEncode = nval( getRequestParameter( redEnc ), redirectEncode );
519            }
520    
521            /**
522             * シリアライズ用のカスタãƒ?‚·リアライズ書き込みメソãƒ?ƒ‰
523             *
524             * @og.rev 4.0.0.0 (2006/09/31) 新規追åŠ?
525             * @serialData ä¸?ƒ¨のオブジェクトã?、シリアライズされませんã€?
526             *
527             * @param       strm    ObjectOutputStreamオブジェクãƒ?
528             * @throws IOException  シリアライズに関する入出力エラーが発生したå?å�?
529             */
530            private void writeObject( final ObjectOutputStream strm ) throws IOException {
531                    strm.defaultWriteObject();
532            }
533    
534            /**
535             * シリアライズ用のカスタãƒ?‚·リアライズ読み込みメソãƒ?ƒ‰
536             *
537             * ここでは、transient 宣è¨?�•れたå†?ƒ¨変数のå†??初期化がå¿?¦�なフィールドã?み設定しますã?
538             *
539             * @og.rev 4.0.0.0 (2006/09/31) 新規追åŠ?
540             * @serialData ä¸?ƒ¨のオブジェクトã?、シリアライズされませんã€?
541             *
542             * @param       strm    ObjectInputStreamオブジェクãƒ?
543             * @see #release2()
544             * @throws IOException  シリアライズに関する入出力エラーが発生したå?å�?
545             * @throws ClassNotFoundException       クラスを見つけることができなかったå?å�?
546             */
547            private void readObject( final ObjectInputStream strm ) throws IOException , ClassNotFoundException {
548                    strm.defaultReadObject();
549            }
550    
551            /**
552             * こã?オブジェクトã?æ–?­—å?表現を返しますã?
553             * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
554             *
555             * @return こã?クラスのæ–?­—å?表現
556             */
557            @Override
558            public String toString() {
559                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
560                                    .println( "VERSION"             ,VERSION        )
561                                    .println( "tableId"             ,tableId        )
562                                    .println( "page"                ,page           )
563                                    .println( "keys"                ,keys           )
564                                    .println( "dbkeys"              ,dbkeys         )
565                                    .println( "vals"                ,vals           )
566                                    .println( "gamenId"             ,gamenId        )
567                                    .println( "useRedirect" ,useRedirect)
568                                    .println( "target"              ,target         )
569                                    .println( "filename"    ,filename       )
570                                    .println( "disposition"         ,disposition    )
571                                    .println( "noTransition"        ,noTransition   )
572                                    .println( "useAjaxSubmit"       ,useAjaxSubmit  )
573                                    .println( "redirectEncode"      ,redirectEncode )
574                                    .println( "Other..."    ,getAttributes().getAttribute() )
575                                    .fixForm().toString() ;
576            }
577    }