Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » File Upload and Download in RWT standalone
File Upload and Download in RWT standalone [message #119963] Thu, 29 January 2009 01:45 Go to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
I'm having difficulty implementing File up and download in a RWT
standalone app. Most of the existing threads on this topic uses plugin and
therefore plugin.xml. The only helpful thread I can find is the one I
pasted below, where Rüdiger responds to someone else that had the same
exact issue as me currently while trying to use the download widget:

Could not evaluate javascript response:

Object expected

So I tried following Rüdiger's suggestion as best I could, and I think I
have the upload servlet up. Here's the piece of web.xml I added:

<servlet>
<servlet-name>FileUploadServlet</servlet-name>

<servlet-class>org.eclipse.rwt.widgets.upload.servlet.FileUploadServlet </servlet-class>
<load-on-startup>0</load-on-startup>
<init-param>
<param-name>org.eclipse.rwt.resources</param-name>
<param-value>
org.eclipse.rwt.widgets.internal.resource.UploadButtonResour ce,
org.eclipse.rwt.widgets.internal.resource.UploadResource,
org.eclipse.rwt.widgets.internal.resource.UploadFieldResourc e,
org.eclipse.rwt.widgets.internal.resource.UploadFormResource
</param-value>
</init-param>
<init-param>
<param-name>httpcontextId</param-name>
<param-value>org.eclipse.rap.httpcontext</param-value>
</init-param>
</servlet>


But I'm guessing I'm not setting the httpcontextId correctly, or something
else is wrong. I can see the servlet is deployed when I go to JMX console
and when I try to go to /upload I get:

<?xml version="1.0" encoding="utf-8" ?>
<response />

If anyone can give me some pointers, I would be eternally grateful. :D
Any instructions or example code for setting up upload and download server
would be much much appreciated as well!

Cheers,
Howard

====================== previous thread pasted ==========================

the error occurs because the Javascript files for the upload widget are
missing.

Usually they are registered via the extension point
'org.eclipse.rap.ui.resources'. An IResource implementation must be given
there that describes the resource. RAP puts all Javascript resources
together and delivers them in the index.html to the client.

In your case this information is never evaluated.


But there is more. All what is currently specified in the plugin.xml of
org.eclipse.rwt.widgets.upload needs to be specified otherwise.

Here is what you would need to do when using RWT standalone (without
having actually tried it)
* specify web.xml
<init-param>
<param-name>org.eclipse.rwt.resources</param-name>
<param-value>
[comma-separated list of IResource implementations]
</param-value>
</init-param>
Take the class names from the plugin.xml of
org.eclipse.rwt.widgets.upload
* register the /upload servlet (also see plugin.xml)
* the org.eclipse.rap.ui.themeableWidgets extension needs a
replacement too, but right now, I can't find where to specify
this in the web.xml. With some luck, the upload widget may
work without theming.

HTH
Rüdiger
Attn Rüdiger Re: File Upload and Download... [message #120093 is a reply to message #119963] Thu, 29 January 2009 16:01 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Rüdiger would you please take a look at your previous reply to someone
else and perhaps shed some lights? This is a huge part of my app and
perhaps the biggest hurdle left. Thanks in advance!

Howard
Re: File Upload and Download in RWT standalone [message #120105 is a reply to message #119963] Fri, 30 January 2009 00:34 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
I ran the server in debug mode trying to figure out the problem:
> Could not evaluate javascript response:
> Object expected
I noticed that this happens right on the line Display.sleep(). Since I'm
doing RWT standalone, my main GUI has the standard while loop with
readAndDispatch() and sleep()
while (loopShell != null && !loopShell.isDisposed()) {
try {
if (!display.readAndDispatch()) {
display.sleep();
}
} catch (Throwable e) {
e.printStackTrace();
}
}
I don't know if having multiple display.sleep() is bad, but I wouldn't
think so since I do have another dialog that seems to work fine.

I wanted to contact Alois Wurmdobler who had the same problem originally
but haven't been able to figure out how to get the older newsgroup
messages to find his email address.

Again, any help deeply appreciated.
Re: File Upload and Download in RWT standalone [message #120130 is a reply to message #119963] Fri, 30 January 2009 08:16 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Howard,

it's difficult for me to reproduce this problem because I don't have the
setup of running a RAP app without Equinox. Maybe, you can post a small
example WAR file that you use?

Registering the FileUploadServlet in your web.xml is no longer necessary
because it isn't used any longer (marked as deprecated). Instead the
class FileUploadServiceHandler is used. This ServiceHandler is
registered automatically when the Upload-Widget is used. However, this
should not be the reason of your problem...

Regards,
Stefan.

Howard schrieb:
> I'm having difficulty implementing File up and download in a RWT
> standalone app. Most of the existing threads on this topic uses plugin
> and therefore plugin.xml. The only helpful thread I can find is the one
> I pasted below, where Rüdiger responds to someone else that had the same
> exact issue as me currently while trying to use the download widget:
>
> Could not evaluate javascript response:
>
> Object expected
>
> So I tried following Rüdiger's suggestion as best I could, and I think I
> have the upload servlet up. Here's the piece of web.xml I added:
>
> <servlet>
> <servlet-name>FileUploadServlet</servlet-name>
>
> <servlet-class>org.eclipse.rwt.widgets.upload.servlet.FileUploadServlet </servlet-class>
>
> <load-on-startup>0</load-on-startup>
> <init-param>
> <param-name>org.eclipse.rwt.resources</param-name>
> <param-value>
> org.eclipse.rwt.widgets.internal.resource.UploadButtonResour ce,
> org.eclipse.rwt.widgets.internal.resource.UploadResource,
> org.eclipse.rwt.widgets.internal.resource.UploadFieldResourc e,
> org.eclipse.rwt.widgets.internal.resource.UploadFormResource
> </param-value>
> </init-param>
> <init-param>
> <param-name>httpcontextId</param-name>
> <param-value>org.eclipse.rap.httpcontext</param-value>
> </init-param>
> </servlet>
>
>
> But I'm guessing I'm not setting the httpcontextId correctly, or
> something else is wrong. I can see the servlet is deployed when I go to
> JMX console and when I try to go to /upload I get:
>
> <?xml version="1.0" encoding="utf-8" ?> <response />
> If anyone can give me some pointers, I would be eternally grateful. :D
> Any instructions or example code for setting up upload and download
> server would be much much appreciated as well!
>
> Cheers,
> Howard
>
> ====================== previous thread pasted ==========================
>
> the error occurs because the Javascript files for the upload widget are
> missing.
>
> Usually they are registered via the extension point
> 'org.eclipse.rap.ui.resources'. An IResource implementation must be
> given there that describes the resource. RAP puts all Javascript
> resources together and delivers them in the index.html to the client.
>
> In your case this information is never evaluated.
>
>
> But there is more. All what is currently specified in the plugin.xml of
> org.eclipse.rwt.widgets.upload needs to be specified otherwise.
>
> Here is what you would need to do when using RWT standalone (without
> having actually tried it)
> * specify web.xml
> <init-param>
> <param-name>org.eclipse.rwt.resources</param-name>
> <param-value>
> [comma-separated list of IResource implementations]
> </param-value>
> </init-param>
> Take the class names from the plugin.xml of
> org.eclipse.rwt.widgets.upload
> * register the /upload servlet (also see plugin.xml)
> * the org.eclipse.rap.ui.themeableWidgets extension needs a
> replacement too, but right now, I can't find where to specify
> this in the web.xml. With some luck, the upload widget may
> work without theming.
>
> HTH
> Rüdiger
>
>
Re: File Upload and Download in RWT standalone [message #120270 is a reply to message #120130] Mon, 02 February 2009 23:45 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
Thanks for the reply Stefan. At least I know I don't have to worry about
setting up the servlet correctly, that's helpful info!
What about theme/branding? Does Upload Widget still require themeing? If
so, any idea on how to do theme in css with RWT standalone?

I've attached a simple war file as requested. A couple of notes:
I'm using HEAD in Upload Widget, and RAP 1.2 M4, deployed in JBoss. To
access the servlet: deploy in web server, url is
https://localhost:8080/rap/main
Instead of including my actual code, which I'm not allowed to share, I
simply changed the upload demo code to create a new Display instead. The end
result is a similar, although slightly different, error. See below.
I didn't find a jar for the upload widget, so I just manually zipped it up
and called it upload.jar. This seems to work fine.
I largely followed the example given in the FAQ to setup my RWT standalone
app, and so far it's working quite well.
The war is too large to attach, so I've stripped out the library jars. It
needs:
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
org.eclipse.core.commands_3.5.0.I20081202-0800.jar
org.eclipse.equinox.common_3.5.0.v20081201-1815.jar
org.eclipse.rap.jface_1.2.0.20081223-1131.jar
org.eclipse.rap.rwt.q07_1.2.0.20081223-1131.jar
org.eclipse.rap.rwt_1.2.0.20081223-1131.jar
Those are the jars I normally include.

I'm starting to hit a wall...not sure what else I can do. My only hope is
someone in the newsgroup will be kind enough to help!

Cheers,
Howard

================ This is the normal message I get while I use Upload Widget
in a dialog inside my app ======================

Could not evaluate javascript response:

Object expected

org.eclipse.swt.EventUtil.suspendEventHandling();var req =
org.eclipse.swt.Request.getInstance();req.setRequestCounter( "9" );var wm =
org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget( "w358",
"", false, null,
'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
"rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize(
true );w.setShowMaximize( true );w.setAllowMaximize(
true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true,
true, true, true );w.setParentShell( wm.findWidgetById(
"w6" ) );w.initialize();w.addEventListener( "changeWidth",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
"changeHeight",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1008, 0, 543 );var w
= wm.newWidget( "w357", "", false, null,
'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
"rwt_BORDER" );w.addState( "rwt_APPLICATION_MODAL" );w.addState(
"rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
false );w.setShowMaximize( false );w.setAllowMaximize(
false );w.setShowClose( true );w.setAllowClose( true );w.setResizable(
false, false, false, false );w.setParentShell( wm.findWidgetById(
"w358" ) );w.initialize();w.addEventListener( "changeWidth",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
"changeHeight",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 352, 304, 215,
84 );w.setVisibility( true );w.setCaption( "title" );w.open();w.setActive(
true );w.setHasShellListener( true );var w = wm.newWidget( "w359", "w357",
true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
"hidden" );w.setHideFocus( true );w.setAppearance(
"composite" );w.setSpace( 0, 300, 19, 61 );w.setZIndex( 300 );var w =
wm.newWidget( "w360", "w359", true, null, 'org.eclipse.rwt.widgets.Upload',
'" https://localhost:8443/mscad-rap/main?custom_service_handler =org.eclipse.rwt.widgets.upload.servlet.FileUploadServiceHan dler&widgetId=16430253",
5' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0,
300, 0, 39 );w.setZIndex( 300 );w.setLastFileUploaded(
"" );w.setBrowseButtonText( "Browse" );var w = wm.newWidget( "w361", "w359",
true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
"hidden" );w.setHideFocus( true );w.setAppearance(
"composite" );w.setSpace( 280, 20, 39, 22 );w.setZIndex( 299 );wm.setFont(
w, [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
"sans-serif" ], 11, false, false );var w = wm.findWidgetById(
"w357" );w.setActiveControl( wm.findWidgetById(
"w359" ) );org.eclipse.swt.WidgetManager.getInstance().focus(
"w359" );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();org.eclipse.swt.FontSizeCalculat ion.measureStrings(
[ [ 1121116, "Browse", [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida
Sans Unicode", "sans-serif" ], 11, false, false, -1 ] ] );

================ Versus below, which is what I get using the attached war. I
noticed it
mentioned theme... ======================

Could not evaluate javascript
response:Object expected

org.eclipse.swt.EventUtil.suspendEventHandling();var req =
org.eclipse.swt.Request.getInstance();req.setRequestCounter(
"0" );qx.theme.manager.Meta.getInstance().setTheme(
org.eclipse.swt.theme.Default );org.eclipse.swt.Request.getInstance().setTimeoutPage(
"The server session timed out.Please click here to restart the
session." );var wm = org.eclipse.swt.WidgetManager.getInstance();var w =
wm.newWidget( "w4", "", false, null,
'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
"rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize(
true );w.setShowMaximize( true );w.setAllowMaximize(
true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true,
true, true, true );w.initialize();w.addEventListener( "changeWidth",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
"changeHeight",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1008, 0, 543 );var w
= wm.newWidget( "w5", "", false, null,
'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
"rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
false );w.setShowMaximize( false );w.setAllowMaximize(
false );w.setShowClose( false );w.setAllowClose( false );w.setResizable(
false, false, false, false );w.initialize();w.addEventListener(
"changeWidth",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
"changeHeight",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1680, 0,
905 );w.setVisibility( true );w.open();w.setMode( "maximized" );var w =
wm.newWidget( "w3", "", false, null,
'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
"rwt_BORDER" );w.addState( "rwt_APPLICATION_MODAL" );w.addState(
"rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
false );w.setShowMaximize( false );w.setAllowMaximize(
false );w.setShowClose( true );w.setAllowClose( true );w.setResizable(
false, false, false, false );w.setParentShell( wm.findWidgetById(
"w5" ) );w.initialize();w.addEventListener( "changeWidth",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
"changeHeight",
org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 688, 304, 398,
82 );w.setVisibility( true );w.setCaption( "title" );w.open();w.setActive(
true );w.setHasShellListener( true );var w = wm.newWidget( "w6", "w3", true,
null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
"hidden" );w.setHideFocus( true );w.setAppearance(
"composite" );w.setSpace( 0, 300, 19, 59 );w.setZIndex( 300 );var w =
wm.newWidget( "w7", "w6", true, null, 'org.eclipse.rwt.widgets.Upload',
'" https://localhost:8443/mscad-rap/main?custom_service_handler =org.eclipse.rwt.widgets.upload.servlet.FileUploadServiceHan dler&widgetId=17284966",
5' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0,
300, 0, 39 );w.setZIndex( 300 );w.setLastFileUploaded(
"" );w.setBrowseButtonText( "Browse" );var w = wm.newWidget( "w8", "w6",
true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
"hidden" );w.setHideFocus( true );w.setAppearance(
"composite" );w.setSpace( 282, 18, 39, 20 );w.setZIndex( 299 );wm.setFont(
w, [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
"sans-serif" ], 11, false, false );var w = wm.findWidgetById(
"w3" );w.setActiveControl( wm.findWidgetById(
"w6" ) );org.eclipse.swt.WidgetManager.getInstance().focus(
"w6" );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();org.eclipse.swt.FontSizeCalculat ion.probe(
[ [ 30262854,
"!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy ",
[ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
"sans-serif" ], 11, false,
false ] ] );org.eclipse.swt.FontSizeCalculation.measureStrings( [ [
13765322, "Browse", [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida
Sans Unicode", "sans-serif" ], 11, false, false, -1 ] ] );



  • Attachment: rap.war
    (Size: 43.69KB, Downloaded 321 times)
Re: File Upload and Download in RWT standalone [message #120607 is a reply to message #120270] Thu, 05 February 2009 16:39 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Howard,

the following is justa guess, I haven't tried it myself. The
Javascript error *may* be caused by the fact that the upload widget
is not known as a themeable widget.

When running the Workbench, themeable widgets are registered via the
org.eclipse.rap.ui.themeableWidgets extension point. A similar
mechanism is currently missing for RWT standalone.
You could try the following to work around this:
1. register a new ServletContextListner in your web.xml
*before* any other context listener
2. in this context-listeners' contextInitialized() method
call ThemeManager.getInstance().addThemeableWidget()
and pass in the upload-widget-class

HTH
Rüdiger


Howard Yeh wrote:
> Thanks for the reply Stefan. At least I know I don't have to worry about
> setting up the servlet correctly, that's helpful info!
> What about theme/branding? Does Upload Widget still require themeing? If
> so, any idea on how to do theme in css with RWT standalone?
>
> I've attached a simple war file as requested. A couple of notes:
> I'm using HEAD in Upload Widget, and RAP 1.2 M4, deployed in JBoss. To
> access the servlet: deploy in web server, url is
> https://localhost:8080/rap/main
> Instead of including my actual code, which I'm not allowed to share, I
> simply changed the upload demo code to create a new Display instead. The end
> result is a similar, although slightly different, error. See below.
> I didn't find a jar for the upload widget, so I just manually zipped it up
> and called it upload.jar. This seems to work fine.
> I largely followed the example given in the FAQ to setup my RWT standalone
> app, and so far it's working quite well.
> The war is too large to attach, so I've stripped out the library jars. It
> needs:
> commons-fileupload-1.2.1.jar
> commons-io-1.3.2.jar
> org.eclipse.core.commands_3.5.0.I20081202-0800.jar
> org.eclipse.equinox.common_3.5.0.v20081201-1815.jar
> org.eclipse.rap.jface_1.2.0.20081223-1131.jar
> org.eclipse.rap.rwt.q07_1.2.0.20081223-1131.jar
> org.eclipse.rap.rwt_1.2.0.20081223-1131.jar
> Those are the jars I normally include.
>
> I'm starting to hit a wall...not sure what else I can do. My only hope is
> someone in the newsgroup will be kind enough to help!
>
> Cheers,
> Howard
>
> ================ This is the normal message I get while I use Upload Widget
> in a dialog inside my app ======================
>
> Could not evaluate javascript response:
>
> Object expected
>
> org.eclipse.swt.EventUtil.suspendEventHandling();var req =
> org.eclipse.swt.Request.getInstance();req.setRequestCounter( "9" );var wm =
> org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget( "w358",
> "", false, null,
> 'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
> "rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize(
> true );w.setShowMaximize( true );w.setAllowMaximize(
> true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true,
> true, true, true );w.setParentShell( wm.findWidgetById(
> "w6" ) );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
> org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1008, 0, 543 );var w
> = wm.newWidget( "w357", "", false, null,
> 'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
> "rwt_BORDER" );w.addState( "rwt_APPLICATION_MODAL" );w.addState(
> "rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
> false );w.setShowMaximize( false );w.setAllowMaximize(
> false );w.setShowClose( true );w.setAllowClose( true );w.setResizable(
> false, false, false, false );w.setParentShell( wm.findWidgetById(
> "w358" ) );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
> org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 352, 304, 215,
> 84 );w.setVisibility( true );w.setCaption( "title" );w.open();w.setActive(
> true );w.setHasShellListener( true );var w = wm.newWidget( "w359", "w357",
> true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
> "hidden" );w.setHideFocus( true );w.setAppearance(
> "composite" );w.setSpace( 0, 300, 19, 61 );w.setZIndex( 300 );var w =
> wm.newWidget( "w360", "w359", true, null, 'org.eclipse.rwt.widgets.Upload',
> '" https://localhost:8443/mscad-rap/main?custom_service_handler =org.eclipse.rwt.widgets.upload.servlet.FileUploadServiceHan dler&widgetId=16430253",
> 5' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0,
> 300, 0, 39 );w.setZIndex( 300 );w.setLastFileUploaded(
> "" );w.setBrowseButtonText( "Browse" );var w = wm.newWidget( "w361", "w359",
> true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
> "hidden" );w.setHideFocus( true );w.setAppearance(
> "composite" );w.setSpace( 280, 20, 39, 22 );w.setZIndex( 299 );wm.setFont(
> w, [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
> "sans-serif" ], 11, false, false );var w = wm.findWidgetById(
> "w357" );w.setActiveControl( wm.findWidgetById(
> "w359" ) );org.eclipse.swt.WidgetManager.getInstance().focus(
> "w359" );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();org.eclipse.swt.FontSizeCalculat ion.measureStrings(
> [ [ 1121116, "Browse", [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida
> Sans Unicode", "sans-serif" ], 11, false, false, -1 ] ] );
>
> ================ Versus below, which is what I get using the attached war. I
> noticed it
> mentioned theme... ======================
>
> Could not evaluate javascript
> response:Object expected
>
> org.eclipse.swt.EventUtil.suspendEventHandling();var req =
> org.eclipse.swt.Request.getInstance();req.setRequestCounter(
> "0" );qx.theme.manager.Meta.getInstance().setTheme(
> org.eclipse.swt.theme.Default );org.eclipse.swt.Request.getInstance().setTimeoutPage(
> "The server session timed out.Please click here to restart the
> session." );var wm = org.eclipse.swt.WidgetManager.getInstance();var w =
> wm.newWidget( "w4", "", false, null,
> 'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
> "rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize(
> true );w.setShowMaximize( true );w.setAllowMaximize(
> true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true,
> true, true, true );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
> org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1008, 0, 543 );var w
> = wm.newWidget( "w5", "", false, null,
> 'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
> "rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
> false );w.setShowMaximize( false );w.setAllowMaximize(
> false );w.setShowClose( false );w.setAllowClose( false );w.setResizable(
> false, false, false, false );w.initialize();w.addEventListener(
> "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
> org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 1680, 0,
> 905 );w.setVisibility( true );w.open();w.setMode( "maximized" );var w =
> wm.newWidget( "w3", "", false, null,
> 'org.eclipse.swt.widgets.Shell' );w.addToDocument();w.addState(
> "rwt_BORDER" );w.addState( "rwt_APPLICATION_MODAL" );w.addState(
> "rwt_TITLE" );w.setShowMinimize( false );w.setAllowMinimize(
> false );w.setShowMaximize( false );w.setAllowMaximize(
> false );w.setShowClose( true );w.setAllowClose( true );w.setResizable(
> false, false, false, false );w.setParentShell( wm.findWidgetById(
> "w5" ) );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop",
> org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 688, 304, 398,
> 82 );w.setVisibility( true );w.setCaption( "title" );w.open();w.setActive(
> true );w.setHasShellListener( true );var w = wm.newWidget( "w6", "w3", true,
> null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
> "hidden" );w.setHideFocus( true );w.setAppearance(
> "composite" );w.setSpace( 0, 300, 19, 59 );w.setZIndex( 300 );var w =
> wm.newWidget( "w7", "w6", true, null, 'org.eclipse.rwt.widgets.Upload',
> '" https://localhost:8443/mscad-rap/main?custom_service_handler =org.eclipse.rwt.widgets.upload.servlet.FileUploadServiceHan dler&widgetId=17284966",
> 5' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0,
> 300, 0, 39 );w.setZIndex( 300 );w.setLastFileUploaded(
> "" );w.setBrowseButtonText( "Browse" );var w = wm.newWidget( "w8", "w6",
> true, null, 'qx.ui.layout.CanvasLayout' );w.setOverflow(
> "hidden" );w.setHideFocus( true );w.setAppearance(
> "composite" );w.setSpace( 282, 18, 39, 20 );w.setZIndex( 299 );wm.setFont(
> w, [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
> "sans-serif" ], 11, false, false );var w = wm.findWidgetById(
> "w3" );w.setActiveControl( wm.findWidgetById(
> "w6" ) );org.eclipse.swt.WidgetManager.getInstance().focus(
> "w6" );qx.ui.core.Widget.flushGlobalQueues();org.eclipse.swt.Even tUtil.resumeEventHandling();org.eclipse.swt.FontSizeCalculat ion.probe(
> [ [ 30262854,
> "!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy ",
> [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida Sans Unicode",
> "sans-serif" ], 11, false,
> false ] ] );org.eclipse.swt.FontSizeCalculation.measureStrings( [ [
> 13765322, "Browse", [ "Segoe UI", "Corbel", "Calibri", "Tahoma", "Lucida
> Sans Unicode", "sans-serif" ], 11, false, false, -1 ] ] );
>
>
>
Re: File Upload and Download in RWT standalone [message #120728 is a reply to message #119963] Fri, 06 February 2009 12:33 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
Howard,

we do use the UploadWidget in RAP standalone mode successfully.

The servlet you register is not needed anymore, as written before.
Nevertheless you still have to register the resources for the upload
widget.
We use the following snippet in our web.xml:
------------

<context-param>
<param-name>org.eclipse.rwt.resources</param-name>
<param-value>
org.eclipse.rwt.widgets.internal.resource.UploadButtonResour ce,
org.eclipse.rwt.widgets.internal.resource.UploadFieldResourc e,
org.eclipse.rwt.widgets.internal.resource.UploadFormResource ,
org.eclipse.rwt.widgets.internal.resource.UploadResource
</param-value>
</context-param>

-----------

Hope this helps ... at least it should give you hope, that you can use the
upload-widget :D ....
Note that we are still on RAP 1.1.1.

Regards,
Stefan
Re: File Upload and Download in RWT standalone [message #120972 is a reply to message #120728] Fri, 06 February 2009 23:30 Go to previous messageGo to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
stefan: Yes I eventually stumbled upon that solution as well.

Rüdiger: I did not need to deal with theme at all. I am guessing theme is
defined in a project-self-contained file inside Upload.appearances.js...?

Thanks much to you both for the support!
Re: File Upload and Download in RWT standalone [message #120991 is a reply to message #120972] Sat, 07 February 2009 23:07 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

Howard wrote:
> Rüdiger: I did not need to deal with theme at all. I am guessing theme
> is defined in a project-self-contained file inside
> Upload.appearances.js...?

Right, but the content of this file is delivered only if the RWT theming
knows about the themeable widget. As the themeableWidgets extension does
not work in standalone mode, the appearance will be missing. This should
result in a Javascript error or warning at some point (apart from a
different look of the embedded text field), but this is obviously not a
problem in your case.

Regards, Ralf
Previous Topic:Tutorials and text books
Next Topic:Problem with setBlockOnOpen in Dialog
Goto Forum:
  


Current Time: Tue Jan 31 04:46:08 GMT 2023

Powered by FUDForum. Page generated in 0.03418 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top