You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nhhockeyplayer nashua <nh...@hotmail.com> on 2014/02/12 19:45:19 UTC
re : deprecated class
Thanks for the fast feedback.
Can anyone suggest a reimplementation for the original code block?
@Inject
private Environment environment;
@Inject
private Logger logger;
private String renderMarkup(RenderCommand renderCommand) {
MarkupWriter markupWriter = new MarkupWriterImpl();
// validation track
ValidationDecorator decorator = new DefaultValidationDecorator(environment,
assetSource.getExpandedAsset("${tapestry.spacer-image}"), markupWriter);
environment.push(ValidationDecorator.class, decorator);
RenderQueueImpl renderQueue = new RenderQueueImpl(logger);
renderQueue.push(renderCommand);
renderQueue.run(markupWriter);
environment.pop(ValidationDecorator.class);
return markupWriter.toString().replaceAll("^\\n+", "").replaceAll("\\n+$", "");
}
Best regards
and thanks... KEN
Re: re : deprecated class
Posted by Howard Lewis Ship <hl...@gmail.com>.
I'd suggest monkey-patching the client-side code to match your design needs.
On Wed, Feb 12, 2014 at 1:45 PM, nhhockeyplayer nashua <
nhhockeyplayer@hotmail.com> wrote:
> Thanks for the fast feedback.
>
> Can anyone suggest a reimplementation for the original code block?
>
> @Inject
> private Environment environment;
>
> @Inject
> private Logger logger;
>
> private String renderMarkup(RenderCommand renderCommand) {
> MarkupWriter markupWriter = new MarkupWriterImpl();
>
> // validation track
> ValidationDecorator decorator = new
> DefaultValidationDecorator(environment,
> assetSource.getExpandedAsset("${tapestry.spacer-image}"),
> markupWriter);
> environment.push(ValidationDecorator.class, decorator);
> RenderQueueImpl renderQueue = new RenderQueueImpl(logger);
> renderQueue.push(renderCommand);
> renderQueue.run(markupWriter);
>
> environment.pop(ValidationDecorator.class);
> return markupWriter.toString().replaceAll("^\\n+",
> "").replaceAll("\\n+$", "");
> }
>
> Best regards
> and thanks... KEN
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com