Fwd: GSParse works on localhost but not on server

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: GSParse works on localhost but not on server

Owen Rubel

Am running GSParse  on localhost using 'grails run-app' and it runs great 'http:localhost:8080/
nosegrind/' but when I put the war up on the server (http://www.nosegrind.net) it can't find anything.

I followed guide:

Urlmapping has:
"/resource/$path**" (controller:'script',action:'parse')

and my layout is pointing to files and able to pull them up just fine:

<g:ifAnyGranted role="ROLE_ROOT">
    <div id="extruderLeft" class="{title:'Tracker', url:'${g.resource(dir:'parts',file:'tracker.html')}'}"></div>
    <div id="extruderLeft1" class="{title:'Admin', url:'${g.resource(dir:'parts',file:'admin.html')}'}"></div>
</g:ifAnyGranted>

<g:isLoggedIn>
    <div id="extruderLeft2" class="{title:'User', url:'${g.resource(dir:'parts',file:'logged_in_user.html')}'}"></div>
</g:isLoggedIn>

<g:isNotLoggedIn>
    <div id="extruderLeft2" class="{title:'User', url:'${g.resource(dir:'parts',file:'logged_out_user.html')}'}"></div>
</g:isNotLoggedIn>

<div id="extruderLeft3" class="{title:'Blog', url:'${g.resource(dir:'parts',file:'post.gsp')}'}"></div>
<div id="extruderLeft4" class="a {title:'About', url:'${g.resource(dir:'parts',file:'about.html')}'}"></div>


But inside those files, I can't make reference to GSP code or even do it via GSParse; it just shows the raw code in the URL or in the browser. Any help at all would be appreciated because I don't understand why this works on the localhost with run-app.




Reply | Threaded
Open this post in threaded view
|

Re: Fwd: GSParse works on localhost but not on server

pmcneil
In case anyone else is interested there are a couple of things possible here:

1. the urls like ${g.resource(dir:'parts',file:'admin.html')} need to have resource/ to make them map to the url mapping e.g. ${g.resource(dir:'resource/parts',file:'admin.html')}
2. if the file is not found on the server and you set log level to debug you can see a log message from the gsparse script controller saying the resouce was not found.
3. if you run UIPerformance plugin or similar 'static' content cache you need to make sure the non-static GSParsed files can get through - or not use the UIPerformance plugin

On 20/02/11 10:43, Owen Rubel wrote:

Am running GSParse  on localhost using 'grails run-app' and it runs great 'http:localhost:8080/
nosegrind/' but when I put the war up on the server (http://www.nosegrind.net) it can't find anything.

I followed guide:

Urlmapping has:
"/resource/$path**" (controller:'script',action:'parse')

and my layout is pointing to files and able to pull them up just fine:

<g:ifAnyGranted role="ROLE_ROOT">
    <div id="extruderLeft" class="{title:'Tracker', url:'${g.resource(dir:'parts',file:'tracker.html')}'}"></div>
    <div id="extruderLeft1" class="{title:'Admin', url:'${g.resource(dir:'parts',file:'admin.html')}'}"></div>
</g:ifAnyGranted>

<g:isLoggedIn>
    <div id="extruderLeft2" class="{title:'User', url:'${g.resource(dir:'parts',file:'logged_in_user.html')}'}"></div>
</g:isLoggedIn>

<g:isNotLoggedIn>
    <div id="extruderLeft2" class="{title:'User', url:'${g.resource(dir:'parts',file:'logged_out_user.html')}'}"></div>
</g:isNotLoggedIn>

<div id="extruderLeft3" class="{title:'Blog', url:'${g.resource(dir:'parts',file:'post.gsp')}'}"></div>
<div id="extruderLeft4" class="a {title:'About', url:'${g.resource(dir:'parts',file:'about.html')}'}"></div>


But inside those files, I can't make reference to GSP code or even do it via GSParse; it just shows the raw code in the URL or in the browser. Any help at all would be appreciated because I don't understand why this works on the localhost with run-app.






-- 
web: http://nerderg.com
Twitter: http://twitter.com/pmcneil