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 Iikku Mattila <ii...@eduix.fi> on 2007/07/24 10:22:43 UTC

JNDI-taglib search tag returns null

I have problems with the search tag from the JNDI-taglib. The following 
bit works:

<jndi:useDirContext id="test" url="java:comp/env/ldap/portal" />
<jndi:lookup id="foo" contextRef="test" name="uid=quux, ou=Staff" />
<jndi:forEachAttribute ref="foo" id="bar">
          <%=bar%> <br/>
</jndi:forEachAttribute>

I neatly get all the stored information. However, when I try for example

<jndi:search id="baz" contextRef="test" filter="uid=quux" 
searchScope="subtree"/>

baz ends up being null. I've tried adding values to 'attributes', 
different searchScopes, looking up different contexts for use, etc. What 
am I missing?

Iikku


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JNDI-taglib search tag returns null

Posted by Iikku Mattila <ii...@eduix.fi>.
On Wed, 25 Jul 2007, Henri Yandell wrote:

> On 7/24/07, Iikku Mattila <ii...@eduix.fi> wrote:
>> <jndi:search id="baz" contextRef="test" filter="uid=pohjus"
>> searchScope="subtree">
>> </jndi:search>
>> 
>> This seems a tad silly to me and took quite a few hours to come up with.
>> Well, works now!
>
> Which server/server-version are you running it on?
>
Sun Java System Application Server Platform Edition 9.0_01


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JNDI-taglib search tag returns null

Posted by Henri Yandell <fl...@gmail.com>.
On 7/24/07, Iikku Mattila <ii...@eduix.fi> wrote:
> I finally figured it out but only with good luck.
>
> On Tue, 24 Jul 2007, Kris Schneider wrote:
> > On 7/24/07, Iikku Mattila <ii...@eduix.fi> wrote:
> >> <jndi:search id="baz" contextRef="test" filter="uid=quux"
> >> searchScope="subtree"/>
> >
> > Seems like it might be a filter thing. Try filter="(uid=quux)".
> Tried that, didn't help. What did help was creating an explicit end tag.
>
> <jndi:search id="baz" contextRef="test" filter="uid=pohjus"
> searchScope="subtree">
> </jndi:search>
>
> This seems a tad silly to me and took quite a few hours to come up with.
> Well, works now!

Which server/server-version are you running it on?

Hen

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JNDI-taglib search tag returns null

Posted by Iikku Mattila <ii...@eduix.fi>.
I finally figured it out but only with good luck.

On Tue, 24 Jul 2007, Kris Schneider wrote:
> On 7/24/07, Iikku Mattila <ii...@eduix.fi> wrote:
>> <jndi:search id="baz" contextRef="test" filter="uid=quux"
>> searchScope="subtree"/>
>
> Seems like it might be a filter thing. Try filter="(uid=quux)".
Tried that, didn't help. What did help was creating an explicit end tag.

<jndi:search id="baz" contextRef="test" filter="uid=pohjus" 
searchScope="subtree">
</jndi:search>

This seems a tad silly to me and took quite a few hours to come up with. 
Well, works now!

Iikku

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: Error with taglib parseDate

Posted by "T. Lamine Ba" <la...@hotmail.com>.
Thx much for the tip Kris.

Lamine.

-----Original Message-----
From: Kris Schneider [mailto:kris@directthought.com] 
Sent: Tuesday, August 07, 2007 9:14 AM
To: Tag Libraries Users List
Subject: Re: Error with taglib parseDate

On 8/6/07, T. Lamine Ba <la...@hotmail.com> wrote:
> Hi all,
>
> I use <parseDate> in webapp "www.buildtrees.com" as follows:
>
> ***
>         <fmt:parseDate var="birthdate" value="${param.birthdate}"
> pattern="MMM-dd-yyyy" />
> ***
>
> It works great when I visit the site with my computers.  On the other
> hand, some of my web visitors produce the error below:
>
> ***
> Exception: javax.servlet.jsp.JspException: In <parseDate>, value
> attribute can not be parsed: "OCT-02-2002"
>
> Error message: In <parseDate>, value attribute can not be parsed:
> "OCT-02-2002"
> ***
>
> I suspect the problem is browser related.  Does anyone has a solution
> for this?  I searched the internet, but I could not find anything that
> could help, primarily because I have not been able to reproduce the
> error with my computers.  I had to wait for a web surfer with the
"wrong
> configuration" to access the site.

