You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by John Baker <jb...@teamenergy.com> on 2002/03/19 14:31:46 UTC

Following on from my posts earlier (sorry it ended up going twice or 
whatever, sendmail was lieing to me), I'm wondering if I can do:

<c:set var="searchType" value="${Integer.class" scope="session/>

<c:if test="${session.searchType == Integer.class">

</c:if>

but I'm rather thinking I can't. Can anyone confirm this, and suggest another 
way?

Cheers


John


-- 
John Baker, BSc CS.
Java Developer, TEAM/Slb. http://www.teamenergy.com
Views expressed in this mail are my own.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re:

Posted by John Baker <jb...@teamenergy.com>.
On Tuesday 19 Mar 2002 14H:17 pm, you wrote:
> On Tue, 19 Mar 2002, John Baker wrote:
> > Following on from my posts earlier (sorry it ended up going twice or
> > whatever, sendmail was lieing to me), I'm wondering if I can do:
> >
> > <c:set var="searchType" value="${Integer.class" scope="session/>
> >
> > <c:if test="${session.searchType == Integer.class">
> >
> > </c:if>
> >
> > but I'm rather thinking I can't. Can anyone confirm this, and suggest
> > another way?
>
> I'm not sure what you're asking, exactly.  ${Integer.class} is a perfectly
> valid expression, but it means "the 'class' property of the scoped
> variable named 'Integer'".  It doesn't mean "the result of the getClass()
> method for the class Integer", if that's what you're asking.
>
> If you had an individual Integer I, then ${I.class} would correspond to
> the Class object for Integer.

Yes, that was what I was asking. I don't like storing Strings, I'd much 
prefer a Class if it makes sense (program wise ;-). 

-- 
John Baker, BSc CS.
Java Developer, TEAM/Slb. http://www.teamenergy.com
Views expressed in this mail are my own.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re:

Posted by Shawn Bayern <ba...@essentially.net>.
On Tue, 19 Mar 2002, John Baker wrote:

> Following on from my posts earlier (sorry it ended up going twice or
> whatever, sendmail was lieing to me), I'm wondering if I can do:
> 
> <c:set var="searchType" value="${Integer.class" scope="session/>
> 
> <c:if test="${session.searchType == Integer.class">
> 
> </c:if>
> 
> but I'm rather thinking I can't. Can anyone confirm this, and suggest
> another way?

I'm not sure what you're asking, exactly.  ${Integer.class} is a perfectly
valid expression, but it means "the 'class' property of the scoped
variable named 'Integer'".  It doesn't mean "the result of the getClass()
method for the class Integer", if that's what you're asking.

If you had an individual Integer I, then ${I.class} would correspond to
the Class object for Integer.

-- 
Shawn Bayern
Author, "JSP Standard Tag Library"  http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>