RE: [Mav-user] Multiple conditional ${wrapped}?
>From Cyrille Bonnet > > Hi Jim, > > > > For page1 > > And: > > > > For page2. > > (indications on wether to include functions1.js or functions2.js would be > included in maverick.xml as a transform) There are a few ways of doing this. Option #1: Specify a param in maverick.xml And then in your trim.jsp: Option #2: Pass the value from the view jsp to the transform jsp. Since the view JSP is executed before the transform JSP, you can set request attributes which are then available when the transform is executed. Look at how "title" is passed from welcome.jsp to trim.jsp in the friendbook-jsp example. In your foo.jsp: function2.js And then in your trim.jsp: This provides a reasonable way to pass big blocks of text around. If you wanted to, you could use to define the entire block of javascript. But it's usually good practice to separate out javascript functions into separate .js files anyways because the browser will cache it, making each response smaller. Jeff --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id808&op=click [INVALID FOOTER]
Re: [Mav-user] Multiple conditional ${wrapped}?
Indeed, the solution presented below is best, because then the browser will just cache the entire .js file. However, I've had problems using the XML shortcut for empty tags in this particular case, so always do Cheers, doug On Sep 1, 2004, at 4:49 PM, jim moore wrote: Why not just put all the javascript functions in a .js file and then just include that in the pages: --jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cyrille Bonnet Sent: Wednesday, September 01, 2004 10:07 PM To: [EMAIL PROTECTED] Subject: [Mav-user] Multiple conditional ${wrapped}? Hi Maverick users, I have a simple problem. Of course, I'd like a simple solution :-) We use a header JSP across many JSP pages. On some of those JSP pages, we have Javascript functions available (inside the tag), but not on all pages. We use the ${wrapped} and Maverick transformation to replace the content on our pages. But we can't have multiple ${wrapped} in one page, so we can't use Maverick transform to replace the Javascript functions when needed. Ideally, we would have something like that in the header JSP: <-- "transform" this to Javascript functions --> <-- "transform" that to body content --> At the moment, we have the choice of several (unsatisfying) workarounds: * have all Javascript functions in all pages, * create a custom header for each set of Javascript functions Any pointer would be appreciated. Cyrille. --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER] --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER] --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER]
RE: [Mav-user] Multiple conditional ${wrapped}?
Hi Jim, Thanks for your suggestion. I guess that is similar to my workaround #1 (all Javascript functions in all pages). That works all right, but I'd prefer to have only the Javascript functions I need in that page included. Something like: For page1 And: For page2. (indications on wether to include functions1.js or functions2.js would be included in maverick.xml as a transform) That would be really flexible, but it seems to be impossible to accomplish this with Maverick. Or am I missing something? Cyrille Bonnet Senior Consultant 3months.com Web: www.3months.com Tel: + 64 4 381 2884 Fax: + 64 4 381 2894 Cell: 021 446 048 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim moore Sent: Thursday, September 02, 2004 9:49 AM To: [EMAIL PROTECTED] Subject: RE: [Mav-user] Multiple conditional ${wrapped}? Why not just put all the javascript functions in a .js file and then just include that in the pages: --jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cyrille Bonnet Sent: Wednesday, September 01, 2004 10:07 PM To: [EMAIL PROTECTED] Subject: [Mav-user] Multiple conditional ${wrapped}? Hi Maverick users, I have a simple problem. Of course, I'd like a simple solution :-) We use a header JSP across many JSP pages. On some of those JSP pages, we have Javascript functions available (inside the tag), but not on all pages. We use the ${wrapped} and Maverick transformation to replace the content on our pages. But we can't have multiple ${wrapped} in one page, so we can't use Maverick transform to replace the Javascript functions when needed. Ideally, we would have something like that in the header JSP: <-- "transform" this to Javascript functions --> <-- "transform" that to body content --> At the moment, we have the choice of several (unsatisfying) workarounds: * have all Javascript functions in all pages, * create a custom header for each set of Javascript functions Any pointer would be appreciated. Cyrille. --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER] --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER] --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER]
RE: [Mav-user] Multiple conditional ${wrapped}?
Why not just put all the javascript functions in a .js file and then just include that in the pages: --jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cyrille Bonnet Sent: Wednesday, September 01, 2004 10:07 PM To: [EMAIL PROTECTED] Subject: [Mav-user] Multiple conditional ${wrapped}? Hi Maverick users, I have a simple problem. Of course, I'd like a simple solution :-) We use a header JSP across many JSP pages. On some of those JSP pages, we have Javascript functions available (inside the tag), but not on all pages. We use the ${wrapped} and Maverick transformation to replace the content on our pages. But we can't have multiple ${wrapped} in one page, so we can't use Maverick transform to replace the Javascript functions when needed. Ideally, we would have something like that in the header JSP: <-- "transform" this to Javascript functions --> <-- "transform" that to body content --> At the moment, we have the choice of several (unsatisfying) workarounds: * have all Javascript functions in all pages, * create a custom header for each set of Javascript functions Any pointer would be appreciated. Cyrille. --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER] --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click [INVALID FOOTER]