Forums

Home » Liferay Portal » English » 3. Development »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nnamdi Afamefuna Jibunoh
GWT integration with Liferay
June 24, 2008 12:46 PM
Answer

Nnamdi Afamefuna Jibunoh

Rank: New Member

Posts: 3

Join Date: June 24, 2008

Recent Posts

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.
Nnamdi Afamefuna Jibunoh
RE: GWT integration with Liferay
June 26, 2008 11:20 AM
Answer

Nnamdi Afamefuna Jibunoh

Rank: New Member

Posts: 3

Join Date: June 24, 2008

Recent Posts

Hi everyone,

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

Regards

Nnamdi Jibunoh.
Adam T
RE: GWT integration with Liferaye had
July 7, 2008 10:22 AM
Answer

Adam T

Rank: Junior Member

Posts: 34

Join Date: June 12, 2007

Recent Posts

I agree it would be great to see these two technologies work together!

Anyone had any success with it?
Nnamdi Afamefuna Jibunoh
RE: GWT integration with Liferaye had
July 8, 2008 5:05 AM
Answer

Nnamdi Afamefuna Jibunoh

Rank: New Member

Posts: 3

Join Date: June 24, 2008

Recent Posts

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.
Christoph Sauer
RE: GWT integration with Liferaye had
November 18, 2008 5:59 AM
Answer

Christoph Sauer

Rank: New Member

Posts: 15

Join Date: November 18, 2008

Recent Posts

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
Matt Fetig
RE: GWT integration with Liferaye had
March 6, 2009 9:40 AM
Answer

Matt Fetig

Rank: New Member

Posts: 4

Join Date: February 27, 2009

Recent Posts

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).