RE: Detrmining which module from within JSP
Hey All! Just for the record, (Incorrect) ^^ Along a similar note, how would one work out the name of the tile definition being processed ? Any ideas ? TIA, Kunal -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, 19 April 2004 16:03 To: Struts Users Mailing List Subject: Re: Detrmining which module from within JSP Kunal H. Parikh wrote: >Hi All! > >Craig's suggestion works great! > >However, it appears to me that dot delimited request variable names don't >work with the JSTL. > >Eg: > > > >The above prints nothing and therefore a .prefix also fails. > >Does anyone know if this is a JSTL bug, or is there something that needs to >change in struts? > >Or is there something I am doing incorrectly? > > > This isn't a bug, it's a feature :-). Actually, this happens because the "." character is an operator in the EL syntax, so it can't be used literally in an expression. Try something like this: The prefix is instead. This works because the "." operator and the "[...]" bracket syntax are treated identically in the EL syntax, just as they are in JavaScript. Therefore, you have to enclose the string constant that includes periods in quotes to make things work as you expect. >TIA, > >Kunal > > > Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Detrmining which module from within JSP
Kunal H. Parikh wrote: Hi All! Craig's suggestion works great! However, it appears to me that dot delimited request variable names don't work with the JSTL. Eg: The above prints nothing and therefore a .prefix also fails. Does anyone know if this is a JSTL bug, or is there something that needs to change in struts? Or is there something I am doing incorrectly? This isn't a bug, it's a feature :-). Actually, this happens because the "." character is an operator in the EL syntax, so it can't be used literally in an expression. Try something like this: The prefix is instead. This works because the "." operator and the "[...]" bracket syntax are treated identically in the EL syntax, just as they are in JavaScript. Therefore, you have to enclose the string constant that includes periods in quotes to make things work as you expect. TIA, Kunal Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Detrmining which module from within JSP
Hi All! Craig's suggestion works great! However, it appears to me that dot delimited request variable names don't work with the JSTL. Eg: The above prints nothing and therefore a .prefix also fails. Does anyone know if this is a JSTL bug, or is there something that needs to change in struts? Or is there something I am doing incorrectly? TIA, Kunal -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Sunday, 18 April 2004 10:17 To: Struts Users Mailing List Subject: Re: Detrmining which module from within JSP Josh Holtzman wrote: >Hello, > > > >Can anyone suggest a means to determine the current struts application >module from within a JSP? > As long as you have correctly gone through an action first, the ModuleConfig object for the selected module has been stored as a request attribute under the key "org.apache.struts.action.MODULE" (from Java code, you would use Globals.MODULE_KEY to reference this string). So, you could say something like this in a JSP page: The current module prefix is The Javadocs for org.apache.struts.Globals describe many other attribute names that Struts uses to store interesting things while processing a request. > > > > >Would it be possible to use a Bean or Logic tag to make this determination? > > > >Thanks again for any suggestions. > > > >Regards, > > > >Josh Holtzman > > > Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Detrmining which module from within JSP
Josh Holtzman wrote: Hello, Can anyone suggest a means to determine the current struts application module from within a JSP? As long as you have correctly gone through an action first, the ModuleConfig object for the selected module has been stored as a request attribute under the key "org.apache.struts.action.MODULE" (from Java code, you would use Globals.MODULE_KEY to reference this string). So, you could say something like this in a JSP page: The current module prefix is The Javadocs for org.apache.struts.Globals describe many other attribute names that Struts uses to store interesting things while processing a request. Would it be possible to use a Bean or Logic tag to make this determination? Thanks again for any suggestions. Regards, Josh Holtzman Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Detrmining which module from within JSP
Hello, Can anyone suggest a means to determine the current struts application module from within a JSP? Would it be possible to use a Bean or Logic tag to make this determination? Thanks again for any suggestions. Regards, Josh Holtzman American Data Company [EMAIL PROTECTED] Voice: (310) 470-1257 Fax:(310) 362-8454 Sun Microsystems iForce Partner