In struts 2 the
<s:propertyvalue="#pageTitle"/>
(is equivalent to...)
JSTL:${pageTitle}
I use JSTL version which is more compact.
Can we do the same thing with application messages?! To get text from message
resources we do as below:
<s:textname="label.sample"/>
Now, is there any JSTL version instead of <s:text/> ?
________________________________
Meanwhile, I tried to find a way to pass textprovider to jsp. But I could not
find a way
publicclassBaseActionSupportextendsActionSupport{//Same as
ActionSupportprivateTextProviderProvider;//with setter and
getterpublicTextProvidergetSampleTextProvider(){TextProviderFactorytpf
=newTextProviderFactory();if(container
!=null){container.inject(tpf);}returntpf.createInstance(getClass(),this);}
}
In jsp:
${provider.text("label.password")}//Error The function text must be used with a
prefix when a default namespace is not specified
~Regards,
~~Alireza Fattahi