struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grish <gin1...@hotmail.com>
Subject Re: [S2] Parameterized File Downloading
Date Wed, 01 Aug 2007 03:29:55 GMT

Isn't it closed with the /> in the end?

<s:param name="inputPath" value="/images/bg_pattern.gif" />

I just copied the examples in the tutorials and url examples:
http://struts.apache.org/2.x/docs/url.html

EDIT
The </url> though is missing and yes that's a typo. My bad, sorry for
confusion


nuwan chandrasoma-2 wrote:
> 
> Hi,
> 
> Is it a typo, I dont see a </s:param> tag in ur code?
> 
> Thanks,
> 
> Nuwan
> 
> Grish wrote:
>> I studied the struts showcase sample of file downloading. I wanted to do
>> something similar but instead of setting the inputPath paremeter in
>> struts.xml I wanted to pass it in the url. I was thinking of using the
>> same
>> action for several downloads and I would just pass the inputPath. But
>> when I
>> tried using the following:
>>
>> <s:url id="downloadUrl" action="download" namespace="/filedownload">
>> 	    <s:param name="inputPath" value="/images/bg_pattern.gif"/>
>> <s:a href="%{downloadUrl}">download file</s:a>
>>
>> and I took out the inputPath param in the struts.xml:
>>
>> <action name="download" class="fileDownloadAction" >
>>   <result name="success" type="stream">
>>     image/gif
>>     inputStream
>>     filename="test.gif"
>>     4096
>>   </result>
>> </action>
>>
>> I noticed that my inputPath would be null and I would get the following
>> error:
>>
>> java.lang.IllegalArgumentException: Can not find a java.io.InputStream
>> with
>> the name [inputStream] in the invocation stack
>>
>> Is there another way i should be setting my inputPath parameter for my
>> File
>> or do I just have to make a lot of actions for each of my download?
>>
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Parameterized-File-Downloading-tf4191759.html#a11938302
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message