Hello,

   I'm working on tintegration GWT into ofbiz. GWT compiled js files is
placed into ofbiz "images" component in order ftl access them:

gwt_test.ftl

  <script type="text/javascript" language="javascript"
src="/images/gwttest1/gwttest1.nocache.js"></script>
  <table align="center">
      <tr>
        <td colspan="2" style="font-weight:bold;">Please enter your
name:</td>
      </tr>
      <tr>
        <td id="nameFieldContainer"></td>
        <td id="sendButtonContainer"></td>
      </tr>
    </table>

   Then I access GWT RPC from javascript. For this I corrected "images"
component war, because javascrip searches for servlet with path
"/gwttest1/greet" :

framework/images/webapp/images/war.xml :

<web-app>
  <display-name>Open For Business - demostore images</display-name>
  <description>Demo Store Images for the Open For Business
Project</description>

  <servlet>
    <servlet-name>greetServlet</servlet-name>

<servlet-class>org.ginsoftware.server.GreetingServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/gwttest1/greet</url-pattern>
  </servlet-mapping>

  <session-config>
    <session-timeout>1</session-timeout>
  </session-config>

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>main.jsp</welcome-file>
  </welcome-file-list>

</web-app>



    And I implemented servlet it self GreetingServiceImpl.java and classes
is put into images/WEB-INF :

   public class GreetingServiceImpl extends RemoteServiceServlet implements
GreetingService {

       public String greetServer(String input) {

            //Haw to call ofbiz service ?

            String serverInfo = getServletContext().getServerInfo();
            String userAgent =
getThreadLocalRequest().getHeader("User-Agent");

            return "Hello, " + input + "!<br><br>I am running " + serverInfo
+ ".<br><br>It looks like you are using:<br>" + userAgent;

       }
    }


    Until now everything works fine and my question is how do I call ofbiz
service from greetServer() method ? I've tried obtain LocalServiceDispacher
in variuos ways, but no luck at all.

Or is there somebody who already did that integration in more convenient way
that me ?


Thanks,
Gintare

Reply via email to