Hi, I have a doubt in understanding <jsp aram> variable scope. Just for testing i wrote the following code inside a Test.jsp. <form action="TestServlet> <jsp:include page="hello/second.jsp"> <jsp aram name="username" value="marcus"/> </jsp:include> <% out.print(request.getParameter("username")); %> </form> This JSP displays the username value as null which is valid.But,i would like to know what is scope of <jsp aram > variables .If i submit the above form to TestServlet ,will i able to retrieve username value.I even tested by submitting the value to TestServlet and i got username value as "null".What is the scope of <jsp aram> variables ? Will it be available only to the included page.If so,how it is different from tag files. When we use tag files,we use tag attributes which are visible only in inculded pages.
Scope of <jsp aram --- > is Request but you can access it only in hello/second.jsp file, not in TestServlet. There is no much difference between <jsp:include> and Tag, One major difference is if you use <jsp:include> you are going to land up with nested two <html> opening and </html> closing tags. Take for example,if you include a page using <jsp:include> :