Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
StreamResource and MalformedURLException
Hi,
I'm using Vaadin 6.7.4 and GateIn 3.2.0 with JBoss AS6
I'm trying to use StreamResource to download an excel file, here is the code:
StreamResource streamResource = new StreamResource(streamSource, "report", myApplication);
streamResource.setCacheTime(5000); // no cache (<=0) does not
// work with IE8
streamResource.setMIMEType("application/x-msexcel");
getWindow().open(streamResource, "_top");
First, I was using GenericPortlet class to create my vaadin portlet, and the code above used to work pretty well: by clicking the link, the file was downloaded as this URL was called :
http://localhost:8080/myapp/APP/1/report.xls
(as explained in Book of vaadin)
But I had to change the portlet class with ApplicationPortlet2, and now, as soon as I click on the link to download the file, I get this error message:
Terminal error:: java.net.MalformedURLException: no protocol: APP/
and I noticed that the url (right after clicking) become
http://localhost:8080/myapp?portal:windowState=normal&portal:componentId=2d0ba35b-3591-459c-bce2-2fb8192156c1&portal:resourceID=APP/1/report&portal:cacheLevel=PAGE&portal:type=resource&portal:portletMode=view
with a blank page
I can't figure out how to deal with this exception. Does somebody have any explanation/fix to this error?
Thank you.
psl