Browser-based locale setting could certainly cause this to fail. If
you want to force the app to always use English, you should probably
include the following in web.xml:

<context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
  <param-value>en_US</param-value>
</context-param>

If you just want to change that specific tag, try the parseLocale
attribute:

<fmt:parseDate var="birthdate"
                       value="${param.birthdate}"
                       pattern="MMM-dd-yyyy"
                       parseLocale="en_US"/>

> All help appreciated.
>
> Lamine

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Error with taglib parseDate

Posted by Kris Schneider <kr...@directthought.com>.
On 8/6/07, T. Lamine Ba <la...@hotmail.com> wrote:
> Hi all,
>
> I use <parseDate> in webapp "www.buildtrees.com" as follows:
>
> ***
>         <fmt:parseDate var="birthdate" value="${param.birthdate}"
> pattern="MMM-dd-yyyy" />
> ***
>
> It works great when I visit the site with my computers.  On the other
> hand, some of my web visitors produce the error below:
>
> ***
> Exception: javax.servlet.jsp.JspException: In <parseDate>, value
> attribute can not be parsed: "OCT-02-2002"
>
> Error message: In <parseDate>, value attribute can not be parsed:
> "OCT-02-2002"
> ***
>
> I suspect the problem is browser related.  Does anyone has a solution
> for this?  I searched the internet, but I could not find anything that
> could help, primarily because I have not been able to reproduce the
> error with my computers.  I had to wait for a web surfer with the "wrong
> configuration" to access the site.

Browser-based locale setting could certainly cause this to fail. If
you want to force the app to always use English, you should probably
include the following in web.xml:

<context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.locale</param-name>
  <param-value>en_US</param-value>
</context-param>

If you just want to change that specific tag, try the parseLocale attribute:

<fmt:parseDate var="birthdate"
                       value="${param.birthdate}"
                       pattern="MMM-dd-yyyy"
                       parseLocale="en_US"/>

> All help appreciated.
>
> Lamine

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Error with taglib parseDate

Posted by "T. Lamine Ba" <la...@hotmail.com>.
Hi all,

I use <parseDate> in webapp "www.buildtrees.com" as follows:

***	
	<fmt:parseDate var="birthdate" value="${param.birthdate}"
pattern="MMM-dd-yyyy" />
***

It works great when I visit the site with my computers.  On the other
hand, some of my web visitors produce the error below:

***
Exception: javax.servlet.jsp.JspException: In <parseDate>, value
attribute can not be parsed: "OCT-02-2002" 

Error message: In <parseDate>, value attribute can not be parsed:
"OCT-02-2002"
***

I suspect the problem is browser related.  Does anyone has a solution
for this?  I searched the internet, but I could not find anything that
could help, primarily because I have not been able to reproduce the
error with my computers.  I had to wait for a web surfer with the "wrong
configuration" to access the site.

All help appreciated.

Lamine


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: JNDI-taglib search tag returns null

Posted by Kris Schneider <kr...@directthought.com>.
On 7/24/07, Iikku Mattila <ii...@eduix.fi> wrote:
> I have problems with the search tag from the JNDI-taglib. The following
> bit works:
>
> <jndi:useDirContext id="test" url="java:comp/env/ldap/portal" />
> <jndi:lookup id="foo" contextRef="test" name="uid=quux, ou=Staff" />
> <jndi:forEachAttribute ref="foo" id="bar">
>           <%=bar%> <br/>
> </jndi:forEachAttribute>
>
> I neatly get all the stored information. However, when I try for example
>
> <jndi:search id="baz" contextRef="test" filter="uid=quux"
> searchScope="subtree"/>
>
> baz ends up being null. I've tried adding values to 'attributes',
> different searchScopes, looking up different contexts for use, etc. What
> am I missing?

Seems like it might be a filter thing. Try filter="(uid=quux)".

> Iikku

-- 
Kris Schneider <ma...@directThought.com>
directThought  <http://www.directThought.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org