tomcat - grails resource tags creating duplicate app context in link -


at times, our code has need create links resources. when happens, looks following:

<link rel="stylesheet" type="text/css"  href="${resource(dir: '/css/', file: 'uxdashboard-pdf.css') }" media="all"/> 

however, creates link looks following (note duplicate app context)

<link href="/ici/ici/css/uxdashboard-pdf.css" media="all" 

we not have grails.serverurl or grails.app.context defined. have app.name='ici' set in application.properties.

we deploy using tomcat set autodeploy="true" should create application context of 'ici' based on war file name.

i not sure second app-context coming from. should not setting app.name in application.properties? specify 'base' parameter, prefer understand duplicate context coming before try work around it.

we use apache our front end document server, , apache seems able handle these links see 200 codes returned them. have plugin pdf generation, , suspect not finding css file because of link.

thanks!

i'm answering own question in case else runs situation. turns out double /<appcontext>/<appcontext> caused grails.resources.uri.prefix ="ici".

we use resources plugin, integrated g:resource tag. resources plugin automatically adds /static/ directory when forming urls. don't use static subdirectory , grails.resources.uri.prefix allows 1 override it. setting empty string didn't work, apache can handle <appcontext>/<appcontext>. need in pdf generation case rewrite 1 link.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -