SESSION variable operation

xiaoxiao2021-03-06  54

Put the variable into the session: session.putValue ("Anchor", v_key); <% @ page contenttype = "text / html; charset = GB2312"%>

<% @ Page ContentType = "text / html; charset = GB2312"%>

<% @ Page Info = "Database Handler"%>

<% @ Page Import = "java.io. *"%>

<% @ Page Import = "java.util. *"%>

<% @ Page Import = "java.sql. *"%>

<%

Request.SetCharacterencoding ("GB2312");

String v_file_name = Request.getParameter ("filename");

String v_key = request.getParameter ("key");

/ / Put the variable v_file_name, v_key into the session

Session.putValue ("Bodyfile", v_file_name;

Session.putValue ("Anchor", v_key);

IF (v_file_name! = null && v_key! = NULL) {

Response.sendRedirect (Request.getContextPath () "/ jsp / help.jsp #" v_key);

}

%>

Take out the session variable: session.getValue ("anchor");

<% @ Page language = "java"%> <% @ page language = "java"%>

<% @ Taglib Uri = "/ Web-INF / TLD / STRUTS-TILES.TLD" prefix = "tiles"%>

<% @ Page ContentType = "text / html; charset = GB2312"%>

<%

/ *

Get Param from session

* /

Session.getValue ("Bodyfile");

Session.getValue ("anchor");

%>

" Direct = "true" />

" Direct = " True "/> "Direct =" true "/>

转载请注明原文地址:https://www.9cbs.com/read-114656.html

New Post(0)