Lesson - 10 : JSP - JSP Standard Action element - forward, param, params

Опубликовано: 28 Сентябрь 2024
на канале: Sada Learning Hub
2,641
26

Standard Actions - <jsp:forward>:

This action tag is used to forward a request from one JSP page to another JSP page
This action tag internally uses RequestDispatcher forward() method

This action tag can be used to communicate
JSP to JSP page : <jsp:forward page="b.jsp"/>
JSP to servlet : <jsp:forward page="srv1"/>
JSP to HTML : <jsp:forward page="b.html"/>

Standard Actions - <jsp:param/params>
<jsp:param>
When a request is forwarded from one JSP to another then automatically request parameters are also forwarded to another JSP.
For example:
<jsp:param name="email" value="[email protected]"/>

<jsp:params>
If more than one <jsp:param> tag is used then we should put them in <jsp:params> tag.
For example:
<jsp:params>
<jsp:params name="email" value="[email protected]"/>
<jsp:params name="hobby" value="reading"/>
</jsp:params>

Sample Projects : https://github.com/SadaLearningHub1/J...