Integrating GWT with an existing Struts application

344 views
Skip to first unread message

mark....@gmail.com

unread,
Jan 31, 2008, 10:49:24 AM1/31/08
to Google Web Toolkit
Hey folks,

I'm attempting to integrate GWT with an existing Struts
application we have here.
The front end is done with JSPs and struts. We currently have a jsp
page which has 6 fields.
one for the sort code for a bank and 5 read only fields that are
filled once a person enters a valid
sort code into the first field.

I've put together a dummy html with the same above in terms of 6 divs
with unique id's and a
BankSearch widget that inserts labels and textboxes into them. I've
also put together the server-side
search component, a servlet that calls on an existing service to
retrieve the banks info.

Alas, I cannot just delete the original jsp and put in my new GWT HTML
page as the jsp is incorporated
in a number of different places. Is there anyway to use the JSP page
complete with struts and jstl markup
with GWT? If anyone has any ideas that would be great.

Thanks,
Mark.

mark....@gmail.com

unread,
Jan 31, 2008, 10:57:11 AM1/31/08
to Google Web Toolkit
Apologies for this now folks,

One of the major problems I have with the GWT integration is that
I can't go re-arranging the project structure
so for instance I can't copy our current jsp file into a public
directory simply because GWT insists that I do.
I need to be able to reference where to find the jsp involved during
the gwt compilation process.


Thanks,
Mark.


On Jan 31, 3:49 pm, "mark.gar...@gmail.com" <mark.gar...@gmail.com>
wrote:
> Mark.Ap

Pavel

unread,
Jan 31, 2008, 11:09:05 AM1/31/08
to Google-We...@googlegroups.com
You don't have to copy your jsps to the public directory. You're not
required to have the public directory at all. You can add the <script
src="gwt/deployment/directory/com.myorg.gwt.MyModule"></script> tag to
any of your existing JSPs. Are you using -noserver?

Pavel

mark....@gmail.com

unread,
Feb 1, 2008, 6:03:18 AM2/1/08
to Google Web Toolkit
Hey Pavel,

I'm not using -noserver? To be honest I've only recently
started with GWT.
I'm having a huge problem injecting GWT implemented javascript into my
jsp file.
Basically I can't amend the JSP file as it's used in a number of
different applications
none of which else use GWT so I need some way of referencing a textbox
that exists
already in the jsp from within the GWT code.

I was thinking of doing something like...

Element elem = RootPanel.get("sortCode").getElement(); // where
sortCode is the unique id associated with my textbox.

Yet I can't then cast it to a TextBox in order to add a focuslistener
to it. From what I've gathered on the groups this is not
an easy task within GWT and essentially I am potentially using GWT for
the wrong reason.

If you know how to do this that would be great.

Thanks,
Mark.




On Jan 31, 4:09 pm, Pavel <pave...@gmail.com> wrote:
> You don't have to copy your jsps to the public directory. You're not
> required to have the public directory at all. You can add the <script
> src="gwt/deployment/directory/com.myorg.gwt.MyModule"></script> tag to
> any of your existing JSPs. Are you using -noserver?
>
> Pavel
>

geniot

unread,
Feb 1, 2008, 7:49:07 AM2/1/08
to Google Web Toolkit
I have seen gwt-struts integration where you create forms using gwt
and then send them to a struts action and you get the form fields
propagated there alright.
Check out this: http://cwiki.apache.org/WW/struts-2-gwt.html

Arya Kumari

unread,
Jul 17, 2015, 5:50:14 AM7/17/15
to google-we...@googlegroups.com, Google-We...@googlegroups.com
Hi Geniot,

    I have started working on GWT recently and in my project application is built up in Struts framework and i need to design frontend with GWT and reuse all the action classes from existing struts application , 
In group there are lot of discussion on this topic, but i need steps which can tell how can we call from gwt page to action class .

Any help appreciated please.
Reply all
Reply to author
Forward
0 new messages