Re: For file upload,how to set web.xml in hosted model?

2008-11-12 Thread Isaac Truett

Alex,

It sounds like you're running in hosted mode and you are not using the
-noserver option. In that case, you'll need to add servlet mappings to
your module definition (foo.gwt.xml). These mappings are only used
when running hosted mode (without -noserver). You'll still need the
web.xml mappings for web mode or for running with the -noserver
option.

- Isaac



On Tue, Nov 11, 2008 at 10:32 PM, Alex Luya <[EMAIL PROTECTED]> wrote:
>
> Hello
>  I have followed thethis link(http://groups.google.com/group/
> Google-Web-Toolkit/browse_thread/thread/
> 19ea5c6be6d47848/8a4439de9cd48006?
> lnk=gst&q=FancyFileUpload#8a4439de9cd48006) to upload a file,and I am
> using Cypal,and question is what
> other work is needed,should I add some entries to Test.xml,or to
> web.xml,in fact I have added following entries to web.xml:
> --
>
>FileUploadServlet
>
>   com.tsolution.emc.server.FileUploadServlet class>
>
>
>FileUploadServlet
>/FileUploadServlet
>
> -
> but when run hosted model,I got this error:
> -
> [ERROR] Unable to find 'FileUploadServlet.gwt.xml' on your classpath;
> could be a typo, or maybe you forgot to include a classpath entry for
> source?
> -
> By the way,in the class  FancyFileUpload.java,
> ---
> uploadForm.setAction(Test.getRelativeURL("FileUploadServlet"));
> 
> and this is Test.java
> ---
> public class Test implements EntryPoint
> {
>
>public void onModuleLoad()
>{
>FancyFileUpload ffupload = new FancyFileUpload();
>
>RootPanel.get().add(ffupload);
>}
>
>public static final String LOCAL_HOST = "http://localhost:
> /";
>public static final String REMOTE_HOST = "http://localhost:
> /Test/";
>
>public static String getRelativeURL(String url)
>{
>String realModuleBase;
>if (GWT.isScript())
>{
>String moduleBase = GWT.getModuleBaseURL();
>// Use for Deployment to production server
>realModuleBase = REMOTE_HOST;
>// Use to test compiled browser locally
>if (moduleBase.indexOf("localhost") != -1)
>{
>realModuleBase = LOCAL_HOST;
>}
>} else
>{
>// This is the URL for GWT Hosted mode
>realModuleBase = LOCAL_HOST;
>}
>return realModuleBase + url;
>}
>
> }
> ---
>
> I added a log informationin servlet,it seemed that servlet did not
> receive any request from request,so can you tell me where and how to
> set the servlet mapping for url  to servlet,thanks in advanced.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



For file upload,how to set web.xml in hosted model?

2008-11-11 Thread Alex Luya

Hello
  I have followed thethis link(http://groups.google.com/group/
Google-Web-Toolkit/browse_thread/thread/
19ea5c6be6d47848/8a4439de9cd48006?
lnk=gst&q=FancyFileUpload#8a4439de9cd48006) to upload a file,and I am
using Cypal,and question is what
other work is needed,should I add some entries to Test.xml,or to
web.xml,in fact I have added following entries to web.xml:
--

FileUploadServlet

   com.tsolution.emc.server.FileUploadServlet


FileUploadServlet
/FileUploadServlet

-
but when run hosted model,I got this error:
-
[ERROR] Unable to find 'FileUploadServlet.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for
source?
-
By the way,in the class  FancyFileUpload.java,
---
uploadForm.setAction(Test.getRelativeURL("FileUploadServlet"));

and this is Test.java
---
public class Test implements EntryPoint
{

public void onModuleLoad()
{
FancyFileUpload ffupload = new FancyFileUpload();

RootPanel.get().add(ffupload);
}

public static final String LOCAL_HOST = "http://localhost:
/";
public static final String REMOTE_HOST = "http://localhost:
/Test/";

public static String getRelativeURL(String url)
{
String realModuleBase;
if (GWT.isScript())
{
String moduleBase = GWT.getModuleBaseURL();
// Use for Deployment to production server
realModuleBase = REMOTE_HOST;
// Use to test compiled browser locally
if (moduleBase.indexOf("localhost") != -1)
{
realModuleBase = LOCAL_HOST;
}
} else
{
// This is the URL for GWT Hosted mode
realModuleBase = LOCAL_HOST;
}
return realModuleBase + url;
}

}
---

I added a log informationin servlet,it seemed that servlet did not
receive any request from request,so can you tell me where and how to
set the servlet mapping for url  to servlet,thanks in advanced.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---