• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I assign a dynamic file value to the include directive?

 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi master!

That works fine in my code.
But I want to assign a dynamic value to a variable which representes the include file.
Somehow like this:

WEBPAGE_INCLUDE is a string that is filled with a dynamic variable.
Can you help me!
For sure the solution is simple, but as a beginner I didn�t find it out.
 
Trish Wu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It wont wont with include directive, u can never pass a request time value into a directive. Since diective is instruction to the jsp compiler on how to translate your jsp code into a servlet, before compiling.
So request time value does not make sense in the context of directive.
Therefore include directive is a static include, maybe u can try to use this
<jsp:include page ='<%=myUrlVariable">' />
 
Trish Wu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Type, sorry
<jsp:include page ='<%=myUrlVariable%>'/>
 
Robert Jaeger
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, thanks for your help, that works!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!