You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by haipeng du <ha...@gmail.com> on 2009/06/17 00:00:39 UTC

T5 tapestry spring

I try to inject spring beans to page class with
@Inject
@Id("baseDAO")
private BaseDAO baseDAO

It still gave me that "Spring context contains 14 beans assignable to type
xx.BaseDAO

what should I do for this.

-- 
Haipeng Du
Salt Lake City

Re: partial markup renderer replaces double quotes with single quotes and encodes any enclosed single quotes...

Posted by Howard Lewis Ship <hl...@gmail.com>.
Reducing the size of the JSON response and making it more readable.

On Wed, Jun 17, 2009 at 10:54 AM, Tom Zurkan
<tz...@citizensportsinc.com>wrote:

> so, is this this just for performance purposes or are there other reasons?
>
>
> Howard Lewis Ship wrote:
>
>> This is part of the normal markup writer behavior for 5.1; otherwise every
>> double quote in the markup to be escaped. JSON requires that strings
>> always
>> be in double quotes but HTML/XML does not (you can use single quotes
>> interchangably).
>>
>> Use RenderSupport to add a $('id').observe("click", someFunction); and
>> avoid
>> inline JavaScript.
>>
>> On Tue, Jun 16, 2009 at 3:58 PM, Tom Zurkan <tzurkan@citizensportsinc.com
>> >wrote:
>>
>>
>>
>>> i can't find who the culprit is yet.  but, by the time i am out of
>>> AjaxPartialResponseRendererImpl, the content has been changed so that
>>> double
>>> quotes are replaced.  this seems to cause some problem with enclosed
>>> javascript such as onclick="somefunction('var');"  becomes
>>> onclick='somefunction(&apos;var&apos;);' which i think is causing
>>> problems
>>> on IE.  anyone know who is doing this transformation?
>>>
>>> thanks,
>>>
>>> tom
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

Re: partial markup renderer replaces double quotes with single quotes and encodes any enclosed single quotes...

Posted by Tom Zurkan <tz...@citizensportsinc.com>.
so, is this this just for performance purposes or are there other reasons?

Howard Lewis Ship wrote:
> This is part of the normal markup writer behavior for 5.1; otherwise every
> double quote in the markup to be escaped. JSON requires that strings always
> be in double quotes but HTML/XML does not (you can use single quotes
> interchangably).
>
> Use RenderSupport to add a $('id').observe("click", someFunction); and avoid
> inline JavaScript.
>
> On Tue, Jun 16, 2009 at 3:58 PM, Tom Zurkan <tz...@citizensportsinc.com>wrote:
>
>   
>> i can't find who the culprit is yet.  but, by the time i am out of
>> AjaxPartialResponseRendererImpl, the content has been changed so that double
>> quotes are replaced.  this seems to cause some problem with enclosed
>> javascript such as onclick="somefunction('var');"  becomes
>> onclick='somefunction(&apos;var&apos;);' which i think is causing problems
>> on IE.  anyone know who is doing this transformation?
>>
>> thanks,
>>
>> tom
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>   


Re: partial markup renderer replaces double quotes with single quotes and encodes any enclosed single quotes...

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is part of the normal markup writer behavior for 5.1; otherwise every
double quote in the markup to be escaped. JSON requires that strings always
be in double quotes but HTML/XML does not (you can use single quotes
interchangably).

Use RenderSupport to add a $('id').observe("click", someFunction); and avoid
inline JavaScript.

On Tue, Jun 16, 2009 at 3:58 PM, Tom Zurkan <tz...@citizensportsinc.com>wrote:

> i can't find who the culprit is yet.  but, by the time i am out of
> AjaxPartialResponseRendererImpl, the content has been changed so that double
> quotes are replaced.  this seems to cause some problem with enclosed
> javascript such as onclick="somefunction('var');"  becomes
> onclick='somefunction(&apos;var&apos;);' which i think is causing problems
> on IE.  anyone know who is doing this transformation?
>
> thanks,
>
> tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

partial markup renderer replaces double quotes with single quotes and encodes any enclosed single quotes...

Posted by Tom Zurkan <tz...@citizensportsinc.com>.
i can't find who the culprit is yet.  but, by the time i am out of 
AjaxPartialResponseRendererImpl, the content has been changed so that 
double quotes are replaced.  this seems to cause some problem with 
enclosed javascript such as onclick="somefunction('var');"  becomes 
onclick='somefunction(&apos;var&apos;);' which i think is causing 
problems on IE.  anyone know who is doing this transformation?

thanks,

tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5 tapestry spring

Posted by haipeng du <ha...@gmail.com>.
I found one way to fix this problem. But I am not sure if that is good one.
(1) create one class to implement ObjectProvider
public class TapestrySpringBeanProvider implements ObjectProvider {



    @Override
    public <T> T provide(Class<T> clazz, AnnotationProvider ap,
            ObjectLocator locator) {
        // you can use any annotation you like
        Id id = ap.getAnnotation(Id.class);
        if ( id == null )
            return null;
        String beanName = id.value();
        ApplicationContext context =
locator.getService(ApplicationContext.class);
        return (T) context.getBean(beanName);
    }

}

(2) from your module class, add following method:

     public static void
contributeMasterObjectProvider(OrderedConfiguration<ObjectProvider> config){
         config.override("SpringBean",new TapestrySpringBeanProvider());
     }

(3) inject your spring bean like
@Inject
@Id("beanId")
private BaseDAO baseDAO

It works for me now.

On Wed, Jun 17, 2009 at 1:40 AM, Otho <ta...@googlemail.com> wrote:

> I had a similar problem. Maybe this thread helps you:
>
>
> http://www.nabble.com/T-5.1-How-to-inject-Spring-beans-by-name--td22934788.html
>
> 2009/6/17 haipeng du <ha...@gmail.com>
>
> > I try to inject spring beans to page class with
> > @Inject
> > @Id("baseDAO")
> > private BaseDAO baseDAO
> >
> > It still gave me that "Spring context contains 14 beans assignable to
> type
> > xx.BaseDAO
> >
> > what should I do for this.
> >
> > --
> > Haipeng Du
> > Salt Lake City
> >
>



-- 
Haipeng Du
Salt Lake City

Re: T5 tapestry spring

Posted by Otho <ta...@googlemail.com>.
I had a similar problem. Maybe this thread helps you:

http://www.nabble.com/T-5.1-How-to-inject-Spring-beans-by-name--td22934788.html

2009/6/17 haipeng du <ha...@gmail.com>

> I try to inject spring beans to page class with
> @Inject
> @Id("baseDAO")
> private BaseDAO baseDAO
>
> It still gave me that "Spring context contains 14 beans assignable to type
> xx.BaseDAO
>
> what should I do for this.
>
> --
> Haipeng Du
> Salt Lake City
>