Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSP include with parameters usage

Tags:

parameters

jsp

How should I access the param1 value from the included jsp (navMenu.jsp)?

<jsp:include page="navMenu.jsp" >     <jsp:param name="param1" value="menu" /> </jsp:include> 
like image 248
DanC Avatar asked Sep 13 '10 05:09

DanC


People also ask

What is the use of include () method in JSP?

The include directive is used to include a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase. You may code include directives anywhere in your JSP page.

How will you pass parameters in JSP file from an HTML file with an example?

To pass the parameters from index to file page we are using <jsp:param> action tag. We are passing three parameters firstname, middlename and lastname, for each of these parameters we need to specify the corresponding parameter name and parameter value.

What does <% include do in JSP?

The <%@include file="abc. jsp"%> directive acts like C "#include" , pulling in the text of the included file and compiling it as if it were part of the including file. The included file can be any type (including HTML or text). The <jsp:include page="abc.


1 Answers

${param.param1} (preferable) or request.getParameter("param1")

like image 65
Bozho Avatar answered Oct 14 '22 09:10

Bozho