You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Todor Sergueev Petkov <t....@basalmed.uio.no> on 2003/10/14 11:59:55 UTC
Drop down boxes
Hello every body,
any suggestions on the following :
1. I use a drop down box associated with a Struts LookupDispatchAction.
2. I Have another textfield form associated with the same action on the
same page.
3. I would like when users selects something in the drop down box the
text field to be updated with the selection from the ddb- > a.k.a the
page has to be redisplayed...
Anyone has done something similar before?
Thanks, Todor
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
[SOLVED] Drop down boxes
Posted by Todor Sergueev Petkov <t....@basalmed.uio.no>.
Todor Sergueev Petkov wrote:
> Hello every body,
> any suggestions on the following :
>
> 1. I use a drop down box associated with a Struts LookupDispatchAction.
> 2. I Have another textfield form associated with the same action on the
> same page.
> 3. I would like when users selects something in the drop down box the
> text field to be updated with the selection from the ddb- > a.k.a the
> page has to be redisplayed...
>
> Anyone has done something similar before?
>
> Thanks, Todor
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Accessing Application Ressources
Posted by Kris Schneider <kr...@dotech.com>.
Doesn't MessageResourcesConfig.getParameter give you the bundle basename? So, if
you're in an action, you could do:
ModuleConfig moduleConfig = mapping.getModuleConfig();
MessageResourcesConfig messageConfig =
moduleConfig.findMessageResourcesConfig(Globals.MESSAGES_KEY);
String bundleBasename = messageConfig.getParameter();
Quoting "Craig R. McClanahan" <cr...@apache.org>:
> Todor Sergueev Petkov wrote:
>
> > Hello,
> > does anybody know how, from a Struts Action class I can
> > access the name of the Application Ressources file defined inside
> > web.xml. Or is there a simpler way to access directly the properties,
> > one by one from the properties file?
>
>
> To find out the *name* of the application resources file, you would have
> to parse the struts-config.xml file yourself, looking for the
> appropriate <message-resources> element. To access the actual entries,
> an instance of MessageResources containing them is stored as a servlet
> context attribute under the "key" that you specify (the default is
> "org.apache.struts.action.MESSAGE"). The standard MessageResources
> implementation class does not offer an iterator over the message keys,
> but you could subclass it fairly easily and add such a method.
>
> >
> > Thanks,
> > Todor
>
>
> Craig
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Accessing Application Ressources
Posted by "Craig R. McClanahan" <cr...@apache.org>.
Todor Sergueev Petkov wrote:
> Hello,
> does anybody know how, from a Struts Action class I can
> access the name of the Application Ressources file defined inside
> web.xml. Or is there a simpler way to access directly the properties,
> one by one from the properties file?
To find out the *name* of the application resources file, you would have
to parse the struts-config.xml file yourself, looking for the
appropriate <message-resources> element. To access the actual entries,
an instance of MessageResources containing them is stored as a servlet
context attribute under the "key" that you specify (the default is
"org.apache.struts.action.MESSAGE"). The standard MessageResources
implementation class does not offer an iterator over the message keys,
but you could subclass it fairly easily and add such a method.
>
> Thanks,
> Todor
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Accessing Application Ressources
Posted by Todor Sergueev Petkov <t....@basalmed.uio.no>.
Hello,
does anybody know how, from a Struts Action class I can
access the name of the Application Ressources file defined inside
web.xml. Or is there a simpler way to access directly the properties,
one by one from the properties file?
Thanks,
Todor
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org