Home Jsp Simple-jsp-example Passing Parameter with



Passing Parameter with
Posted on: March 12, 2008 at 12:00 AM
In this example we are going to use action tag. This action tag has one attribute page which is used to include a file in a jsp page. While using we are adding the file at run time.

Passing Parameter with <jsp: include>

    

In this example we are going to use <jsp:include> action tag. This action tag has one attribute page which is used to include a file in a jsp page. While using <jsp:param> we are adding the file at run time.

The code of the program is given below:

 

<html>
<head>
<title>This page passes parameters</title>
</head>
<body>
<!-- header from include-->
<jsp:include page="AccessincludedParameter.jsp">
  <jsp:param name="UserName" value="Roseindia.net"/>
</jsp:include>
Above text is from AccessincludedParameter.jsp.
</body>
</html>
 

 

<!-- the included file -->
<h1><%=request.getParameter("UserName") %> </h1>

Output of  the Program:

Related Tags for Passing Parameter with :
cjspfiletimeioincludesedpagetagattributeusingthisactionjsexampleaddwhiletoramexamruneiluseiminaddinaddingasmpartrddjadclagemeparamxawhichxampsspatincishaimemplgoaractttssrithpleplono


More Tutorials from this section

Ask Questions?    Discuss: Passing Parameter with   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.