Hey All! Just for the record, <c:out value="${requestScope['org.apache.struts.action.Module'].prefix}"/> (Incorrect) ^^^^^^ <c:out value="${requestScope['org.apache.struts.action.MODULE].prefix}"/>
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: ><c:out value="${org.apache.struts.action.MODULE}" /> ><c:out value="${requestScope.org.apache.struts.action.MODULE}" /> > >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 <c:out value="${requestScope['org.apache.struts.action.Module'].prefix}"/> 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]