tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shane Curcuru (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TAP5-818) JDK5 Generic is not supported by property chain
Date Tue, 18 Aug 2009 21:09:14 GMT

    [ https://issues.apache.org/jira/browse/TAP5-818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744712#action_12744712
] 

Shane Curcuru commented on TAP5-818:
------------------------------------

I presume this is a Tapestry issue; otherwise please reassign as needd.  This is not related
to the PRC project (which is public relations).

> JDK5 Generic is not supported by property chain
> -----------------------------------------------
>
>                 Key: TAP5-818
>                 URL: https://issues.apache.org/jira/browse/TAP5-818
>             Project: Tapestry 5
>          Issue Type: Bug
>         Environment: Tapestry 5.1.0.5
> JDK5
>            Reporter: maxyu
>
> Below is the example
> KeyedObject.java:used to store string keyed object
> import java.util.*;
> import java.util.Map.Entry;
> public class KeyedObject<T> {
> 	private String key;
> 	private T value;
> 	public String getKey() {
> 		return key;
> 	}
> 	public void setKey(String key) {
> 		this.key = key;
> 	}
> 	public T getValue() {
> 		return value;
> 	}
> 	public void setValue(T value) {
> 		this.value = value;
> 	}	
> }
> page java class:dbpools simply put BasicDataSource and its key name into a KeyObject
list
> import java.util.Iterator;
> import java.util.LinkedList;
> import java.util.List;
> import java.util.Map;
> import java.util.Map.Entry;
> import org.apache.commons.dbcp.BasicDataSource;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import com.elite.predictob.EliteOBManagerProxy;
> import com.elite.predictob.KeyedObject;
> public class dbpools {
> 	@Inject
> 	private EliteOBManagerProxy proxy;
> 	
> 	@Property
> 	private KeyedObject<BasicDataSource> datasource;
> 	
> 	public List<KeyedObject<BasicDataSource>> getDatasources()
> 	{
> 		Map dbmap=proxy.getManager().getDataSources();
> 		synchronized (dbmap) {
> 			List<KeyedObject<BasicDataSource>> list=new LinkedList<KeyedObject<BasicDataSource>>();
> 			Iterator<Entry<String,BasicDataSource>> it=dbmap.entrySet().iterator();
> 			while(it.hasNext()){
> 				Entry<String,BasicDataSource> entry=it.next();
> 				KeyedObject<BasicDataSource> obj=new KeyedObject<BasicDataSource>();
> 				obj.setKey(entry.getKey());
> 				obj.setValue(entry.getValue());
> 				list.add(obj);
> 			}
> 			return list;
> 		}
> 	}
> }
> page template:
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
>       xmlns:p="tapestry:parameter"
>       xmlns:cl="cl">
>   <head>
>   <t:elite.cachecontrol.cachecontrol/>
>     <title>${message:dbpoolconfig}</title>
>   </head>
>   <body>
>   	<table border="1">
>   		<tr t:type="loop" t:element="tr" t:source="datasources" value="datasource">
>   			<td>${datasource.key}</td><td>${datasource.value.numActive}</td>
>   		</tr>
>   	</table>
>   </body>
> </html>
> ${datasource.value.numActive} will cause following error:
> Could not convert 'datasource.value.numActive' into a component parameter binding: Class
java.lang.Object does not contain a property named 'numActive' (within property expression
'datasource.value.numActive'). Available properties: class.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message