views:

410

answers:

3

Hi all

Wonder if anyone has come accross this problem. I have created a demo portlet using the grails portlet and liferay plugins.

After installing the grails plugins in a project i simply ran the following commands

grails create-portlet MyFirst

grails generate-portlet-views MyFirst

grails liferay-deploy

The portlet deploys fine. However when i try to add the portlet to a page then i get the following stacktrace. Anyone have any ideas ?

23:04:52,134 ERROR [jsp:165] javax.servlet.ServletException: File "/WEB-INF/grails-app/views/myfirst/render.jsp" not found

I am running liferay version 5.2.3 that has tomcat version 6.0.18 embedded. I am also using JVM 1.6

thanks in advance.

A: 

It looks like it's not able to find render.gsp (the default gsp for a porltet if no mode specific view is found).

What did generate-portlet-views generate for you?

leebutts
Hi LeeSuper quick response. So the generate-portlet-views command generated these three gsp's:grails-app/views/myFirst/edit.gspgrails-app/views/myFirst/view.gspgrails-app/views/myFirst/help.gspno render.gspIf i create render.gsp manually do you think this will fix the problem ?
Peter Delahunty
I tried to add render.gsp manually but it did not work.
Peter Delahunty
Hmmm, it should be in View mode by default so should be using view.gsp.When I was working on the plugin it was only using Pluto, Kenji has taken it a lot further since then and has a lot more experience with Liferay. You could try getting in touch with him on the mailing list (I don't think he reads SO) or directlycheersLee
leebutts
+3  A: 

Hi,

The current versjon of the Grails portlet plugin (0.7) doesn't support portletnames with capital cases. Change MyFirst to myfirst and it will work like a charm (well, almost ;)

Regards Armaz

Armaz Mellati
A: 

Take a closer look to your stacktrace - it attempts to look for render.jsp, not gsp. render.jsp is the default template LR attempts to find if it does not find what it is looking for depending on the action.

Read Armaz's answer, he is correct. You must change template folder name to lower case: myFirst => myfirst.

The next problem you might experience is solved here: http://stackoverflow.com/questions/2254139/grails-liferay-portlet-not-invoking-action ;)

heikkim