Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

losing request objects with include

 
jesse harris
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the
<bean:include id="itemList" page="/displayitem.jsp"/>
tag to include a jsp,
and the usebean tag is in the included jsp,
but when I do this the objects I am putting in
the request are gone, I have tried including an action
instead of directly to the jsp file, and all files are contained
within the same module. No dice.
anyone have any ideas on this one,
thanks in advance
Jesse
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<bean:include> it does not use RequestDispatcher.include(). Instead, it performs an HTTP request to include the resource, so the included resource gets a whole new request. If you need access to request attributes, use <jsp:include>. It's more efficient too.
- Peter
 
Andy Deighton
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can use the jsp page directive <%@ include file=%> which will include the enclosed file and *then* compile your page, thus allowing you to refer to request, session, etc. objects in your inclusion.
Andy
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic