Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jee:jndi-lookup do not provide a way to define a default object [SPR-4012] #8692

Closed
spring-projects-issues opened this issue Oct 26, 2007 · 4 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 26, 2007

Tomasz Pik opened SPR-4012 and commented

jee:jndi-lookup do not provide a way to define a default object (or at least documentation do not show how to setup such a thing, also xsd do not highlight any way to define it) so it cannot be used a as drop-in replacement for org.springframework.jndi.JndiObjectFactoryBean (there's no equivalent of setDefaultObject(Object)
please, provide such a possibility for jee:jndi-lookup


Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for the suggestion! I've added "default-value" and "default-ref" attributes to "jee:jndi-lookup", translated to a default object (in JndiObjectFactoryBean terminology).

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Urs Keller commented

Hello
I think the JndiLookupBeanDefinitionParser should override the
"isEligibleAttribute" method. Right now the default-ref is not working correctly, since it is converted to a property defaultRef, which is not a field on JndiObjectFactoryBean.

protected boolean isEligibleAttribute(String attributeName) {
return (super.isEligibleAttribute(attributeName) && !DEFAULT_REF.equals(attributeName) &&
!DEFAULT_VALUE.equals(attributeName) )
}

Cheers,
-Urs

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Indeed, thanks for pointing this out. I've fixed this for 2.5 final.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This should be available in tonight's 2.5 snapshot. Feel free to give it a try...

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants