Matt: yes,the two page's println content are same, also I put the trace() in function initLocale(){ trace('log'); language = "<%=l%>"; country = "<%=c%>"; mx.controls.Alert.show(language); resourceBundleDelegate.setLocale(language,country); } it have not execute, and I think the portal jsp parse engine does not support the flex,
.portal.jsp <%@ page session="false" contentType="text/html" import="java.util.*, multilanguage.*"%> <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %> <%@ taglib uri="FlexTagLib" prefix="mm" %> <portletAPI:init/> <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%"> <tr height="500"> <td> <mm:mxml> <% String s =request.getHeader("Accept-Language"); System.out.println("locale:"+s); String l = s.substring(0,2); String c = s.substring(3,5); %> <mx:Application pageTitle="Resource bundles sample application" xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns:view="com.benorama.flex.samples.payment.view.*" xmlns:globalization="com.benorama.flex.globalization.*" initialize="initLocale()" > <mx:Script> <![CDATA[ var language:String; var country:String; function initLocale(){ language = "<%=l%>"; country = "<%=c%>"; mx.controls.Alert.show(language); resourceBundleDelegate.setLocale(language,country); } ]]> </mx:Script> <view:PaymentView /> <globalization:ResourceBundleDelegate id="resourceBundleDelegate" /> </mx:Application> </mm:mxml> </td> </tr> </table> --- In flexcoders@yahoogroups.com, Matt Chotin <[EMAIL PROTECTED]> wrote: > I can't see the problem in portal.jsp. Did you put a trace statement in your > initLocale() method to make sure it's executing? The only difference I saw > between the two jsps was the portal stuff and the table, I don't think that > would make a difference but who knows. I assume the println is writing the > expected value? > > > > _____ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of loveewind > Sent: Tuesday, May 10, 2005 1:52 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] why can not pass arguments to flex in portal jsp page > > > > > if I run this locale.jsp > > mx.controls.Alert.show(language); can show the language value > > 1.locale.jsp > > <%@ taglib uri="FlexTagLib" prefix="mm" %> > <mm:mxml> > > <% > String s =request.getHeader("Accept-Language"); > System.out.println("locale:"+s); > String l = s.substring(0,2); > String c = s.substring(3,5); > %> > <mx:Application pageTitle="Resource bundles sample application" > xmlns:mx="http://www.macromedia.com/2003/mxml > <http://www.macromedia.com/2003/mxml> " > xmlns:view="com.benorama.flex.samples.payment.view.*" > xmlns:globalization="com.benorama.flex.globalization.*" > initialize="initLocale()" > > <mx:Script> > <![CDATA[ > var language:String; > var country:String; > function initLocale(){ > language = "<%=l%>"; > country = "<%=c%>"; > mx.controls.Alert.show(language); > resourceBundleDelegate.setLocale(language,country); > } > ]]> > </mx:Script> > > <view:PaymentView /> > > <globalization:ResourceBundleDelegate > id="resourceBundleDelegate" /> > > </mx:Application> > > </mm:mxml> > > 2.portal.jsp > > <%@ page session="false" contentType="text/html" import="java.util.*, > multilanguage.*"%> > <%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %> > <%@ taglib uri="FlexTagLib" prefix="mm" %> > > <portletAPI:init/> > <table border="0" cellspacing="0" cellpadding="0" height="100%" > width="100%"> > <tr height="500"> > <td> > > > <mm:mxml> > > <% > String s =request.getHeader("Accept-Language"); > System.out.println("locale:"+s); > String l = s.substring(0,2); > String c = s.substring(3,5); > %> > <mx:Application pageTitle="Resource bundles sample application" > xmlns:mx="http://www.macromedia.com/2003/mxml > <http://www.macromedia.com/2003/mxml> " > xmlns:view="com.benorama.flex.samples.payment.view.*" > xmlns:globalization="com.benorama.flex.globalization.*" > initialize="initLocale()" > > <mx:Script> > <![CDATA[ > var language:String; > var country:String; > function initLocale(){ > language = "<%=l%>"; > country = "<%=c%>"; > mx.controls.Alert.show(language); > resourceBundleDelegate.setLocale(language,country); > } > ]]> > </mx:Script> > > <view:PaymentView /> > > <globalization:ResourceBundleDelegate > id="resourceBundleDelegate" /> > > </mx:Application> > > </mm:mxml> > > > > </td> > </tr> > </table> > > > > > if I run this locale.jsp > it have not pop alert, not execute the code: > mx.controls.Alert.show(language) > > > who hase these experience,can tell me the reason, > > thanks > > > > > > > > > > _____ > > Yahoo! Groups Links > > * To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > <http://groups.yahoo.com/group/flexcoders/> > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > * Your use of Yahoo! Groups is subject to the Yahoo! > <http://docs.yahoo.com/info/terms/> Terms of Service. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/