You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Varley, Roger" <Ro...@atosorigin.com> on 2004/09/09 12:54:31 UTC

Struts-Config.XML and script variables

Hi

As a "newbie" to Struts I apologise in advance if this is a really stupid question.
I am surprised that I am encouraged to use pre-defined constants for my action forwards in my java actions, but I cannot use these constants in the <forward> tag of the struts-config.xml. Indeed, everything within the Struts-Config file appears to need to be hardcoded in that file. I was wondering as to whether it would be possible to extend the base ActionServlet class to include a Groovy interpretter that could be passed Groovy scripts during initialisation that would pass the values as if they'd been coded in the traditional manner. This would then allow me, for example, to write my <forward> tags something along the lines of <forward name="<groovyScript>myCONSTANTS.add</groovyScript>" path="path/to/wherever"</forward>. In addition, I could then draw values from any legal Groovy (read java) construct.

Now, as a newbie to both Struts and Groovy, I'm reasonably sure that this sort of thing would be possible, but I'm less convinced that it would be reasonable to do so. Whilst I can see the advantage of having "scripting" available, I can also see the downside of loosing what is, essentially, a self documenting format. So, before I go charging off, has anyone tried this type of thing been done already and, if not, has it already been considered and discarded as a really bad idea?

Regards
Roger


__________________________________________________________________________
This e-mail and the documents attached are confidential and intended 
solely for the addressee; it may also be privileged. If you receive this 
e-mail in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin group 
liability cannot be triggered for the message content. Although the 
sender endeavours to maintain a computer virus-free network, the sender 
does not warrant that this transmission is virus-free and will not be 
liable for any damages resulting from any virus transmitted.
__________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org