Thursday, September 9, 2010

Re: Translating already compiled Java?

I have been battling this issue for a while and the solution really
depends on your architecture. The question is are they truly POJOs or
do they have JAXB annotations? If they have JAXB annotations GWT will
blow up, if not you can trick the GWT compiler into letting you use an
external library, but you will also need a jar with the source in the
classpath of the GWT compile too. Lets assume the following package
structure:

POJOs: // you will need your ejb jar and a jar that contains the
source, but the source is only needed for the ejb compilation(you
might even be able to get away with just pointing to the src dir in
the classpath of the compile)
com.example.ejb.entity

GWT:
com.example.gwt
EntryPointModule.gwt.xml // include
com.example.ejb.PojoResourceModule
com.example.ejb
PojoResourceModule.gwt.xml // add this file
to allow you to include the pojos as a module, this should have
<source>entity</source>

On Sep 8, 3:56 am, Gary Madden <garymad...@gmail.com> wrote:
> Hello,
>
> Sorry if this is a silly question but I was wondering whether it's
> possible to get the GWT compiler to translate already compiled Java
> code into JavaScript? I know that you can specify Java source code to
> translate using the <source> elements in the XML module file. The
> reason is, I have a JAR that is generated from a WSDL. My GWT web app
> makes SOAP requests using this JAR. There is a problem in that I have
> to write a lot of classes at the moment that basically replicate the
> POJOs in the JAR just so they can be used in GWT. This may lead to
> bugs where not all the fields are properly set from the SOAP objects.
> In fact, I've already found and fixed quite a few bugs relating to
> this.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment