|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: Re: Non-default custom String-Translator? - msg#00182
List: users-tapestry-apache
How about defining a "lowercase" translator, and using
@Validate("lowercase") on those fields?
On Sun, Jan 25, 2009 at 6:03 PM, Onno Scheffers <onno@xxxxxxxxx> wrote:
> Is there a way I can setup a custom String validator that is only added to
> fields I explicitly set the translator for?
>
> I want to make sure some TextFields (username and email-address) are
> converted to lowercase Strings. I figured a Translator would be useful for
> that. But when I create a LowercaseTranslator using the name 'lowercase' all
> TextFields in the application seem to use the LowercaseTranslator all of a
> sudden.
>
> This is how I contributed my Translator:
>
> public static void contributeTranslatorSource(Configuration<Translator>
> configuration) {
> configuration.add(new LowercaseTranslator());
> }
>
> regards,
>
> Onno
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: multiple IoC Registries
Occasionally, I'll have a data object that stores a reference to
service. Here's an example:
public class ActiveUser extends BaseOptimizedSessionPersistedObject
{
private long userId;
private final Session session;
public ActiveUser(Session session)
{
this.session = session;
}
public long getUserId()
{
return userId;
}
public void setUserId(long userId)
{
markDirty();
this.userId = userId;
}
public User getUser()
{
return userId == 0 ? null : (User) session.get(User.class, userId);
}
@Override
public String toString()
{
return String.format("ActiveUser[userId=%d, session=%s]",
userId, session);
}
}
This is an ApplicationStateObject, so it persists in the HttpSession,
but it uses the Hibernate Session as well.
On Fri, Jan 30, 2009 at 8:33 AM, Dude.Checkitout
<dude.checkitout@xxxxxxxxx> wrote:
>
> Thanks Howard.
>
> We have few Tapestry applications running in the same server. (and planning
> to have more)
> I am assuming it is going to cause issues based on your reply. What is the
> best way to avoid this issue?
>
> Just curious, at what point does a service(/proxy) gets
> serialized/de-serialized? I am getting this error only when I have more then
> one tapestry application and when the second webapp gets loaded...
>
>
> Howard Lewis Ship wrote:
>>
>> If you have only one Tapestry application, you can safely ignore this
>> warning.
>>
>> It's related to the code that allows services to be serialized (that
>> is, the service proxies are serializable even though the services
>> themselves are not). When a service is de-serialized, there's a static
>> variable used to identify the active Registry to connect to. It's
>> ugly, but the Servlet API does not address this issue and so we are
>> left with this kludge.
>>
>> If you have only one Tapestry application deployed in your server, or
>> you never serialize a service proxy (the latter being a rather rare
>> occurance) then you can ignore the warnings.
>>
>> On Fri, Jan 30, 2009 at 7:40 AM, Dude.Checkitout
>> <dude.checkitout@xxxxxxxxx> wrote:
>>>
>>> Getting the following error when refreshing/redeploying the web
>>> application
>>> in JBoss. "[org.apache.tapestry5.ioc.internal.SerializationSupport]
>>> Setting
>>> a new service proxy provider when there's already an existing provider.
>>> This
>>> may indicate that you have multiple IoC Registries."
>>>
>>> For maintenance reasons, all the tapestry jar files are kept out of
>>> WEB-INF/lib folder and kept in JBoss loadable folders. Each time the web
>>> app
>>> reloads, above error is written into the log file. But the webapp is
>>> loaded
>>> and "looks" fine.
>>>
>>> We are observing some strange behavior about the service configurations
>>> and
>>> wondering whether this error could be the cause of those?
>>> Can anyone help understand this error? What part of tapestry is affected
>>> by
>>> this error?
>>>
>>> http://tapestry.apache.org/tapestry5/tapestry-ioc/serialization.html
>>> http://tapestry.apache.org/tapestry5/tapestry-ioc/serialization.html -
>>> talks about this error but does not say how to solve it or the effect of
>>> this error on the Tapestry behavior
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/multiple-IoC-Registries-tp2245422p2245422.html
>>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
>>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
>>
>>
>>
>
> --
> View this message in context:
> http://n2.nabble.com/multiple-IoC-Registries-tp2245422p2245712.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
>
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
Next Message by Date:
click to view message preview
Re: Chenille Kit - Gplotter
This was happening because the js file "Chenillekit.js" is not been included
by the GPlotter compoment.
To fix it i had to add the follwowinig to my class
@IncludeJavaScriptLibrary(value =
{"classpath:org/chenillekit/tapestry/core/Chenillekit.js"})
I am still not sure if i am missing something or it;s a bug. The online demo
works fine, but copy the code locally it gives me the same JS error.
Thanks
On Fri, Jan 30, 2009 at 6:11 PM, Juan E. Maya <maya.juan@xxxxxxxxx> wrote:
> Hello, i am trying to use the gplotter component from Chenille Kit
> Framework, but i am getting the following error:
>
> Ck is not defined
>
> http://localhost:8080/profilr/assets/org/chenillekit/tapestry/core/components/GPlotter.js
> Line 15
>
> am i missing something?
> Also another question, would it be possible to extend the Component to
> support a list of address?
>
>
> I am currently using tapestry 5.0.18, and Chenille 1.0
>
> I am not sure if this list is the right place to ask questions specific
> about Chenille, but i couldn't find a better place.
> Thanks a lot for the help.
>
Previous Message by Thread:
click to view message preview
Non-default custom String-Translator?
Is there a way I can setup a custom String validator that is only added to
fields I explicitly set the translator for?
I want to make sure some TextFields (username and email-address) are
converted to lowercase Strings. I figured a Translator would be useful for
that. But when I create a LowercaseTranslator using the name 'lowercase' all
TextFields in the application seem to use the LowercaseTranslator all of a
sudden.
This is how I contributed my Translator:
public static void contributeTranslatorSource(Configuration<Translator>
configuration) {
configuration.add(new LowercaseTranslator());
}
regards,
Onno
Next Message by Thread:
click to view message preview
Re: Non-default custom String-Translator?
>
> How about defining a "lowercase" translator, and using
> @Validate("lowercase") on those fields?
Hi Howard,
thanks for your response.
I didn't know it was possible to use translator-names as arguments to the
Validate annotation.
Do I still have to contribute the translator in some way or is it enough to
just add it to the translators sub-package?
I did try it without contributing and although I don't get any errors on the
page, the user-input is not converted to lower-case and if I do contribute
it, _all_ string-fields are converted to lower-case.
regards,
Onno
> > Is there a way I can setup a custom String validator that is only added
> to
> > fields I explicitly set the translator for?
> >
> > I want to make sure some TextFields (username and email-address) are
> > converted to lowercase Strings. I figured a Translator would be useful
> for
> > that. But when I create a LowercaseTranslator using the name 'lowercase'
> all
> > TextFields in the application seem to use the LowercaseTranslator all of
> a
> > sudden.
> >
> > This is how I contributed my Translator:
> >
> > public static void contributeTranslatorSource(Configuration<Translator>
> > configuration) {
> > configuration.add(new LowercaseTranslator());
> > }
> >
> > regards,
> >
> > Onno
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx
>
>
|
|