The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

smosindi (3) [Avatar] Offline
#1
I have read the thread about avoiding xml because of its performance problems, but i need to implement xml passing between a j2ee server and a client built with GWT because the client might change in the near future so i want to have the server receive requests and send responses in xml format. The truth is i am not sure how to go about this, i know the RequestBuilder only handles textual data, and im not sure if i convert the generated xml data to string and pass it to the client if that will work. I also have EJB on the server side, is there anyway i can get GWT to interact with the remote interface of the EJB because i want to take advantage of the EJB container transaction management. Please your reply will be highly appreciated..Thank you
robert.hanson (173) [Avatar] Offline
#2
Re: Sending xml
> RequestBuilder only handles textual data, and im not sure if
> i convert the generated xml data to string and pass it to the client
> if that will work

Sure, you can pass the XML both ways using RequestBuilder, and use the XML parser that comes with GWT to parse it.

> is there anyway i can get GWT to interact with the remote interface of the EJB

I know pretty much nothing about EJB, so I don't have any ideas.
smosindi (3) [Avatar] Offline
#3
Re: Sending xml
Thank you for your reply, but im still thinking if you have any ideas concerning how an architecture using gwt for the client and j2ee on the server should look like. Thank you
smosindi (3) [Avatar] Offline
#4
Re: Sending xml
i also wanted to ask if it is possible to use a third party java library while writing the code the in java in gwt. would it work when converted to java script?
adam.tacy (269) [Avatar] Offline
#5
Re: Sending xml
> i also wanted to ask if it is possible to use a third
> party java library while writing the code the in java
> in gwt. would it work when converted to java script?

Yes you can; for the server side there are zero problems. For the client side, yes you can in theory, but in practice it may not be that easy, since the library must also follow the same rules that the code you write needs to. Namely, it must:

a) have the source code available (GWT needs the source to build from)
b) only use Java components that are currently within GWT's Java Emulation library (http://code.google.com/webtoolkit/documentation/jre.html)
c) stick to Java 1.4 syntax (at least until GWT 1.5 comes out)

Points b and c are likely to be your sticking points in using a 3rd party Java library since you do not control what is in the library.

You can check for point c by looking at the source code, if it looks ok, I would suggest using it to see point b is met - but definitely check web mode early in your development just to make sure there are no differences from hosted mode in the libraries use. There shouldn't be, but I am sure I have seen examples of differences on the gwt forum, and itt would not be good to get a way down development to find out what seemed OK with the library in hosted mode breaks in web mode.

Good luck!

//Adam