For exercise purpose I’m making an application using GWT which consists of a login form. While running it gives an error
Loading modules com.logvin.LoginForm
[ERROR] Element ‘servlet’ beginning on line 19 is missing required attribute ‘path’
[ERROR] Failure while parsing XML
I am using GWT-RPC and checking if the given username and password is correct or not. I’ve made few changes in the xml file which are:
entry-point class='com.logvin.client.LoginForm'/>
<servlet> path="/LoginForm" class="com.logvin.gwt.server.GreetingServiceImpl"/>
<servlet>
<servlet-name>GreetingServiceImpl</servlet-name>
<servlet-class>com.logvin.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GreetingServiceImpl</servlet-name>
<url-pattern>/LoginForm</url-pattern>
</servlet-mapping>
Why i’m getting this error again?
You’re mixing up two XML dialects.
All those
<servlet>elements should go into yourWEB-INF/web.xmlfile, that tells the servlet container (server where you’ll deploy your app) how to serve your servlets.The
*.gwt.xmlfile (GWT module) is about telling the GWT compiler (see: compile-time, not runtime) how to compile your code: where to start when loading the app (theentry-point), which classes are client-side (will be compiled to JavaScript, others –server-side only– have to be excluded), which GWT modules to import (inherits), etc.