JSTL scope question
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Wood_Chuck
Posted On:   Wednesday, May 19, 2004 12:56 PM

why does this not work using JSTL? <%@ page import="my.package.MyObject" %> i even tried referencing the implicit JSTL objects but it didn't work: when i say it doesn't work i mean that the page compiles wihtout errors, but there is nothing from the tags. however, using scriptlets, the following works: <%@ page import="my.package.MyObject" %> <%= MyObject.MY_VALUE %> how can i do the same thing in JSTL?... without having to explicitly place objects into request or session myself? Is this possible? thanks in advance!!    More>>

why does this not work using JSTL?


<%@ page import="my.package.MyObject" %>


i even tried referencing the implicit JSTL objects but it didn't work:




when i say it doesn't work i mean that the page compiles wihtout errors, but there is nothing from the tags.


however, using scriptlets, the following works:


<%@ page import="my.package.MyObject" %>
<%= MyObject.MY_VALUE %>


how can i do the same thing in JSTL?... without having to explicitly place objects into request or session myself? Is this possible?


thanks in advance!!

   <<Less

Re: JSTL scope question

Posted By:   Sean_Owen  
Posted On:   Thursday, May 20, 2004 08:08 AM

I don't think you can do that with JSTL -- it operates entirely with JavaBeans, basically. "pageScope.MyObject.MY_VALUE" means something like "the result of calling getMY_VALUE() on the result of calling getMyObject() on pageScope".



This looks like some kind of constant -- consider making it available in the application scope (i.e. servlet context)?

About | Sitemap | Contact