Monday, January 9, 2012

Re: How to use doPost method in Formpanel submit button. How to map that servlet in web.xml.

 
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.
+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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment