DWR 3.0RC1 with Tibco GI 3.8.1, class identified in DWR test but not in app javascript

View: New views
3 Messages — Rating Filter:   Alert me  

DWR 3.0RC1 with Tibco GI 3.8.1, class identified in DWR test but not in app javascript

by stpdave :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I can get up a DWR test screen and exercise the methods on the classes
from there. But when I reference the same class from within my own
javascript it is not known. In firebug I get the GI "Authentication is
not defined" where Authentication is the class.
Here is a section of my dwr.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting
3.0//EN" "http://getahead.org/dwr/dwr30.dtd">
<dwr>
    <init>
    <!-- converter id="date" class="com.example.secm.dwr.DateConverter"/-->
           <converter id="gensec"
class="com.example.secm.dwr.convert.GenSecObjectConverter"/>
    </init>
    <allow>

        <!--  filter ensures user logged in -->
        <filter class="com.example.secm.dwr.AuthenticationAjaxFilter" />
       
        <!--  controllers -->
        <create creator="new" scope="application"
javascript="Authentication">
            <param name="class"
value="com.example.secm.dwr.admin.Authentication" />
        </create>

...

        <convert converter="hibernate3"
match="com.example.datamanagerlogs.TransformLog">
          <param name="include" value="id,cat,msg,thread,time"/>
        </convert>

    </allow>
</dwr>

Here is the relevant section of my web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app id="secm">

  <display-name>An application</display-name>
  <description>An app</description>

  <filter>
    <filter-name>HibernateSessionRequestFilter</filter-name>
   
