<%@ page import="
javax.naming.*,
java.rmi.*,
javax.rmi.*,
JSPSessionSFBean.*,
weblogic.logging.*" %><%!
private static Context ctx;
private static NonCatalogLogger logger;
static {
try {
ctx = new InitialContext();
logger = new NonCatalogLogger("wlsd21");
} catch (Exception e) {
System.out.println(e);
System.out.println("Error trying to do one time initialization.");
}
} public void log(String logMessage, JspWriter out) throws Exception {
logger.debug("page1.jsp: " + logMessage);
out.print(logMessage + "<BR>");
}%><%
JspSession s = (JspSession)session.getValue("JspSession");
if(s == null) {
JspSessionHome home = (JspSessionHome)
PortableRemoteObject.narrow(ctx.lookup("JspSession"),JspSessionHome.class);
s = home.create();
session.putValue("JspSession",s);
}
%><H1>Page 1</H1>
<BR>You are visiting <B>Page 1</B>. You may also visit:
<BR><LI><A HREF="page1.jsp">Page 1</A>
<LI><A HREF="page2.jsp">Page 2</A>
<LI><A HREF="page3.jsp">Page 3</A>
<LI><A HREF="page4.jsp">Page 4</A>
</LI>
<BR>
<BR>The last pages visited were:<BR>
<% if(s.getURL1() != null) { %>
<LI><A HREF="<%= s.getURL1() %>">
<%= s.getURL1() %> </A>
<% } %><% if(s.getURL2() != null) { %>
<LI><A HREF="<%= s.getURL2() %>">
<%= s.getURL2() %> </A>
<% } %><% if(s.getURL3() != null) { %>
<LI><A HREF="<%= s.getURL3() %>">
<%= s.getURL3() %> </A>
<% } else { %>
<LI>NONE YET
<% } %>
</LI><%
s.addURL("page1.jsp");
%>
自己好好看吧,JspSession就是个sessionbean
javax.naming.*,
java.rmi.*,
javax.rmi.*,
JSPSessionSFBean.*,
weblogic.logging.*" %><%!
private static Context ctx;
private static NonCatalogLogger logger;
static {
try {
ctx = new InitialContext();
logger = new NonCatalogLogger("wlsd21");
} catch (Exception e) {
System.out.println(e);
System.out.println("Error trying to do one time initialization.");
}
} public void log(String logMessage, JspWriter out) throws Exception {
logger.debug("page1.jsp: " + logMessage);
out.print(logMessage + "<BR>");
}%><%
JspSession s = (JspSession)session.getValue("JspSession");
if(s == null) {
JspSessionHome home = (JspSessionHome)
PortableRemoteObject.narrow(ctx.lookup("JspSession"),JspSessionHome.class);
s = home.create();
session.putValue("JspSession",s);
}
%><H1>Page 1</H1>
<BR>You are visiting <B>Page 1</B>. You may also visit:
<BR><LI><A HREF="page1.jsp">Page 1</A>
<LI><A HREF="page2.jsp">Page 2</A>
<LI><A HREF="page3.jsp">Page 3</A>
<LI><A HREF="page4.jsp">Page 4</A>
</LI>
<BR>
<BR>The last pages visited were:<BR>
<% if(s.getURL1() != null) { %>
<LI><A HREF="<%= s.getURL1() %>">
<%= s.getURL1() %> </A>
<% } %><% if(s.getURL2() != null) { %>
<LI><A HREF="<%= s.getURL2() %>">
<%= s.getURL2() %> </A>
<% } %><% if(s.getURL3() != null) { %>
<LI><A HREF="<%= s.getURL3() %>">
<%= s.getURL3() %> </A>
<% } else { %>
<LI>NONE YET
<% } %>
</LI><%
s.addURL("page1.jsp");
%>
自己好好看吧,JspSession就是个sessionbean
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货