One option you can consider is to generate your jad file on the fly instead
of just returning a static jad.  We do something similar but for different
reasons. 
You could have a "static" jad file that is really a template with macros
that you expand before returning. This way the path to the jar file can be
dynamically generated to include any magic ids or keys.


Niklas Johansson-6 wrote:
> 
> 
> Sorry, getting a bit tired, my English wasn't that clear. I will try to
> make it a bit more clear here:
> 
> Well, I did just a form which used an action to retreive the application.
> It doesn't work though and I am pretty
> sure the reason is because the .jad file contains information about where
> to get the .jar from. But since I used 
> actions to retreive the .jad file it's not possible to find the .jar file
> based on the information in the .jad 
> since the client doesn't have any idea about where the files are. 
> 
> I.e., I have to in some way use a url in my action class and not pointing
> to the file in the file system directly. But if 
> 
> I use a URL pointing directly to the .jad I will have to expose my
> files... 
> 
> My struts.xml
> 
>                                            
>             
>                   text/vnd.sun.j2me.app-descriptor
>                   43800                      
>                   filename="MobileTraining.jad"
>                 
>          
> 
> 
> I didn't change anything in my action class. 
> 
> It would be nice if I don't have to edit my .jad file as well...
> 
> Any further ideas?
> 
> Thanks in advance!
> 
> Regards,
> Niklas
> 
> ----------------------------------------
>> From: nic_s...@hotmail.com
>> To: user@struts.apache.org
>> Subject: RE: Download a Java ME application to mobile using StreamResult
>> Date: Sun, 3 May 2009 21:16:58 +0200
>>
>>
>> Hello,
>>
>> Thank's for your reply Dave.
>>
>> I named it to interceptor when I thought i had to do an interceptor
>> class, didn't change it while getting more clever.
>>
>> Well, I did just a form and which used an action to retreive the
>> application. It doesn't work though and I am pretty
>> sure the reason is because the .jad file contains information about where
>> to get the .jar from.
>>
>> I.e., I have to in some way use a url and not a pointing to the file in
>> the file system to a .jad in the same directory
>> as the .jar. I think...
>>
>> So, I have to
>>
>> 1. Protect the file(s) from unauthorized access
>> 2. Be able to verify the "ordernumber" in order to allow access to the
>> files.
>> 3. The client (mobile) must be able to use the inforamtion in the .jad
>> file in order to download the .jar file.
>>
>> Hmmm...still stuck. Any suggestions?
>>
>> Appreciate your help!
>>
>> Regards,
>> Niklas
>>
>> ----------------------------------------
>>> Date: Sun, 3 May 2009 14:12:56 -0400
>>> From: newton.d...@yahoo.com
>>> To: user@struts.apache.org
>>> Subject: Re: Download a Java ME application to mobile using StreamResult
>>>
>>> Niklas Johansson wrote:
>>>> I guess the link you sent is pointing to a similar way of doing it as I
>>>> did. This
>>>> is my reference:
>>>> http://sheetalshundori.blogspot.com/2008/02/struts2-dynamic-file-download.html
>>>
>>> Oh; the "interceptor" part in the class name made me think you were
>>> trying to make an interceptor. Not sure where the "interceptor" part
>>> comes from; it's a result class.
>>>
>>>> The reason why I am doing like this is because I don't want it to be
>>>> possible to
>>>> download the file without entering some kind of "ordernumber". I.e. the
>>>> file must be
>>>> protected. The reason why I chosed this solution is simply because that
>>>> is the solution
>>>> I found while googleing.
>>>>
>>>> Is there perhaps a better way of doing this?
>>>
>>> If you're trying to "protect" the file download then you just need to
>>> create a form that verifies the rights of the user to access the file:
>>> if they have access then use a normal stream result to send it to them.
>>>
>>> The link you point to is solving a completely different problem, and
>>> seems unnecessary since result parameters can be set from action
>>> properties.
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>
>> _________________________________________________________________
>> Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
>>
>> http://www.microsoft.com/windows/windowslive/products/photos.aspx
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
> 
> _________________________________________________________________
> More than messages–check out the rest of the Windows Live™.
> http://www.microsoft.com/windows/windowslive/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Download-a-Java-ME-application-to-mobile-using-StreamResult-tp23357381p23370639.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to