On 22 sep, 07:03, "er.9...@yahoo.com.cn" <er.9...@yahoo.com.cn> wrote: > Hi, > I got "Http 404 : The requested resource is unavailable" when I > run my project. > > What I did is that 1. web.xml. > > <servlet> > <servlet-name>databaseServlet</servlet-name> > <servlet-class>org.yournamehere.databaseServlet</servlet- > class> > </servlet> > <servlet-mapping> > <servlet-name>databaseServlet</servlet-name> > <url-pattern>/databaseServlet</url-pattern> > </servlet-mapping> > > 2. gwt.xml > <servlet class="org.yournamehere.databaseServlet" path="/ > databaseServlet"/> > > 3. in the client side > setAction("/databaseServlet") > > in onSubmitComplete method, I used Window.alert(event.getResults > ()) , so I can get some information from server. (Http 404..) > > However, when I tried to access the servlet directly by "http:// > localhost:8080/MyTest/databaseServlet" , it does work.(I did not get > 404 error.). I am very confused if I missed something important , or > anything wrong in my application. By the way, I am using glassfish 2.1 > server. > > Anyone can help me to fix this error? Thank you! Your setAction() call uses an absolute path; because it's client side code, it's unaware of the servlet context, so it really resolves to http://localhost:8080/databaseServlet. Try prefixing it with GWT.getHostPageBaseURL() --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---