Java/JSP/JSP Forwarding — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 10:10, 1 июня 2010
Jsp Forward Demo
<source lang="java">
//File: index.jsp <html>
<%
double freeMem = Runtime.getRuntime().freeMemory(); double totlMem = Runtime.getRuntime().totalMemory(); double percent = freeMem/totlMem; if (percent < 0.5) {
%> <jsp:forward page="one.jsp"/> <% } else { %> <jsp:forward page="two.html"/> <% } %> </html> //File: one.jsp <html>
<body bgcolor="white"> VM Memory usage < 50%. </html> //File: two.html <html>
<body bgcolor="white"> VM Memory usage > 50%. </html>
</source>
Servlet Forward Jsp
== Use Forward In Jsp ==