[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2051) please put WEB-INF under view instead of resources (seam-gen)
by Dan Allen (JIRA)
please put WEB-INF under view instead of resources (seam-gen)
-------------------------------------------------------------
Key: JBSEAM-2051
URL: http://jira.jboss.com/jira/browse/JBSEAM-2051
Project: JBoss Seam
Issue Type: Feature Request
Components: Tools
Affects Versions: 2.0.0.CR1
Reporter: Dan Allen
Assigned To: Dan Allen
Fix For: 2.0.x
I am aware that there is no hotter issue than this one. But PAUSE before rejecting it and hear me out.
The current seam-gen project structure is
src
action
model
resources
WEB-INF
META-INF
view
IDEs choke on this structure, but it really comes down to just one folder. The src/ and resources/ directory really aren't a problem. The real problem is that WEB-INF/ just needs to be under view/. Seriously, if that can happen, the IDEs really will be happier. People are not arguing for the sake of arguing. This convention is the way that Sun laid out more than a decade ago and vendors have catered to it ever since (even JBoss). It's not like we woke up one day and said, gee, let's put WEB-INF/ in the folder with web artifacts. Rather than try to change the whole world, can we just move this one folder? I promise I am not arguing to read my own writing.
Proposed structure
src
action
model
resources
META-INF
view
WEB-INF
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3916) SeamELResolver.resolveInMap() will resolve a property "size" to ((Map)base).size() even if the Map contains a key named "base" - instead, it should return null and allow javax.el.MapELResolver to resolve the property to ((Map)base).get("size")
by Ian Springer (JIRA)
SeamELResolver.resolveInMap() will resolve a property "size" to ((Map)base).size() even if the Map contains a key named "base" - instead, it should return null and allow javax.el.MapELResolver to resolve the property to ((Map)base).get("size")
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3916
URL: https://jira.jboss.org/jira/browse/JBSEAM-3916
Project: Seam
Issue Type: Bug
Components: EL
Affects Versions: 2.1.0.SP1
Reporter: Ian Springer
Priority: Critical
I have an expression:
#{MyBean.someMap['size']}
In my non-Seam JSF app, this expression was resolving to MyBean.getSomeMap().get("size"). However, when I integrated Seam into my app, the expression started instead resolving to MyBean.getSomeMap().size(), which broke my app. This is occurring because SeamELResolver is ahead of javax.el.MapELResolver in the CompositeELResolver resolver list, and its resolveInMap() function ensures a property named "size" resolves to ((Map)base).size() This makes it impossible for me to obtain the value of the element with key "size" from my Map via EL.
To solve this, I suggest changing SeamELResolver.resolveInMap() to the following:
private Object resolveInMap(ELContext context, Object base, Object property)
{
if ( !( (Map) base ).containsKey("size") && "size".equals(property) )
{
context.setPropertyResolved(true);
return ( (Map) base ).size();
}
else if ( !( (Map) base ).containsKey("values") && "values".equals(property) )
{
context.setPropertyResolved(true);
return ( (Map) base ).values();
}
else if ( !( (Map) base ).containsKey("keySet") && "keySet".equals(property) )
{
context.setPropertyResolved(true);
return ( (Map) base ).keySet();
}
else if ( !( (Map) base ).containsKey("entrySet") && "entrySet".equals(property) )
{
context.setPropertyResolved(true);
return ( (Map) base ).entrySet();
}
else
{
return null;
}
}
The only disadvantage of this is that if you actually are trying to get at map.size(), there will be no way to do so if the Map happens to contain a key named "size". However, in such a case, #{MyBean.someMap.keySet.size} or #{MyBean.someMap.values.size} could instead be used to obtain the Map's size.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months