You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kertis, Dennis" <dk...@vocollect.com> on 2007/04/23 21:41:39 UTC

Including javascript in a plugin

Is it possible to include javascript in a plugin that will be included
by freemarker files?  Also, can I include jar libs since I don't expect
the project including my plugin to need them?

 

Thanks,

Dennis

 


Re: Including javascript in a plugin

Posted by Musachy Barroso <mu...@gmail.com>.
If what you mean is including js files that you can use from your pages, or
freemarker, I don't think so. I think it would nice to have a way to map
resources to paths in a plugin, like:

<resource name="super.js" path="/js/super.js" />

that would at least solve the problem of packaging js and css files in
plugins, as for jsps, I kind of gave up on it :)

musachy

On 4/23/07, Martin Gainty <mg...@hotmail.com> wrote:
>
> Good Afternoon Dennis-
>
> I dont know if this will help your specific requirement but
> there is script coded in test.ftl (freemarker script) from
> struts-showcase-2.0.1
>
> <html>
> <head>
>   <@s.head theme="ajax" debug="true" />
> </head>
> <body>
> <a href="#" id="myAnchor">click</a>
> <script>
>   var anchor = dojo.byId("myAnchor");
>   alert(anchor);
>   dojo.event.connect(anchor, "onclick", function(event) {
>    alert('Custom onclick handler triggered before submitting form... Press
> OK!');
>   });
> </script>
> </body>
> </html>
>
> M--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> ----- Original Message -----
> From: "Kertis, Dennis" <dk...@vocollect.com>
> To: <us...@struts.apache.org>
> Sent: Monday, April 23, 2007 3:41 PM
> Subject: Including javascript in a plugin
>
>
> Is it possible to include javascript in a plugin that will be included
> by freemarker files?  Also, can I include jar libs since I don't expect
> the project including my plugin to need them?
>
>
>
> Thanks,
>
> Dennis
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

RE: Including javascript in a plugin

Posted by "Kertis, Dennis" <dk...@vocollect.com>.
Actually, I have a lot of javascript in JS files and would like to be
able to include them from an FTL file.  But from looking at the plugin
examples it doesn't seem like I am able to do this.  Anyone have any
ideas???

-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Monday, April 23, 2007 4:17 PM
To: Struts Users Mailing List
Subject: Re: Including javascript in a plugin

Good Afternoon Dennis-

I dont know if this will help your specific requirement but
there is script coded in test.ftl (freemarker script) from 
struts-showcase-2.0.1

<html>
<head>
  <@s.head theme="ajax" debug="true" />
</head>
<body>
 <a href="#" id="myAnchor">click</a>
 <script>
  var anchor = dojo.byId("myAnchor");
  alert(anchor);
  dojo.event.connect(anchor, "onclick", function(event) {
   alert('Custom onclick handler triggered before submitting form...
Press 
OK!');
  });
 </script>
</body>
</html>

M--
This email message and any files transmitted with it contain
confidential
information intended only for the person(s) to whom this email message
is
addressed.  If you have received this email message in error, please
notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Kertis, Dennis" <dk...@vocollect.com>
To: <us...@struts.apache.org>
Sent: Monday, April 23, 2007 3:41 PM
Subject: Including javascript in a plugin


Is it possible to include javascript in a plugin that will be included
by freemarker files?  Also, can I include jar libs since I don't expect
the project including my plugin to need them?



Thanks,

Dennis





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


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


Re: Including javascript in a plugin

Posted by Martin Gainty <mg...@hotmail.com>.
Good Afternoon Dennis-

I dont know if this will help your specific requirement but
there is script coded in test.ftl (freemarker script) from 
struts-showcase-2.0.1

<html>
<head>
  <@s.head theme="ajax" debug="true" />
</head>
<body>
 <a href="#" id="myAnchor">click</a>
 <script>
  var anchor = dojo.byId("myAnchor");
  alert(anchor);
  dojo.event.connect(anchor, "onclick", function(event) {
   alert('Custom onclick handler triggered before submitting form... Press 
OK!');
  });
 </script>
</body>
</html>

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Kertis, Dennis" <dk...@vocollect.com>
To: <us...@struts.apache.org>
Sent: Monday, April 23, 2007 3:41 PM
Subject: Including javascript in a plugin


Is it possible to include javascript in a plugin that will be included
by freemarker files?  Also, can I include jar libs since I don't expect
the project including my plugin to need them?



Thanks,

Dennis





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