Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which ofenclosing page variables can be automatically used by the dyna.included file?

 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can dynamically included files use the implicit variables application, session, request, pageContext , out, response and config?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried it? What did you discover?
bear
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi bear,
i am at the moment just writing the first technical specs. so i dont have the chance to try...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well when you get a chance to try, let us know if you find anything confusing.
bear
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
comma, I'm not trying to be obstinate here; I'm trying to make a point. The primary job of a forum bartender is not to enforce the naming convention (much as it seems so), but to make sure that the participants of the forum are getting the most out of it as a resource.
JavaRanch is here to help you help yourself; not to do your work for you. If you are not willing to go the first mile to try and figure something out, why should the people who volunteer their time to help out here do all your leg-work for you?
It will take ten minutes or less for you to set up a set of test JSP pages that you can use to answer your own question. And, I will point out, such verification is part of the research necessary to write tech specs for a project.
Now, if you perform such a test and are puzzled by some of the results, you know you can post such questions here and you will get lots of help from the regular posters -- I've seen you do the same yourself. But you've got to make an effort to help yourself first.
bear
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,
actually you are right. it has been a while I didnot use the jsp and related technologies. so forgotten some of the features.
sory then. I will set up the old tomcat environment again.
bye
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's definitely the best thing to do especially if you are in the process of writing a tech spec for a web app (which is what I am assuming you are trying to do). That way you can perform any little tests to verify your knowledge as you go along. And as I pointed out, please feel free to ask questions about aspects that may confuse you.
thanks,
bear
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to help you along (I'm just long-winded today, aren't I?), pay especially close attention to the behavior of the pageContext variable in this scenario.
bear
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, dynamically included files get a reference to the variables of the enclosing page via pageContext, which is in fact the same unique object.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. How did you perform this check?
bear
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i printed the pageContext objects out. they are the same.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, we are talking about <jsp:include> rather than <%@ include %>, right?
bear
[ October 22, 2003: Message edited by: Bear Bibeault ]
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course I tried both of them. pageContext object is the same : in the enclosing page, in the dyn.ly included file, and also statically included page. and this is very logical to me. They 3 are serving for the same request object, which is bound to a pageContext.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64977
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The results you should have found are that for a <jsp:include> that you get different page contexts as well as requests. The whole point of a <jsp:include> is that initiates a separate request for the included resource.
How did you set up your tests?
bear
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an enclosing-page.jsp,
which includes with
and
Then I put also sth. on the request and application scopes, and retrieved them from within the included files.
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brusk Baran:
I have an enclosing-page.jsp,
which includes with
and
Then I put also sth. on the request and application scopes, and retrieved them from within the included files.

AW there is only one application object for one context.
And If I am not wrong then request object has a scope of request and hence remain same for inculded file[for both type i.e. at runtime and at compile time]
 
Brusk Baran
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK,
it is that.
the enclosing page and the dynamically included files share the request only (apart from session(if any) and application of course. Their pageContext objects are also different.
nevertheless, enclosing page and the statically included files are the same file effectively, which share both the PageContext, request, session, and application. they have the same pageContext object.
I have been closing this topic now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic