httprequest - Grails g:if tag test request URI -


i new grails , not sure how accomplish this. dealing navigation list in gsp file. trying test whether request uri starts given string , if so, set list item active. way had seen in past this:

<li     <g:if test="${request.getrequesturi().startswith("/packagename/domaincontroller")}">         class="active"     </g:if> > <g:link controller="sectionhome" params="[section: section]" >     class home </g:link> </li> 

this model doesn't work. not sure if there tag out of order, or if there new method can't find. in advance help.

you have in gsp ${controllername} , ${actionname} can like:

<li     <g:if test="${controllername == 'mycontroller'}">         class="active"     </g:if> > 

hope helps!


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -