On May 5, 12:50 am, Mike <[email protected]> wrote:
> Hi guys,
>
> I have the Generator bellow working perfectly on hosted mode inside
> eclipse but now I'm trying generate one .war to deploy on tomcat. The
> tomcat start normally without any error on log messages but my
> Generator does nothing.
>
>         <generate-with
> class="br.com.mycompany.generator.PresenterFactoryGenerator">
>                 <when-type-assignable
> class="br.com.mycompany.client.generator.PresenterService" />
>         </generate-with>
>
> public interface PresenterService {
>    public Presenter newPresenter(Class class);
>
> }
>
> public class MyServiceFactory implements PresenterService {
>    public Presenter newPresenter(Class class) { return null }
>
> }
>
> public class PresenterFactoryGenerator extends Generator {
>    // at the end, creates a class to return dynamically any presenter
> that I want  ;
>
> }
>
> PresenterService service = GWT.create(MyServiceFactory .class);
> MyPresenter presenter = service.newPresenter( someClazz );
>
> My Presenter comes null on web mode. I took too long to realize this
> because works perfectly inside Eclipse.
>
> PS: I have gwt-servlet.jar on my lib directory.
>
> Any help? I'm really lost here.

Passing the -gen argument (e.g. "-gen gen") to the Compiler will
output the generated files into the given directory ("gen" in my
example) so you can explore what your generator outputs and eventually
find out why it fails.

Beware of using Class<?> on the client side though... IMO, you'd
better generate one method per specific class you need (public
SomeClass newSomeClassPresenter() { ... }) instead of relying on
Class<?>.
Compile in Pretty or Detailed style and look at the generated JS code.

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

Reply via email to