Forums

RSS RSS
GWT integration with Liferay Flat View
Threads
GWT integration with Liferay
6/24/08 12:46 PM
Hi Everyone,
Recently i have been trying to integrate GWT (Goolge WebToolkit) and Liferay, and i have succeeded in achieving that. I extended the GWT to now include server side call ups using RPC and i ran into some difficulties, the problem is that the portlet created by Liferay SDK creates a web.xml file that looks like this:

<web-app>
<display-name>gwt-portlet</display-name>
<listener>
<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>gwtportlet</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>com.sample.jsp.portlet.JSPPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>gwtportlet</servlet-name>
<url-pattern>/gwtportlet/*</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
</web-app>

Note the url-pattern tag where there is a back slash to the context.

and my own GWT url-pattern is "/bbtservice" defined in the GWT's module's xml file. When my GWT makes a call to the server instead of passing "http://localhost:8080/gwtliferay/bbtservice", it passes "http://localhost:8080/gwtliferay//bbtservice" (note the double slash) and this doesn't resolve to my server implementation class.
My question then is, has anybody encountered such a problem or can anyone please tell me how to make Liferay resolve the URL as i want it ("http://localhost:8080/gwtliferay/bbtservice").

NB: If i can fix this i would be publishing the steps i took for the integration on this forum. Thanks for your help.

Nnamdi.
Flag Flag
RE: GWT integration with Liferay
6/26/08 11:20 AM as a reply to Nnamdi Afamefuna Jibunoh.
Hi everyone,

Please is there anyone out there that can help it is really urgent for me, Pleasee.

Regards

Nnamdi Jibunoh.
Flag Flag
RE: GWT integration with Liferaye had
7/7/08 10:22 AM as a reply to Nnamdi Afamefuna Jibunoh.
I agree it would be great to see these two technologies work together!

Anyone had any success with it?
Flag Flag
RE: GWT integration with Liferaye had
7/8/08 5:05 AM as a reply to Adam T.
Hi Everyone,
For anyone that might be interested, here are the steps to integrate a GWT client only code into Liferay as a portlet.

1) write your normal GWT code and compile to javascript and HTML (by running the compile batch file)
2) Generate your liferay portlet using the plugins SDK from liferay download section. Instruction on using the SDK can be found in the wiki.
3) The generated portlet from step 2 has a view.jsp file, open the file in any editor and using normal JSP page import tag, import the <your.module.name>.html.
4) Since you are using the SDK the generated folder is fully compactible with liferay, so run the war ant target (if yo haven't already) to generate the war file and deploy the result into liferay using the plugin installer.

Like i said this can only work if you have just a client based GWT project, where i got stuck was using GWT's RPC mechanism. I figure that using struts i should be able to fix it, but unfortunately i havent used struts before and i had a very strict project timeline to deliver, so i abandoned GWT's route for now. I would post updates as i get them. Cheers.

Regards
Nnamdi.
Flag Flag
RE: GWT integration with Liferaye had
11/18/08 5:59 AM as a reply to Nnamdi Afamefuna Jibunoh.
Did anyone succeed in getting the server side code of a GWT example (e.g. StockWatcher) running?
Thats where I'am stuck right now, I'd really appreciate any help on this subject :-)

best regards!

Chris
Flag Flag
RE: GWT integration with Liferaye had
3/6/09 9:40 AM as a reply to Christoph Sauer.
Christoph Sauer:
Did anyone succeed in getting the server side code of a GWT example (e.g. StockWatcher) running?
Thats where I'am stuck right now, I'd really appreciate any help on this subject :-)


This should help. http://xantorohara.blogspot.com/2007/07/portlets-and-gwt.html

Did you guys have problems with the page going blank when you first added your GWT portlet? If not could you please send me your code? Right now I am having the problem that when I first drag my portlet on to the page, it is trying to request the <hash>.cache.js files from the wrong location on the server(/web/guest), but when I leave the site and come back it is working fine and loading the scripts from the right place(/GWTTest).
Flag Flag
RE: GWT integration with Liferaye had
5/18/09 3:34 AM as a reply to Matt Fetig.
Hello Matt. I have the same problem too. I got blank page only for first time after a gwt portlet was added.

Did you find how to fix it?

Regards.
Flag Flag