-- Dear GWT Users,
Many thanks in advance for any help and advice. Very much appreciated!
I have a legacy application: java Swing client with XML based Servlet communication (request and response).
The server comprised of aroMany thanks in advance for any help and advice. Very much appreciated!
I have a legacy application: java Swing client with XML based Servlet communication (request and response).
und 10 Servlets, one 'Front Controller' that forwarded (RequestDispatcher ) to other Servlets depending on the initial XML request from client. These delegated Servlets did everything (parsed XML, db queries, session data, etc).
I decided move java swing client to gwt. Also move from XML to gwt rpc. Ideally I dont want to rewrite the whole server again (even thought it just talks in XML / Strings).
I thought I could just forward my request from my main RemoteServiceServlet class, on to my 'legacy' XML servlets.
I thought I could just forward my request from my main RemoteServiceServlet class, on to my 'legacy' XML servlets.
What do I have so far?
A working GWT client, making RPC calls to my RemoteServiceServlet.
Successfully set session data and forward on to a e.g. LoginServlet.
LoginServlet queries db and updates session data.
LoginServlet queries db and updates session data.
Read updated session data in RemoteServiceServlet.
For example:
RemoteServiceServlet
getThreadLocalRequest().getSession().setAttribute("username", username);
requestDispatcher = getThreadLocalRequest().getRequestDispatcher("/LoginServlet");
requestDispatcher.forward(getThreadLocalRequest(), getThreadLocalResponse());
LoginServlet
String username = (String) session.getAttribute("username");
// do some db stuff & set new session data
session.setAttribute("userEmail", userEmail);
RemoteServiceServlet
getThreadLocalRequest().getSession().getAttribute("userEmail")
This seems very convoluted and hacky, and not scalable for the amount of work done in my 'legacy' servlets. Is there a better way?
Can I have multiple servlets extend RemoteServiceServlet?
Whats the best way to implement a 'front controller' style architecture with gwt?
Whats the best way to integrated multiple legacy XML servlets with a GWT facade / front controller?
My legacy servlets just read and write a lot of XML, for example
<MFRequest>
<Request type='SaveSettings' data=''/>
<UserPrefs download_pref='../' email_pref='yes' decompress_pref='no' password_pref='no'/>
</MFRequest>
I have a lot of XML data, session data and file upload / download data (hence have these split up in to different servlets).
Anyway- hope this gives an overall picture of my project / problem(s).
Regards, Sam
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment