You need the module name for your GWT app. For my module, MyModule,
use
<url-pattern>/mymodule/AddNewUser</url-pattern>
In my code, call
form.setAction(GWT.getModuleBaseURL() + "AddNewUser");
If you are using UiBinder, you can put something like this in your
ui.xml file
<ui:with field="gwt" type="com.google.gwt.core.client.GWT"/>
...
<g:FormPanel ui:field='inputForm'
encoding='application/x-www-form-urlencoded'
action='{gwt.getModuleName}/AddNewUser'
method='get'>
On Jan 9, 3:27 pm, "Pandy .k" <[email protected]> wrote:
> i got an idea about how to use GWT Form Panel in Eclipse...
>
> At Same time,
>
> My Class Name is: User.Java
> inside of "/src/sample/model/"
>
> My servlet name is : AddUserSerivesImpl
> inside of "/src/sample/server/"
>
> My Main Class Name is : Sample.java
> inside of "/src/sample/client/"
>
> from Sample.java class i am using Form Panel.
> which url i want to submit button Action.
> FormPanel form=new FormPanel();
> form.setAction=" ? ";
>
> method is doPost.
>
> while,
>
> how to map that servlet inside the web.xml
>
> <servlet>
> <servlet-name>AddNewUser</servet-name>
> <servlet-class>sample.server.AddUserServiceImpl</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>AddNewUser</servet-name>
> <url-pattern> ? </url-pattern>
> </servlet-mapping>
>
> My Question is..
>
> 1) In that question mark symbol place i want to give same address?
>
> 2) inside the url address, which url address i want to give for map that
> servlet?
>
> 3) Inside the setAction, which url i want to give the call the servlet (
> AddUserServiceImpl.java). ?
>
> i tried this way..
>
> 1st Way....
> inside the setAction... form.setAction("AddNewUser");
> inside the url in web.xml.......<url-pattern>/AddNewUser</url-pattern>
>
> 2nd Way...
> inside the setAction... form.setAction("/AddNewUser");
> inside the url in web.xml.......<url-pattern>/AddNewUser</url-pattern>
>
> 3rd Way..
> inside the setAction... form.setAction("/AddNewUser");
> inside the url in
> web.xml.......<url-pattern>/sample/server/AddNewUser</url-pattern>
>
> 4th Way..
> inside the setAction... form.setAction("AddNewUserServiceImpl");
> inside the url in web.xml.......<url-pattern>
> /sample/server/AddNewUser </url-pattern>
>
> those 4's way i didn't add the value to the database. i have doubt first
> that action and servlet url is correct or not?
>
> pl sir, give the solution according my project .... how to give url inside
> the setAction and web.xml.
>
> By,
> pandy.k
> DEAS Technology Private Limited, Chennai.
> [email protected]
> +91- 9976743975
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.