• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on jsp:include

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%
request.setAttribute("greeting","good");
%>
<jsp:include page="menu.jsp" />
<p>morning</p>

And an available file called menu.jsp that contains the following code
<%
String greeting = (String) request.getAttribute("greeting");
out.print(greeting);
%>

as per my knowledge, the output should be null morning
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it will print good morning. Why don't you give it a try
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh...
i think i overlooked things...
the attribute is set in request scope..
it will be available to the included jsp...

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic