Put the variable in the sessionExample: session. putValue ("anchor", v_key );
<% @ 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 variables v_file_name and v_key into the session to go to the session. putValue ("bodyFile", v_file_name); session. p UtValue ("anchor", v_key); if (v_file_name! = Null & v_key! = Null) {response. sendRedirect (request. getContextPath () + "/jsp/help. jsp #" + v_key) ;}%>
Retrieve session VariablesExample: session. getValue ("anchor ");
<% @ 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"); %> <tiles: insert template = ". /helpFramesetLayout. jsp "> <tiles: put name =" title "content =" * TGPMS help * "/> <tiles: put name = "header" content = "<% ="/jsp/search. jsp "%>" direct = "true"/> <tiles: put name = "body" content = "<% ="/jsp/manual/"+ session. getValue ("bodyFile") + "#" + session. getValue ("anchor") %> "direct =" true "/> <tiles: put name = "footer" content = "<% ="/jsp/footer.html "%>" direct = "true"/> </tiles: insert>