Links from static html in Grails -
Links from static html in Grails -
my app renders html, created external programme , placed in folder outside app (so wouldn't disappear after redeployment), , html contains links other files in folder. can alter links, how them work?
this how html rendered now:
def url = createlink(controller: 'job', action: 'renderresults', params: [resultspath:resultspath]) render(contenttype: 'text/html', text: "<script>window.location.href='$url'</script>") .. def renderresults (string resultspath){ def htmlcontent = new file(resultspath).text render (text: htmlcontent, contenttype:"text/html", encoding:"utf-8") } this 1 not work (suppose renderimage ok)
<a href="${createlink(controller : 'job', action:'renderimage', params: [imagepath:'c:/users/../image.jpg'])}">link</a> even if seek render html in gsp view:
def url = createlink(controller: 'job', action: 'renderresults', params:[resultspath:resultspath]) render(view:"index/results", text: "<script>window.location.href='$url'</script>") with {$text} in results.gsp.
all may seem crazy, please don't hesitate tell me - i'm newbie.
upd: question vague, i'll seek sum up: there way create link html resource located outside app? dynamic grails links not work in html - guess, because not view. , simple static links (like "/home/images/test.img", "../../images/test.img") inevitably lead somewhere app folder.
grails
Comments
Post a Comment