Jsp Forward

Advertisements

JSP Action Element JSP Include

Jsp Forward

This action tag is used for forwarding a request from a jsp to another jsp or a servlet or a html.

When use JSP Forward tag

Generally, if a huge logic is required in a jsp then we divide that logic into multiple jsp pages and then we apply forwarding technique.

Note: If destination is a jsp or html then file name is required and if destination is a servlet then url pattern is requied.

Save and Compile jsp program

JSP program must be save with the .jsp extension. And for compile jsp code simply follow step of compilation servlet code.

Example

<jsp:forward page="/srv1"/>
<jsp:forward page="home.jsp"/>
<jsp:forward page="index.html"/>

When a request is forwarded then along-with the request, automatically request parameters send from browser or also forwarded. If you want to attach additional parameters then we use <jsp:param> tag inside <jsp:forward> tag.

Example

<jsp:forward page="home.jsp">
<jsp:param name="p1" value="10"/>
<jsp:param name="p2" value="20"/>
</jsp:forward>

JSP Action Element JSP Include

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements