This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question on jsp:include  RSS feed

 
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
Boost this thread!