The <jsp:forward> element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file. The lines in the source JSP file the <jsp:forward> element are not processed.

This sample code shows the use of tag. This checks the percentage of free memory and based on that opens new page using this tag.


  double freeMemory = Runtime.getRuntime().freeMemory();
  double totalMemory = Runtime.getRuntime().totalMemory();
  double percent = freeMemory/totalMemory;
  <jsp:forward page="one.jsp"/>
<jsp:forward page="two.html"/>


<font color=”red”>
VM Memory usage<50%


<body bgcolor= “white”>
<font color=”red”>
VM Memory usage>50%