The JSP solution is a Flex 1.x solution.
 
If you're using Flex 1.x, here's an alternative to the jsp option below,
 
> Note: The above seems to require a compile for every request for the page.
 
With a minor modification to the code, you can eliminate the above issue - the flashvars are updated on every request but the page doesn't recompile.
Use the flashvar tag to set a flashvar from the http header.  Access as flashvars in your mxml.
 
<flex.:mxml>
<mx:flashvar name="this_is_the_name_to_access_from_mxml" value='<%= request.getHeader("XXX") %>'/>
... Insert your mxml here, be sure to declare 'this_is_the_name_to_access_from_mxml at the root level.
</flex:mxml>
 
- Cathy


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Monday, October 30, 2006 1:41 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Accessing HTTP headers from Flex Data Services


I will give "an" answer which I know works, but there must be better ways.

We wrapped our mxml with jsp using <flex:mxml.../>
accessed request.getHeader("XXX"); in the jsp
pushed those values into jsp string variables (XXX = ) and
substituted them in the mxml via <%= XXX %>

flashvars will automatically pass in parameters if variables are declared in the flex at the root level to match, I haven't tried header variables.

Note: The above seems to require a compile for every request for the page

Roxanne



"Dylan Schorer" <dylanschorer@yahoo.com>
Sent by: [EMAIL PROTECTED]ups.com

10/30/2006 12:05 PM

Please respond to
[EMAIL PROTECTED]ups.com

To
[EMAIL PROTECTED]ups.com
cc
Subject
[flexcoders] Accessing HTTP headers from Flex Data Services





Hi,

How can you access the HTTP header variables from within a Flex Data
Services MXML application. The request variables are easily accessible
through Application.application.parameters, but how can you get at
HTTP headers variables?



This e-mail message and all attachments transmitted with it may contain legally privileged and/or confidential information intended solely for the use of the addressee(s). If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, forwarding or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message and all copies and backups thereof.

Thank you.


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to