<jsp:forward page="sample.jsp"/>
Here page is a mandatory attribute.
Folder structure
webapps
|_ jsp5
|_ index.jsp
|_ sample.jsp
index.jsp
<html>
<body>
This is in the html body<br/>
<jsp:scriptlet>
request.setAttribute("sample","this is sample text......");
</jsp:scriptlet>
<jsp:forward page="sample.jsp"/>
</body>
</html>
Here, using the setAttribute() we have set an attribute to the corresponding request. The request object here is carried to the sample.jsp file because of the <jsp:forward> tag. The request here is forwarded.
sample.jsp
<%
out.println(request.getAttribute("sample"));
%>