开发者

question on regular servlets within GWT (working in dev mode ,not working in deployment in tomcat)

开发者 https://www.devze.com 2023-01-02 21:44 出处:网络
i am having trouble with my web application developed in GWT. the application allows users to upload and download using an upload servlet and a download servlet, the upload servlet was created using t

i am having trouble with my web application developed in GWT. the application allows users to upload and download using an upload servlet and a download servlet, the upload servlet was created using the gwtUpload library. the download servlet is using regular HTTPServlet.

when i run the application within eclipse the down开发者_Python百科load servlet works fine, when i deploy it to tomcat, when a user selects to upload a file, the file does not download, when a user selects a link to download a file, this error is returned

type Status report

message /testhibernategilead/downloadServlet

description The requested resource (/testhibernategilead/downloadServlet) is not available.

can anyone explain why this is


The requested resource (/testhibernategilead/downloadServlet) is not available.

This is the same as a 404 Page Not Found. In other words, the URL is wrong, or the requested resource is indeed actually not there where you expect it to be.

If you are certain that the URL is correct, then you need to read the server logs if the server and the servlets started without problems. If a servlet fails during startup, then it will be unavailable that way.


I think this is due to the application's root directory misconfiguration in tomcat.

You can try adding the module base to your URL like this:

String servlet_url = GWT.getModuleBaseURL()+"testhibernategilead/downloadServlet";

Remember: GWT.getModuleBaseURL() puts a "/" at the end of the returned string.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号