Re: How to set a file name using a header in the response?

2009-06-27 Thread Jim Collings
Dave Newton wrote:
 Jim Collings wrote:
 %response.setHeader(Content-Disposition, attachment;
 filename=\filename_${fromDate}-${toDate}.doc\); %

 The above is what I currently  have but I think there is a new way to
 do it that doesn't involve using a scriptlet. Also, the fromDate and
 toDate items don't work. I've tried quoting them but I'm not sure I
 got it right. They are used later on in the document, so I know I am
 getting them.
 
 AFAIK you can't use EL inside a scriptlet.

Well I thought as much but, so far, a scriptlet is the only way I know
of to make the setting above. I know that scriptlets are the old way of
doing things. I'm hoping that there is a new way to do this. JSTL
perhaps?  How would one set a response header in JSTL, assuming that it
is possible?


Jim C.







signature.asc
Description: OpenPGP digital signature


Re: How to set a file name using a header in the response?

2009-06-27 Thread Dave Newton

Jim Collings wrote:

Dave Newton wrote:

Jim Collings wrote:

%response.setHeader(Content-Disposition, attachment;
filename=\filename_${fromDate}-${toDate}.doc\); %

The above is what I currently  have but I think there is a new way to
do it that doesn't involve using a scriptlet. Also, the fromDate and
toDate items don't work. I've tried quoting them but I'm not sure I
got it right. They are used later on in the document, so I know I am
getting them.

AFAIK you can't use EL inside a scriptlet.


Well I thought as much but, so far, a scriptlet is the only way I know
of to make the setting above. 


You've missed my point: the code inside scriptlets is written verbatim 
to the generated Java source: EL is meaningless in Java source. You'd 
need to get the properties you're using in EL from a scoped attribute, 
just like servlets/JSP, or from the value stack.


Dave

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



Re: How to set a file name using a header in the response?

2009-06-27 Thread john feng
Putthese code in servlet or action class. don't put in the jsp file.

On Sat, Jun 27, 2009 at 9:25 AM, Jim Collingsjlistn...@gmail.com wrote:
 Dave Newton wrote:
 Jim Collings wrote:
 %response.setHeader(Content-Disposition, attachment;
 filename=\filename_${fromDate}-${toDate}.doc\); %

 The above is what I currently  have but I think there is a new way to
 do it that doesn't involve using a scriptlet. Also, the fromDate and
 toDate items don't work. I've tried quoting them but I'm not sure I
 got it right. They are used later on in the document, so I know I am
 getting them.

 AFAIK you can't use EL inside a scriptlet.

 Well I thought as much but, so far, a scriptlet is the only way I know
 of to make the setting above. I know that scriptlets are the old way of
 doing things. I'm hoping that there is a new way to do this. JSTL
 perhaps?  How would one set a response header in JSTL, assuming that it
 is possible?


 Jim C.







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



Re: How to set a file name using a header in the response?

2009-06-27 Thread Jim Collings
john feng wrote:
 Putthese code in servlet or action class. don't put in the jsp file.
...
 is possible?

This idea seems promising.

So I have an action that results in the jsp in question and I'm using
the Convention plug-in. Presumably, I would have to apply one of the
*Aware interfaces to the action to get access to the response header. Am
I on the right track here?


Jim C.



signature.asc
Description: OpenPGP digital signature


Re: How to set a file name using a header in the response?

2009-06-26 Thread Dave Newton

Jim Collings wrote:

%response.setHeader(Content-Disposition, attachment;
filename=\filename_${fromDate}-${toDate}.doc\); %

The above is what I currently  have but I think there is a new way to
do it that doesn't involve using a scriptlet. Also, the fromDate and
toDate items don't work. I've tried quoting them but I'm not sure I
got it right. They are used later on in the document, so I know I am
getting them.


AFAIK you can't use EL inside a scriptlet.

If you're streaming the result back with a stream result set that 
information in the result configuration.


Dave

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