The server-side code
The server-side servlet must extend RemoteServiceServlet, remember?
However, to allow a JSP to be the servlet servicing the RPC request, the JSP must implement the HttpJspPage interface. JspServiceBeanable, which does that, is an abstract class (provided by the courtesy of this author) to be extended by a JSP.
package org.synthful.gwt.http.servlet.server; ... import com.google.gwt.user.server.rpc.RemoteServiceServlet; abstract public class JspServiceBeanable extends RemoteServiceServlet implements HttpJspPage { ....protected String doJspService( HashMap<String, String> parameters) { this.parameters = new Hashtable<String, String>(parameters); JspFactory.setDefaultFactory(new JspFactoryShunt()); this.jspFactory = JspFactory.getDefaultFactory(); try{ this._jspService( this.getThreadLocalRequest(), this.getThreadLocalResponse()); } catch (Exception e){ e.printStackTrace(); } this.jspContext.popBody(); return this.jspOut.Body.toString(); }.... }
But, wait another minute. Shouldn't it also implement HashedParameterService in order to recognise the HashMap datatype being passed by the RPC requester?
Wokay dokay, here's JspServiceParametricBeanable, the abstract class to be extended by any JSP with ambitions to service an RPC request that comes with a HashMap argument. It over-rides the empty doServiceResponse method in GWT-supplied RemoteServiceServlet so that instead of ignoring the response output, it diverts RemoteServiceServlet to perform doJspService mandated by HttpJspPage interface.
package org.synthful.gwt.http.servlet.server; import java.util.HashMap; abstract public class JspServiceParametricBeanable extends JspServiceBeanable { public String doServiceResponse( HashMap<String, String> parameters){ return this.doJspService(parameters); } }
Oopsie doops, wait one more final minute. Shouldn't the JSP implement TableMgrService which the application-specific client-side in the previous page has required to define the target URL? So here's the actual abstract class to be implemented by the RPC service JSP.
package com.blessedgeek.gwt.gdata.server; import org.synthful.gwt.http.servlet.server. JspServiceParametricBeanable; import com.blessedgeek.gwt.gdata.client.TableMgrService; abstract public class TableMgrServiceImplJspBeanable extends JspServiceParametricBeanable implements TableMgrService{}
So here's the header for TableActionService.gwtrpt.jsp as targeted by TableMgrService interface. Notice that it extends TableMgrServiceImplJspBeanable.
<%@ page language="java" extends="com.blessedgeek.gwt.gdata.server. TableMgrServiceImplJspBeanable" import=" com.blessedgeek.gwt.gdata.client.TableMgr, com.blessedgeek.gwt.gdata.server.MrBean, .... com.google.gdata.data.spreadsheet.Column, com.google.gdata.data.spreadsheet.Field"%>
When using JspServiceBeanable as the means to allow JSPs to be used as GWT RPC service responders, the servicing JSP name must end with ".gwtrpc.jsp". JspServiceBeanable detects that a JSP is a GWT RPC service responder by detecting if its name ends of ".gwtrpc.jsp".
Continue next GWT RPC - How Server-side JSP Service Works
Coach Outlet Usa
ReplyDeleteCoach Bags Outlet
Coach Sale
Coach Outlet Sale
Coach Bags For Cheap
Coach Bags On Sale At Outlet
Coach Outlet Near Me
Coach Name Change
Coach Store
Coach Tote
Black Coach Purse
Outlet Michael Kors
MK Purses Clearance
Michael Kors Outlet Sale
Michael Kors Bags On Sale Amazon
Amazon Michael Kors Bags
Michael Kors Tote Sale
Cheap MK Bags
MK Handbags Sale
Michael Kors Outlet Online
MK Bags On Sale
Cheap Michael Kors
Cheap Michael Kors Handbags
The best house cleaning company in Khobar
ReplyDeleteHome cleaning company in Fujairah is one of the best companies that provide services to its customers in terms of modern equipment and advanced labor and detergents that are imported from abroad free of chemicalsشركة النجوم لخدمات التنظيف
شركة تنظيف فلل بجدة
شركة تنظيف بيوت بجدة
شركة تنظيف شقق بجدة
ReplyDeletehttps://www.bfirstseo.com/تسليك-مجارى-بالرياض/
Cleanliness is from faith andit is one of the necessary things that must be taken care of. Life without hygiene becomes full of epidemics and diseases, and from here all housewives care about cleanliness and use a cleaning company to help them in all house cleaning operations
ReplyDeleteشركة تنظيف ببريدة
شركة تنظيف مجالس ببريدة
شركة مكافحة حشرات ببريدة
شركة نقل عفش ببريدة
شركة كشف تسربات المياه ببريدة