WebSphere Portal Server - Developing portlets with Javascript and CSS

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > November 2004 > Developing portlets with Javascript and CSS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Developing portlets with Javascript and CSS
Enea Catani

2004-11-17, 2:48 am

I'm developing a portlet whose JSPs need at least a CSS file containing
layout definition
and a Javascript file (.js) containing some utility functions; since I
cannot use <HEAD> tag
to define the links to these files, where can I put them in order to
re-use them in other JSPs?
In the documentation I can find that the suggested way is to write the
CSS and javascript content
in the beginPage() method of the portlet, using the suitable
encodeNamespace() function to avoid
name clashes; since these method is executed at each rendering stage,
does it concur to slow
down the overall page rendering? Is there another way to specify CSS and
Javascript files,
keeping them reusable and avoiding that my JSPs had to contain together
CSS, Javascript, Java, HTML and JSP pieces of code?

Many thanks in advance for any suggestion and best regards.

Scott A. Roehrig

2004-11-19, 5:52 pm

CSS is a tough one. JavaScript should be useable in a normal fashion or
using a suitable src tag for the <script> tag.

Scott

"Enea Catani" <enea_catani@it.ibm.com> wrote in message
news:cnf2ku$5q48$2@news.boulder.ibm.com...
> I'm developing a portlet whose JSPs need at least a CSS file containing
> layout definition
> and a Javascript file (.js) containing some utility functions; since I
> cannot use <HEAD> tag
> to define the links to these files, where can I put them in order to
> re-use them in other JSPs?
> In the documentation I can find that the suggested way is to write the CSS
> and javascript content
> in the beginPage() method of the portlet, using the suitable
> encodeNamespace() function to avoid
> name clashes; since these method is executed at each rendering stage, does
> it concur to slow
> down the overall page rendering? Is there another way to specify CSS and
> Javascript files,
> keeping them reusable and avoiding that my JSPs had to contain together
> CSS, Javascript, Java, HTML and JSP pieces of code?
>
> Many thanks in advance for any suggestion and best regards.
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com