Sunday, September 4, 2011

Re: GWT : How to call SERVLET FROM GWT_SERVLET and How to return value from target servlet to source servlet?

you can put those code in client side AsyncCallback method body, that mean AsyncCallback impl == BasicServiceImpl .

From: vaibhav gwt <bhalke.vaibhav@gmail.com>
To: Google Web Toolkit <google-web-toolkit@googlegroups.com>
Sent: Friday, September 2, 2011 3:52 PM
Subject: Re: GWT : How to call SERVLET FROM GWT_SERVLET and How to return value from target servlet to source servlet?

Thanks for reply
In your provided code , you are calling TargetServlet from client.
I  want to call targetServlet from BasicServiceImpl(GWT Servlet).



On Sep 1, 6:41 am, Abduxkur Ablimit <sugar...@yahoo.com> wrote:
> you can call a servlet from client side like this (may be you want put these code into AsyncCallback method body, from gwt servlet):
>
>         btn.addClickHandler(new ClickHandler(){
>             public void onClick(ClickEvent event) {
>                final String link = GWT.getModuleBaseURL() +
> "someServlet?year="+year.getValue(year.getSelectedIndex())+"&month="+month.getValue(month.getSelectedIndex());
>                 RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,link);
>                 try {
>                
>      builder.sendRequest(null, new RequestCallback() {
>                         @Override
>                         public void onResponseReceived(Request request,
>                                 Response response) {
>                             if (response.getStatusCode() == 200) {
>                                // response.getText();
>                              } else if (response.getStatusCode() == 404) {
>                                 Window.alert("Service not available.");
>                             }
>                        
>  }
>                         @Override
>                         public void onError(Request request, Throwable exception) {
>                             Window.alert("Service not available.");
>                         }
>                     });
>        
>          } catch (RequestException re) {
>                     GWT.log("Error", re);
>                 }
>             }
>         });
>
> ________________________________
> From: vaibhav bhalke <bhalke.vaib...@gmail.com>
> To: google-web-toolkit@googlegroups.com
> Sent: Wednesday, August 31, 2011 4:30 PM
> Subject: GWT : How to call SERVLET FROM GWT_SERVLET and How to return value from target servlet to source servlet?
>
> I have 2 servlets.
> One In GWT module i.e BasicServiceImpl extends RemoteServiceServlet implements BasicMassUpdateService
> and other servlet TargetServlet extends HttpServlet in TargetServlet in diff module/package com.comp.server.servlets
> I am using GWT-RPC in my gwt module. I want to write one method
> getRecordList() in BasicServiceImpl which returns list of record on
> client side.(right now I am sending dummy data in record list)
> In other servlet i.e TargetServlet RecordList formed from database value.
> Use case:
> When we call getRecordList() method using rpc then I want to call
> SERVLET : TargetServlet to get recordlist, TargetServlet will return
> recordlist to getRecordList of Gwt_servlet and finally getRecordList()
> returns recordlist on client side
> 1: How to call other servlet(TargetServlet) from GWT_SERVLET i.e BasicServiceImpl
> 2: How to send recordlist from TargetServlet to getRecordList() of BasicServiceImpl(GWT SERVLET)
> Any help or guidance in this matter would be appreciated
>
> --
> Best Regards,
> Vaibhav
>
> --
> 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 athttp://groups.google.com/group/google-web-toolkit?hl=en.

--
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