<filter-class>com.example.secm.dwr.HibernateSessionRequestFilter</filter-class>

  </filter>
  <filter-mapping>
    <filter-name>HibernateSessionRequestFilter</filter-name>
    <url-pattern>/dwr/*</url-pattern>
  </filter-mapping>

  <listener>
   
<listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextAttributeListener</listener-class>
  </listener>
  <listener>
   
<listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextListener</listener-class>
  </listener>

  <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <display-name>DWR Servlet</display-name>
    <description>Direct Web Remoter Servlet</description>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
...

    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>

</web-app>

Here is how I address the Authentication method

...

        Authentication.login(r.userName, r.password,
            {
                callback: LoginHandler.onSuccess,
                timeout: com.example.secm.LOGIN_TIMEOUT,
                errorHandler: function(strError, objException) {
                    if (objException !== null ) {
                        com.example.secm.setStatusMessage("Login error");
                        alert('onError:' +
dwr.util.toDescriptiveString(objException, 2)) ;
//objException.javaClassName
                    } else {
                        com.example.secm.setStatusMessage(strError) ;
                    }
                }
            }                      
        );

Any ideas?

Thx.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: DWR 3.0RC1 with Tibco GI 3.8.1, class identified in DWR test but not in app javascript

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are you including the script tag?

Regards

On Tue, Oct 20, 2009 at 7:40 PM, David Wynter <david@...> wrote:
Hi,

I can get up a DWR test screen and exercise the methods on the classes from there. But when I reference the same class from within my own javascript it is not known. In firebug I get the GI "Authentication is not defined" where Authentication is the class.
Here is a section of my dwr.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 3.0//EN" "http://getahead.org/dwr/dwr30.dtd">
<dwr>
  <init>
  <!-- converter id="date" class="com.example.secm.dwr.DateConverter"/-->
         <converter id="gensec" class="com.example.secm.dwr.convert.GenSecObjectConverter"/>
  </init>
  <allow>

      <!--  filter ensures user logged in -->
      <filter class="com.example.secm.dwr.AuthenticationAjaxFilter" />
            <!--  controllers -->
      <create creator="new" scope="application" javascript="Authentication">
          <param name="class" value="com.example.secm.dwr.admin.Authentication" />
      </create>

...

      <convert converter="hibernate3" match="com.example.datamanagerlogs.TransformLog">
        <param name="include" value="id,cat,msg,thread,time"/>
      </convert>

  </allow>
</dwr>

Here is the relevant section of my web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app id="secm">

 <display-name>An application</display-name>
 <description>An app</description>

 <filter>
  <filter-name>HibernateSessionRequestFilter</filter-name>
  <filter-class>com.example.secm.dwr.HibernateSessionRequestFilter</filter-class>
 </filter>
 <filter-mapping>
  <filter-name>HibernateSessionRequestFilter</filter-name>
  <url-pattern>/dwr/*</url-pattern>
 </filter-mapping>

 <listener>
  <listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextAttributeListener</listener-class>
 </listener>
 <listener>
  <listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextListener</listener-class>
 </listener>

 <servlet>
  <servlet-name>dwr-invoker</servlet-name>
  <display-name>DWR Servlet</display-name>
  <description>Direct Web Remoter Servlet</description>
  <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
...

  <load-on-startup>1</load-on-startup>
 </servlet>

 <servlet-mapping>
  <servlet-name>dwr-invoker</servlet-name>
  <url-pattern>/dwr/*</url-pattern>
 </servlet-mapping>

</web-app>

Here is how I address the Authentication method

...

      Authentication.login(r.userName, r.password,
          {
              callback: LoginHandler.onSuccess,
              timeout: com.example.secm.LOGIN_TIMEOUT,
              errorHandler: function(strError, objException) {
                  if (objException !== null ) {
                      com.example.secm.setStatusMessage("Login error");
                      alert('onError:' + dwr.util.toDescriptiveString(objException, 2)) ; //objException.javaClassName
                  } else {
                      com.example.secm.setStatusMessage(strError) ;
                  }
              }
          }                             );

Any ideas?

Thx.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: DWR 3.0RC1 with Tibco GI 3.8.1, class identified in DWR test but not in app javascript

by David Wynter at roamware :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ha, My two questions combine to come up with the answer. Thx for the
prompt Jose.

David

Jose Noheda wrote:

> Are you including the script tag?
>
> Regards
>
> On Tue, Oct 20, 2009 at 7:40 PM, David Wynter <david@...
> <mailto:david@...>> wrote:
>
>     Hi,
>
>     I can get up a DWR test screen and exercise the methods on the
>     classes from there. But when I reference the same class from
>     within my own javascript it is not known. In firebug I get the GI
>     "Authentication is not defined" where Authentication is the class.
>     Here is a section of my dwr.xml
>
>     <?xml version="1.0" encoding="UTF-8"?>
>     <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting
>     3.0//EN" "http://getahead.org/dwr/dwr30.dtd">
>     <dwr>
>       <init>
>       <!-- converter id="date"
>     class="com.example.secm.dwr.DateConverter"/-->
>              <converter id="gensec"
>     class="com.example.secm.dwr.convert.GenSecObjectConverter"/>
>       </init>
>       <allow>
>
>           <!--  filter ensures user logged in -->
>           <filter class="com.example.secm.dwr.AuthenticationAjaxFilter" />
>                 <!--  controllers -->
>           <create creator="new" scope="application"
>     javascript="Authentication">
>               <param name="class"
>     value="com.example.secm.dwr.admin.Authentication" />
>           </create>
>
>     ...
>
>           <convert converter="hibernate3"
>     match="com.example.datamanagerlogs.TransformLog">
>             <param name="include" value="id,cat,msg,thread,time"/>
>           </convert>
>
>       </allow>
>     </dwr>
>
>     Here is the relevant section of my web.xml
>
>     <?xml version="1.0" encoding="ISO-8859-1"?>
>     <!DOCTYPE web-app PUBLIC
>       "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>       "http://java.sun.com/dtd/web-app_2_3.dtd">
>
>     <web-app id="secm">
>
>      <display-name>An application</display-name>
>      <description>An app</description>
>
>      <filter>
>       <filter-name>HibernateSessionRequestFilter</filter-name>
>      
>     <filter-class>com.example.secm.dwr.HibernateSessionRequestFilter</filter-class>
>
>      </filter>
>      <filter-mapping>
>       <filter-name>HibernateSessionRequestFilter</filter-name>
>       <url-pattern>/dwr/*</url-pattern>
>      </filter-mapping>
>
>      <listener>
>      
>     <listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextAttributeListener</listener-class>
>      </listener>
>      <listener>
>      
>     <listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextListener</listener-class>
>      </listener>
>
>      <servlet>
>       <servlet-name>dwr-invoker</servlet-name>
>       <display-name>DWR Servlet</display-name>
>       <description>Direct Web Remoter Servlet</description>
>      
>     <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
>     ...
>
>       <load-on-startup>1</load-on-startup>
>      </servlet>
>
>      <servlet-mapping>
>       <servlet-name>dwr-invoker</servlet-name>
>       <url-pattern>/dwr/*</url-pattern>
>      </servlet-mapping>
>
>     </web-app>
>
>     Here is how I address the Authentication method
>
>     ...
>
>           Authentication.login(r.userName, r.password,
>               {
>                   callback: LoginHandler.onSuccess,
>                   timeout: com.example.secm.LOGIN_TIMEOUT,
>                   errorHandler: function(strError, objException) {
>                       if (objException !== null ) {
>                           com.example.secm.setStatusMessage("Login
>     error");
>                           alert('onError:' +
>     dwr.util.toDescriptiveString(objException, 2)) ;
>     //objException.javaClassName
>                       } else {
>                           com.example.secm.setStatusMessage(strError) ;
>                       }
>                   }
>               }                             );
>
>     Any ideas?
>
>     Thx.
>
>     David
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@...
>     <mailto:users-unsubscribe@...>
>     For additional commands, e-mail: users-help@...
>     <mailto:users-help@...>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...