Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to invoke smartgwt application from customized servlet.

    Isomorphic,

    I Need to do some pre-processing before invoking smartGwt application. Now I am invoking a servlet by mentioning the below in my web.xml file

    Code:
    <servlet>
            <servlet-name>ContentResourceDataServlet</servlet-name>
            <servlet-class>com.sabre.apd.mi.smartgwt.server.servlet.UserServlet</servlet-class>
        </servlet>
    <servlet-mapping>
            <servlet-name>ContentResourceDataServlet</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
    Code:
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException
        {
            // pre process code which returns a String
            String Name ="Yathish" ;
        }
    From here how can i invoke smartGWT apllication(onModule()) Also I need to pass the output of pre procesing(Ex: String) through servlet.

    How can achieve this?
    Note: Is it having any filter concept in smartGWT?

    Thanks,
    Yathish

    #2
    http://code.google.com/webtoolkit/articles/dynamic_host_page.html#servlet

    I tried this but still no luck!! Can you please direct me to some approach?

    Comment


      #3
      This probably isn't what you want to do. Read the QuickStart Guide, Server Framework chapter, paying particular attention to the sections describing where you can insert logic into the server processing flow.

      Comment


        #4
        Isomorphic, I can communicate with server and get data from server side at any time once the module is loaded. But the scenario in my case is different.

        My GWT module would be loaded by a java application which sends a request object. I need to use the attributes/parameters of this request object in my SmartGWT application.

        How can i get this request object? I need to have some parameters of request object in my onModuleLoad() function. Let me know some approachs.

        Comment


          #5
          I have used this approach http://www.ibm.com/developerworks/java/library/j-gaej1/

          But the problem is I have 2 methods which contacts server one by data source and one by normal approach as explained in the link. The contact through data source needs a criteria object which will be set by one more contact.

          But if i debug, contact through datasource is happening first(which means it is sending empty criteria) How can i make it to wait? Is there is any priority which we can put on this?

          Comment


            #6
            We'd suggest working with a colleague to better phrase the question and posting it again, because as stated it does not appear to make sense.

            However as general pointers:
            1) external applications can contact your SmartGWT back via the RestHandler servlet (see QuickStart Guide)

            2) if you need to support a custom format that the RestHandler doesn't support, you can create a servlet that parses your custom format and use the techniques listed under the Standalone DataSource Usage topic in the "docs" package. This is a waste of time, so avoid doing it if possible

            3) you mention onModuleLoad - if you want to pass information to the start page of a GWT app you can put it in the URL as usual and the core GWT (not SmartGWT) Window class allows access to the URL

            Comment

            Working...
            X