You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Francisco J. Bido" <bi...@mac.com> on 2003/05/16 19:58:28 UTC

JavaScript and JSP/Servlets

First some disclaimers.  I do know that JavaScript is a client side and 
the JSP/Servlet is a server side technology.  I do know that JSPs can 
handle pretty much any presentation layer task that JavaScript can and, 
of course, way much more.  So why bother? Well, there are advantages to 
having the client handle certain data tasks i.e., sorting tables.   
 From a performance perspective, it doesn't make much sense to do a 
round trip to the serve,r if all you need to do is rearrange the data 
that already resides on the client side.   There are some nifty 
JavaScripts out there that I would like to use for such tasks.   My 
question is, what is/are the best ways to pass data to a JavaScript?

Here's my  thought history:

1.  Use HttpSession:  I can't. This object lives  on the server side 
web container.
2.  Use cookies:  Are JSP/Servlet cookies compatible with JavaScript 
cookies? I don't know... But in any event, cookies cannot designed to 
handle large amounts of data.
3. Brute force: use a JSP to get data and then drop it on a client side 
flat file and then read it from JavaScript.  Yucky! as my daughter 
would put it. But theoretically possible, I guess.

What are your thoughts on the matter?

Thanks!
-FB


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


Re: JavaScript and JSP/Servlets

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
Sorry -- I overcomplicated the problem.  Further evidence that it's easiest 
to see the problems of the world tinged with whatever color your glasses are.

Cheers,
justin


At 02:38 PM 5/16/2003, you wrote:
>Thanks Justin, I see how it works.
>
>I guess I was drowning in glass of water. Sasha's suggestion is exactly 
>what I needed.
>
>Best,
>-FB
>
>On Friday, May 16, 2003, at 04:05  PM, Justin Ruthenbeck wrote:
>
>>At 12:15 PM 5/16/2003, you wrote:
>>
>>>>by directing the hidden frame to reload itself with a URL that the 
>>>>server will generate data in a js datatype for
>>>
>>>Very interesting...  Can you elaborate further on what these data types 
>>>are and how might one generate them on the server? I never heard about 
>>>this.  I will also search the mailing list per your suggestion.
>>
>>I'm not sure how familiar you are with the different technologies here, 
>>so my apologies if this is too much/little detail.  Also, Sasha Borodin's 
>>response may be all you need -- if so, you can disregard the rest of this 
>>message.  :)
>>
>>Lets say you have a page and you want to display a list of entities 
>>(people, accounts, butterflies) that your webapp gets from a 
>>database.  You've already got servlet/java code that gets this from the 
>>database and your servlet has access to it via a List of java objects 
>>with get/set methods for each attribute (a List of JavaBeans).
>>
>>Map the URL:
>>http://my.server.com/jsDataWin
>>
>>to your servlet and return the following code as a response:
>>
>>--------------------BEGIN CODE----------
>><HTML><HEAD><TITLE>Data Window</TITLE>
>><script language="Javascript">
>>
>>var fields = new Array();
>>var field = new Object();
>>
>>field = new Object();
>>field.firstname = "John";
>>field.lastname = "Smith";
>>fields[0] = field;
>>
>>field = new Object();
>>field.firstname = "Sally";
>>field.lastname = "Williams";
>>fields[1] = field;
>>
>>function loadArray()
>>{
>>   parent.notifyFieldPreloadComplete();
>>}
>>
>>function doOnLoad(){
>>   parent.notifyDataLoadComplete();
>>}
>>
>>function loadPage(loadURL){
>>   loadURL = encodeURI(loadURL);
>>   location.href = loadURL;
>>}
>></script>
>></HEAD>
>>
>><BODY topmargin=0 leftmargin=0 onLoad="doOnLoad();">
>>
>></BODY></HTML>
>>--------------------END CODE----------
>>
>>Now you've got your main page which has two frames, called "main" and 
>>"data".  In your main frame, add a function called 
>>"notifyFieldPreloadComplete()" and in it's doOnLoad() (or equivalent) 
>>function, get a reference to the data frame and do:
>>
>>dataFrame.loadPage('http://my.server.com/jsDataWin');
>>
>>The data frame will call back into your main frame to let it know that 
>>loading is complete.  From that point on, you can get all the data you 
>>want from the data frame.  This is the basic idea.  You can, of course, 
>>augment the js code returned to the data frame to make other services 
>>available to your main frame.
>>
>>One design caveat: all of this is done to make javascript approximate 
>>object-oriented design, but the language wasn't designed to do stuff like 
>>this -- you're playing on thin ice.  Like John Turner said, if you've got 
>>grand intentions for your functionality, look into using an applet 
>>instead.  For pure data presentation, I've been using this method and it 
>>works quite elegantly.
>>
>>justin
>>
>>____________________________________
>>Justin Ruthenbeck
>>Software Engineer, NextEngine Inc.
>>justinr - AT - nextengine DOT com
>>Confidential
>>    See http://www.nextengine.com/confidentiality.php
>>____________________________________
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
Thanks Justin, I see how it works.

I guess I was drowning in glass of water. Sasha's suggestion is exactly 
what I needed.

Best,
-FB

On Friday, May 16, 2003, at 04:05  PM, Justin Ruthenbeck wrote:

> At 12:15 PM 5/16/2003, you wrote:
>
>>> by directing the hidden frame to reload itself with a URL that the 
>>> server will generate data in a js datatype for
>>
>> Very interesting...  Can you elaborate further on what these data 
>> types are and how might one generate them on the server? I never 
>> heard about this.  I will also search the mailing list per your 
>> suggestion.
>
> I'm not sure how familiar you are with the different technologies 
> here, so my apologies if this is too much/little detail.  Also, Sasha 
> Borodin's response may be all you need -- if so, you can disregard the 
> rest of this message.  :)
>
> Lets say you have a page and you want to display a list of entities 
> (people, accounts, butterflies) that your webapp gets from a database. 
>  You've already got servlet/java code that gets this from the database 
> and your servlet has access to it via a List of java objects with 
> get/set methods for each attribute (a List of JavaBeans).
>
> Map the URL:
> http://my.server.com/jsDataWin
>
> to your servlet and return the following code as a response:
>
> --------------------BEGIN CODE----------
> <HTML><HEAD><TITLE>Data Window</TITLE>
> <script language="Javascript">
>
> var fields = new Array();
> var field = new Object();
>
> field = new Object();
> field.firstname = "John";
> field.lastname = "Smith";
> fields[0] = field;
>
> field = new Object();
> field.firstname = "Sally";
> field.lastname = "Williams";
> fields[1] = field;
>
> function loadArray()
> {
>   parent.notifyFieldPreloadComplete();
> }
>
> function doOnLoad(){
>   parent.notifyDataLoadComplete();
> }
>
> function loadPage(loadURL){
>   loadURL = encodeURI(loadURL);
>   location.href = loadURL;
> }
> </script>
> </HEAD>
>
> <BODY topmargin=0 leftmargin=0 onLoad="doOnLoad();">
>
> </BODY></HTML>
> --------------------END CODE----------
>
> Now you've got your main page which has two frames, called "main" and 
> "data".  In your main frame, add a function called 
> "notifyFieldPreloadComplete()" and in it's doOnLoad() (or equivalent) 
> function, get a reference to the data frame and do:
>
> dataFrame.loadPage('http://my.server.com/jsDataWin');
>
> The data frame will call back into your main frame to let it know that 
> loading is complete.  From that point on, you can get all the data you 
> want from the data frame.  This is the basic idea.  You can, of 
> course, augment the js code returned to the data frame to make other 
> services available to your main frame.
>
> One design caveat: all of this is done to make javascript approximate 
> object-oriented design, but the language wasn't designed to do stuff 
> like this -- you're playing on thin ice.  Like John Turner said, if 
> you've got grand intentions for your functionality, look into using an 
> applet instead.  For pure data presentation, I've been using this 
> method and it works quite elegantly.
>
> justin
>
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential
>    See http://www.nextengine.com/confidentiality.php
> ____________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
At 12:15 PM 5/16/2003, you wrote:

>>by directing the hidden frame to reload itself with a URL that the server 
>>will generate data in a js datatype for
>
>Very interesting...  Can you elaborate further on what these data types 
>are and how might one generate them on the server? I never heard about 
>this.  I will also search the mailing list per your suggestion.

I'm not sure how familiar you are with the different technologies here, so 
my apologies if this is too much/little detail.  Also, Sasha Borodin's 
response may be all you need -- if so, you can disregard the rest of this 
message.  :)

Lets say you have a page and you want to display a list of entities 
(people, accounts, butterflies) that your webapp gets from a 
database.  You've already got servlet/java code that gets this from the 
database and your servlet has access to it via a List of java objects with 
get/set methods for each attribute (a List of JavaBeans).

Map the URL:
http://my.server.com/jsDataWin

to your servlet and return the following code as a response:

--------------------BEGIN CODE----------
<HTML><HEAD><TITLE>Data Window</TITLE>
<script language="Javascript">

var fields = new Array();
var field = new Object();

field = new Object();
field.firstname = "John";
field.lastname = "Smith";
fields[0] = field;

field = new Object();
field.firstname = "Sally";
field.lastname = "Williams";
fields[1] = field;

function loadArray()
{
   parent.notifyFieldPreloadComplete();
}

function doOnLoad(){
   parent.notifyDataLoadComplete();
}

function loadPage(loadURL){
   loadURL = encodeURI(loadURL);
   location.href = loadURL;
}
</script>
</HEAD>

<BODY topmargin=0 leftmargin=0 onLoad="doOnLoad();">

</BODY></HTML>
--------------------END CODE----------

Now you've got your main page which has two frames, called "main" and 
"data".  In your main frame, add a function called 
"notifyFieldPreloadComplete()" and in it's doOnLoad() (or equivalent) 
function, get a reference to the data frame and do:

dataFrame.loadPage('http://my.server.com/jsDataWin');

The data frame will call back into your main frame to let it know that 
loading is complete.  From that point on, you can get all the data you want 
from the data frame.  This is the basic idea.  You can, of course, augment 
the js code returned to the data frame to make other services available to 
your main frame.

One design caveat: all of this is done to make javascript approximate 
object-oriented design, but the language wasn't designed to do stuff like 
this -- you're playing on thin ice.  Like John Turner said, if you've got 
grand intentions for your functionality, look into using an applet 
instead.  For pure data presentation, I've been using this method and it 
works quite elegantly.

justin

____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
> by directing the hidden frame to reload itself with a URL that the 
> server will generate data in a js datatype for

Very interesting...  Can you elaborate further on what these data types 
are and how might one generate them on the server? I never heard about 
this.  I will also search the mailing list per your suggestion.

Thanks,
-FB


On Friday, May 16, 2003, at 01:54  PM, Justin Ruthenbeck wrote:

> At 10:58 AM 5/16/2003, you wrote:
>> First some disclaimers.  I do know that JavaScript is a client side 
>> and the JSP/Servlet is a server side technology.  I do know that JSPs 
>> can handle pretty much any presentation layer task that JavaScript 
>> can and, of course, way much more.  So why bother? Well, there are 
>> advantages to having the client handle certain data tasks i.e., 
>> sorting tables.
>> From a performance perspective, it doesn't make much sense to do a 
>> round trip to the serve,r if all you need to do is rearrange the data 
>> that already resides on the client side.   There are some nifty 
>> JavaScripts out there that I would like to use for such tasks.   My 
>> question is, what is/are the best ways to pass data to a JavaScript?
>
> The general idea for this class of problems is to create a separate 
> data "container" (in this case, it could be a hidden frame).  Have 
> your main component (your main html page) tell the data container to 
> get the data (by directing the hidden frame to reload itself with a 
> URL that the server will generate data in a js datatype for).  Once 
> the data container has the data, have it notify the main component 
> that it's ready.  You now have a data bridge to your javascript ... if 
> you need to get the most recent data, reload the data frame.
>
> The situation gets much more complicated if you're doing anything 
> other than reading the data -- you'll probably want to avoid it.
>
> This should get you off in the right direction ... there have been 
> threads discussing similar problems.  Try searching the Tomcat archive 
> for "javascript hidden frame data passing" or something along those 
> lines.
>
> justin
>
>
>
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential
>    See http://www.nextengine.com/confidentiality.php
> ____________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
Yeah, your absolutely right.  I have used JSTL before and it is indeed  
solid.  I just had  a brain fart in regards to passing data to  
JavaScript.

Best,
-FB


On Friday, May 16, 2003, at 04:53  PM, Sasha Borodin wrote:

> Glad I could help :)
>
> I think this is adequate for exceptional JavaScript use - I try not to  
> rely
> on the client side.  But for some things (like updating one list based  
> on
> the selection of another) it can't be avoided.
>
> If you use JavaScript extensively, David Lopez's JSTL suggestion is  
> probably
> the way to go.
>
> Take care,
>
> -Sasha
>
> On 5/16/03 16:40, "Francisco J. Bido" <bi...@mac.com> wrote:
>
>> And we have a winner.  Thanks Sasha, maybe I just need to get more
>> sleep...
>>
>> Cheers,
>> -FB
>>
>>
>> On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:
>>
>>> Perhaps I'm missing the complexity of your problem, but nonetheless:
>>>
>>> If I want javascript to massage data (sorting, dynamic menus, etc.),  
>>> I
>>> simply "write" javascript data structures (arrays mostly) in the JSP:
>>>
>>> myJavaScriptData = new Array();
>>>
>>> <%
>>>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>>>     Enumeration myJavaDataEnum = myJavaData.elements();
>>>     int count = 0;
>>>
>>>     while(myJavaDataEnum.hasMoreElements()) {
>>>         String data = (String) myJavaDataEnum.nextElement();
>>> %>
>>>         myJavaScriptData[<%= count %>] = <%= data %>;
>>> <%
>>>         count++;
>>>     }
>>> %>
>>>
>>> Then I have an init script that get's called onLoad, and uses the
>>> printed
>>> javascript arrays to do its things.
>>>
>>> HTH,
>>>
>>> -Sasha
>>>
>>> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>>>
>>>> At 10:58 AM 5/16/2003, you wrote:
>>>>> First some disclaimers.  I do know that JavaScript is a client side
>>>>> and
>>>>> the JSP/Servlet is a server side technology.  I do know that JSPs  
>>>>> can
>>>>> handle pretty much any presentation layer task that JavaScript can
>>>>> and, of
>>>>> course, way much more.  So why bother? Well, there are advantages  
>>>>> to
>>>>> having the client handle certain data tasks i.e., sorting tables.
>>>>> From a performance perspective, it doesn't make much sense to do a
>>>>> round
>>>>> trip to the serve,r if all you need to do is rearrange the data  
>>>>> that
>>>>> already resides on the client side.   There are some nifty
>>>>> JavaScripts
>>>>> out there that I would like to use for such tasks.   My question  
>>>>> is,
>>>>> what
>>>>> is/are the best ways to pass data to a JavaScript?
>>>>
>>>> The general idea for this class of problems is to create a separate
>>>> data
>>>> "container" (in this case, it could be a hidden frame).  Have your
>>>> main
>>>> component (your main html page) tell the data container to get the
>>>> data (by
>>>> directing the hidden frame to reload itself with a URL that the
>>>> server will
>>>> generate data in a js datatype for).  Once the data container has  
>>>> the
>>>> data,
>>>> have it notify the main component that it's ready.  You now have a
>>>> data
>>>> bridge to your javascript ... if you need to get the most recent  
>>>> data,
>>>> reload the data frame.
>>>>
>>>> The situation gets much more complicated if you're doing anything
>>>> other
>>>> than reading the data -- you'll probably want to avoid it.
>>>>
>>>> This should get you off in the right direction ... there have been
>>>> threads
>>>> discussing similar problems.  Try searching the Tomcat archive for
>>>> "javascript hidden frame data passing" or something along those  
>>>> lines.
>>>>
>>>> justin
>>>>
>>>>
>>>>
>>>> ____________________________________
>>>> Justin Ruthenbeck
>>>> Software Engineer, NextEngine Inc.
>>>> justinr - AT - nextengine DOT com
>>>> Confidential
>>>>   See http://www.nextengine.com/confidentiality.php
>>>> ____________________________________
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by Sasha Borodin <sa...@whoissasha.com>.
Glad I could help :)

I think this is adequate for exceptional JavaScript use - I try not to rely
on the client side.  But for some things (like updating one list based on
the selection of another) it can't be avoided.

If you use JavaScript extensively, David Lopez's JSTL suggestion is probably
the way to go.

Take care,

-Sasha

On 5/16/03 16:40, "Francisco J. Bido" <bi...@mac.com> wrote:

> And we have a winner.  Thanks Sasha, maybe I just need to get more
> sleep...
> 
> Cheers,
> -FB
> 
> 
> On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:
> 
>> Perhaps I'm missing the complexity of your problem, but nonetheless:
>> 
>> If I want javascript to massage data (sorting, dynamic menus, etc.), I
>> simply "write" javascript data structures (arrays mostly) in the JSP:
>> 
>> myJavaScriptData = new Array();
>> 
>> <%
>>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>>     Enumeration myJavaDataEnum = myJavaData.elements();
>>     int count = 0;
>> 
>>     while(myJavaDataEnum.hasMoreElements()) {
>>         String data = (String) myJavaDataEnum.nextElement();
>> %>
>>         myJavaScriptData[<%= count %>] = <%= data %>;
>> <%
>>         count++;
>>     }
>> %>
>> 
>> Then I have an init script that get's called onLoad, and uses the
>> printed
>> javascript arrays to do its things.
>> 
>> HTH,
>> 
>> -Sasha
>> 
>> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>> 
>>> At 10:58 AM 5/16/2003, you wrote:
>>>> First some disclaimers.  I do know that JavaScript is a client side
>>>> and
>>>> the JSP/Servlet is a server side technology.  I do know that JSPs can
>>>> handle pretty much any presentation layer task that JavaScript can
>>>> and, of
>>>> course, way much more.  So why bother? Well, there are advantages to
>>>> having the client handle certain data tasks i.e., sorting tables.
>>>> From a performance perspective, it doesn't make much sense to do a
>>>> round
>>>> trip to the serve,r if all you need to do is rearrange the data that
>>>> already resides on the client side.   There are some nifty
>>>> JavaScripts
>>>> out there that I would like to use for such tasks.   My question is,
>>>> what
>>>> is/are the best ways to pass data to a JavaScript?
>>> 
>>> The general idea for this class of problems is to create a separate
>>> data
>>> "container" (in this case, it could be a hidden frame).  Have your
>>> main
>>> component (your main html page) tell the data container to get the
>>> data (by
>>> directing the hidden frame to reload itself with a URL that the
>>> server will
>>> generate data in a js datatype for).  Once the data container has the
>>> data,
>>> have it notify the main component that it's ready.  You now have a
>>> data
>>> bridge to your javascript ... if you need to get the most recent data,
>>> reload the data frame.
>>> 
>>> The situation gets much more complicated if you're doing anything
>>> other
>>> than reading the data -- you'll probably want to avoid it.
>>> 
>>> This should get you off in the right direction ... there have been
>>> threads
>>> discussing similar problems.  Try searching the Tomcat archive for
>>> "javascript hidden frame data passing" or something along those lines.
>>> 
>>> justin
>>> 
>>> 
>>> 
>>> ____________________________________
>>> Justin Ruthenbeck
>>> Software Engineer, NextEngine Inc.
>>> justinr - AT - nextengine DOT com
>>> Confidential
>>>   See http://www.nextengine.com/confidentiality.php
>>> ____________________________________
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
And we have a winner.  Thanks Sasha, maybe I just need to get more 
sleep...

Cheers,
-FB


On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:

> Perhaps I'm missing the complexity of your problem, but nonetheless:
>
> If I want javascript to massage data (sorting, dynamic menus, etc.), I
> simply "write" javascript data structures (arrays mostly) in the JSP:
>
> myJavaScriptData = new Array();
>
> <%
>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>     Enumeration myJavaDataEnum = myJavaData.elements();
>     int count = 0;
>
>     while(myJavaDataEnum.hasMoreElements()) {
>         String data = (String) myJavaDataEnum.nextElement();
> %>
>         myJavaScriptData[<%= count %>] = <%= data %>;
> <%
>         count++;
>     }
> %>
>
> Then I have an init script that get's called onLoad, and uses the 
> printed
> javascript arrays to do its things.
>
> HTH,
>
> -Sasha
>
> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>
>> At 10:58 AM 5/16/2003, you wrote:
>>> First some disclaimers.  I do know that JavaScript is a client side 
>>> and
>>> the JSP/Servlet is a server side technology.  I do know that JSPs can
>>> handle pretty much any presentation layer task that JavaScript can 
>>> and, of
>>> course, way much more.  So why bother? Well, there are advantages to
>>> having the client handle certain data tasks i.e., sorting tables.
>>> From a performance perspective, it doesn't make much sense to do a 
>>> round
>>> trip to the serve,r if all you need to do is rearrange the data that
>>> already resides on the client side.   There are some nifty 
>>> JavaScripts
>>> out there that I would like to use for such tasks.   My question is, 
>>> what
>>> is/are the best ways to pass data to a JavaScript?
>>
>> The general idea for this class of problems is to create a separate 
>> data
>> "container" (in this case, it could be a hidden frame).  Have your 
>> main
>> component (your main html page) tell the data container to get the 
>> data (by
>> directing the hidden frame to reload itself with a URL that the 
>> server will
>> generate data in a js datatype for).  Once the data container has the 
>> data,
>> have it notify the main component that it's ready.  You now have a 
>> data
>> bridge to your javascript ... if you need to get the most recent data,
>> reload the data frame.
>>
>> The situation gets much more complicated if you're doing anything 
>> other
>> than reading the data -- you'll probably want to avoid it.
>>
>> This should get you off in the right direction ... there have been 
>> threads
>> discussing similar problems.  Try searching the Tomcat archive for
>> "javascript hidden frame data passing" or something along those lines.
>>
>> justin
>>
>>
>>
>> ____________________________________
>> Justin Ruthenbeck
>> Software Engineer, NextEngine Inc.
>> justinr - AT - nextengine DOT com
>> Confidential
>>   See http://www.nextengine.com/confidentiality.php
>> ____________________________________
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
Well there you go.  I couldn't be more thankful.

Now it's time to go have a few beers and kill those idiotic brain cells.

Best,
-FB

On Saturday, May 17, 2003, at 04:58  PM, Sasha Borodin wrote:

> Since your data is a String, you should enclose it in quotes within the
> JavaScript code as well:
>
> myJavaScriptData[0] = "<%= data %>";
>
>
> On 5/16/03 18:11, "Francisco J. Bido" <bi...@mac.com> wrote:
>
>> Hi Sasha,
>>
>> My test does not work, see below; it's simpler but fundamentally the
>> same as your example.  Do you or anyone see the issue?
>>
>> Thanks!
>>
>>
>>
>> <html>
>> <head>
>> <title>JSP to JS Test</title>
>> </head>
>>
>> <body>
>>
>> <%
>> String data = " Snoopy";
>> %>
>>
>>
>> <p>JSP data =  <%= data %></p>
>>
>> <script language="JavaScript">
>>
>> var myJavaScriptData = new Array();
>>
>> alert("Attempting to pass data");
>>
>> myJavaScriptData[0] = <%= data %>;
>>
>> document.write("<b> JavaScript data = " + myJavaScriptData[0] +
>> "</b>");
>>
>> </script>
>>
>> </body>
>> </html>
>>
>>
>>
>>
>> On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:
>>
>>> Perhaps I'm missing the complexity of your problem, but nonetheless:
>>>
>>> If I want javascript to massage data (sorting, dynamic menus, etc.),  
>>> I
>>> simply "write" javascript data structures (arrays mostly) in the JSP:
>>>
>>> myJavaScriptData = new Array();
>>>
>>> <%
>>>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>>>     Enumeration myJavaDataEnum = myJavaData.elements();
>>>     int count = 0;
>>>
>>>     while(myJavaDataEnum.hasMoreElements()) {
>>>         String data = (String) myJavaDataEnum.nextElement();
>>> %>
>>>         myJavaScriptData[<%= count %>] = <%= data %>;
>>> <%
>>>         count++;
>>>     }
>>> %>
>>>
>>> Then I have an init script that get's called onLoad, and uses the
>>> printed
>>> javascript arrays to do its things.
>>>
>>> HTH,
>>>
>>> -Sasha
>>>
>>> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>>>
>>>> At 10:58 AM 5/16/2003, you wrote:
>>>>> First some disclaimers.  I do know that JavaScript is a client side
>>>>> and
>>>>> the JSP/Servlet is a server side technology.  I do know that JSPs  
>>>>> can
>>>>> handle pretty much any presentation layer task that JavaScript can
>>>>> and, of
>>>>> course, way much more.  So why bother? Well, there are advantages  
>>>>> to
>>>>> having the client handle certain data tasks i.e., sorting tables.
>>>>> From a performance perspective, it doesn't make much sense to do a
>>>>> round
>>>>> trip to the serve,r if all you need to do is rearrange the data  
>>>>> that
>>>>> already resides on the client side.   There are some nifty
>>>>> JavaScripts
>>>>> out there that I would like to use for such tasks.   My question  
>>>>> is,
>>>>> what
>>>>> is/are the best ways to pass data to a JavaScript?
>>>>
>>>> The general idea for this class of problems is to create a separate
>>>> data
>>>> "container" (in this case, it could be a hidden frame).  Have your
>>>> main
>>>> component (your main html page) tell the data container to get the
>>>> data (by
>>>> directing the hidden frame to reload itself with a URL that the
>>>> server will
>>>> generate data in a js datatype for).  Once the data container has  
>>>> the
>>>> data,
>>>> have it notify the main component that it's ready.  You now have a
>>>> data
>>>> bridge to your javascript ... if you need to get the most recent  
>>>> data,
>>>> reload the data frame.
>>>>
>>>> The situation gets much more complicated if you're doing anything
>>>> other
>>>> than reading the data -- you'll probably want to avoid it.
>>>>
>>>> This should get you off in the right direction ... there have been
>>>> threads
>>>> discussing similar problems.  Try searching the Tomcat archive for
>>>> "javascript hidden frame data passing" or something along those  
>>>> lines.
>>>>
>>>> justin
>>>>
>>>>
>>>>
>>>> ____________________________________
>>>> Justin Ruthenbeck
>>>> Software Engineer, NextEngine Inc.
>>>> justinr - AT - nextengine DOT com
>>>> Confidential
>>>>   See http://www.nextengine.com/confidentiality.php
>>>> ____________________________________
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by Sasha Borodin <sa...@whoissasha.com>.
Since your data is a String, you should enclose it in quotes within the
JavaScript code as well:

myJavaScriptData[0] = "<%= data %>";


On 5/16/03 18:11, "Francisco J. Bido" <bi...@mac.com> wrote:

> Hi Sasha,
> 
> My test does not work, see below; it's simpler but fundamentally the
> same as your example.  Do you or anyone see the issue?
> 
> Thanks!
> 
> 
> 
> <html>
> <head>
> <title>JSP to JS Test</title>
> </head>
> 
> <body>
> 
> <%
> String data = " Snoopy";
> %>
> 
> 
> <p>JSP data =  <%= data %></p>
> 
> <script language="JavaScript">
> 
> var myJavaScriptData = new Array();
> 
> alert("Attempting to pass data");
> 
> myJavaScriptData[0] = <%= data %>;
> 
> document.write("<b> JavaScript data = " + myJavaScriptData[0] +
> "</b>");
> 
> </script>
> 
> </body>
> </html>
> 
> 
> 
> 
> On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:
> 
>> Perhaps I'm missing the complexity of your problem, but nonetheless:
>> 
>> If I want javascript to massage data (sorting, dynamic menus, etc.), I
>> simply "write" javascript data structures (arrays mostly) in the JSP:
>> 
>> myJavaScriptData = new Array();
>> 
>> <%
>>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>>     Enumeration myJavaDataEnum = myJavaData.elements();
>>     int count = 0;
>> 
>>     while(myJavaDataEnum.hasMoreElements()) {
>>         String data = (String) myJavaDataEnum.nextElement();
>> %>
>>         myJavaScriptData[<%= count %>] = <%= data %>;
>> <%
>>         count++;
>>     }
>> %>
>> 
>> Then I have an init script that get's called onLoad, and uses the
>> printed
>> javascript arrays to do its things.
>> 
>> HTH,
>> 
>> -Sasha
>> 
>> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>> 
>>> At 10:58 AM 5/16/2003, you wrote:
>>>> First some disclaimers.  I do know that JavaScript is a client side
>>>> and
>>>> the JSP/Servlet is a server side technology.  I do know that JSPs can
>>>> handle pretty much any presentation layer task that JavaScript can
>>>> and, of
>>>> course, way much more.  So why bother? Well, there are advantages to
>>>> having the client handle certain data tasks i.e., sorting tables.
>>>> From a performance perspective, it doesn't make much sense to do a
>>>> round
>>>> trip to the serve,r if all you need to do is rearrange the data that
>>>> already resides on the client side.   There are some nifty
>>>> JavaScripts
>>>> out there that I would like to use for such tasks.   My question is,
>>>> what
>>>> is/are the best ways to pass data to a JavaScript?
>>> 
>>> The general idea for this class of problems is to create a separate
>>> data
>>> "container" (in this case, it could be a hidden frame).  Have your
>>> main
>>> component (your main html page) tell the data container to get the
>>> data (by
>>> directing the hidden frame to reload itself with a URL that the
>>> server will
>>> generate data in a js datatype for).  Once the data container has the
>>> data,
>>> have it notify the main component that it's ready.  You now have a
>>> data
>>> bridge to your javascript ... if you need to get the most recent data,
>>> reload the data frame.
>>> 
>>> The situation gets much more complicated if you're doing anything
>>> other
>>> than reading the data -- you'll probably want to avoid it.
>>> 
>>> This should get you off in the right direction ... there have been
>>> threads
>>> discussing similar problems.  Try searching the Tomcat archive for
>>> "javascript hidden frame data passing" or something along those lines.
>>> 
>>> justin
>>> 
>>> 
>>> 
>>> ____________________________________
>>> Justin Ruthenbeck
>>> Software Engineer, NextEngine Inc.
>>> justinr - AT - nextengine DOT com
>>> Confidential
>>>   See http://www.nextengine.com/confidentiality.php
>>> ____________________________________
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> 


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


Re: JavaScript and JSP/Servlets

Posted by "Francisco J. Bido" <bi...@mac.com>.
Hi Sasha,

My test does not work, see below; it's simpler but fundamentally the 
same as your example.  Do you or anyone see the issue?

Thanks!



<html>
<head>
	<title>JSP to JS Test</title>
</head>

<body>

<%
	String data = " Snoopy";
%>


<p>JSP data =  <%= data %></p>

<script language="JavaScript">

	var myJavaScriptData = new Array();
	
    	alert("Attempting to pass data");
    	
	myJavaScriptData[0] = <%= data %>;
	
	document.write("<b> JavaScript data = " + myJavaScriptData[0] + 
"</b>");

</script>

</body>
</html>




On Friday, May 16, 2003, at 03:26  PM, Sasha Borodin wrote:

> Perhaps I'm missing the complexity of your problem, but nonetheless:
>
> If I want javascript to massage data (sorting, dynamic menus, etc.), I
> simply "write" javascript data structures (arrays mostly) in the JSP:
>
> myJavaScriptData = new Array();
>
> <%
>     Vector myJavaData = (Vector) request.getAttribute("myJavaData");
>     Enumeration myJavaDataEnum = myJavaData.elements();
>     int count = 0;
>
>     while(myJavaDataEnum.hasMoreElements()) {
>         String data = (String) myJavaDataEnum.nextElement();
> %>
>         myJavaScriptData[<%= count %>] = <%= data %>;
> <%
>         count++;
>     }
> %>
>
> Then I have an init script that get's called onLoad, and uses the 
> printed
> javascript arrays to do its things.
>
> HTH,
>
> -Sasha
>
> On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:
>
>> At 10:58 AM 5/16/2003, you wrote:
>>> First some disclaimers.  I do know that JavaScript is a client side 
>>> and
>>> the JSP/Servlet is a server side technology.  I do know that JSPs can
>>> handle pretty much any presentation layer task that JavaScript can 
>>> and, of
>>> course, way much more.  So why bother? Well, there are advantages to
>>> having the client handle certain data tasks i.e., sorting tables.
>>> From a performance perspective, it doesn't make much sense to do a 
>>> round
>>> trip to the serve,r if all you need to do is rearrange the data that
>>> already resides on the client side.   There are some nifty 
>>> JavaScripts
>>> out there that I would like to use for such tasks.   My question is, 
>>> what
>>> is/are the best ways to pass data to a JavaScript?
>>
>> The general idea for this class of problems is to create a separate 
>> data
>> "container" (in this case, it could be a hidden frame).  Have your 
>> main
>> component (your main html page) tell the data container to get the 
>> data (by
>> directing the hidden frame to reload itself with a URL that the 
>> server will
>> generate data in a js datatype for).  Once the data container has the 
>> data,
>> have it notify the main component that it's ready.  You now have a 
>> data
>> bridge to your javascript ... if you need to get the most recent data,
>> reload the data frame.
>>
>> The situation gets much more complicated if you're doing anything 
>> other
>> than reading the data -- you'll probably want to avoid it.
>>
>> This should get you off in the right direction ... there have been 
>> threads
>> discussing similar problems.  Try searching the Tomcat archive for
>> "javascript hidden frame data passing" or something along those lines.
>>
>> justin
>>
>>
>>
>> ____________________________________
>> Justin Ruthenbeck
>> Software Engineer, NextEngine Inc.
>> justinr - AT - nextengine DOT com
>> Confidential
>>   See http://www.nextengine.com/confidentiality.php
>> ____________________________________
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


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


Re: JavaScript and JSP/Servlets

Posted by Sasha Borodin <sa...@whoissasha.com>.
Perhaps I'm missing the complexity of your problem, but nonetheless:

If I want javascript to massage data (sorting, dynamic menus, etc.), I
simply "write" javascript data structures (arrays mostly) in the JSP:

myJavaScriptData = new Array();

<%
    Vector myJavaData = (Vector) request.getAttribute("myJavaData");
    Enumeration myJavaDataEnum = myJavaData.elements();
    int count = 0;

    while(myJavaDataEnum.hasMoreElements()) {
        String data = (String) myJavaDataEnum.nextElement();
%>
        myJavaScriptData[<%= count %>] = <%= data %>;
<%
        count++;
    }
%>

Then I have an init script that get's called onLoad, and uses the printed
javascript arrays to do its things.

HTH,

-Sasha

On 5/16/03 13:54, "Justin Ruthenbeck" <ju...@nextengine.com> wrote:

> At 10:58 AM 5/16/2003, you wrote:
>> First some disclaimers.  I do know that JavaScript is a client side and
>> the JSP/Servlet is a server side technology.  I do know that JSPs can
>> handle pretty much any presentation layer task that JavaScript can and, of
>> course, way much more.  So why bother? Well, there are advantages to
>> having the client handle certain data tasks i.e., sorting tables.
>> From a performance perspective, it doesn't make much sense to do a round
>> trip to the serve,r if all you need to do is rearrange the data that
>> already resides on the client side.   There are some nifty JavaScripts
>> out there that I would like to use for such tasks.   My question is, what
>> is/are the best ways to pass data to a JavaScript?
> 
> The general idea for this class of problems is to create a separate data
> "container" (in this case, it could be a hidden frame).  Have your main
> component (your main html page) tell the data container to get the data (by
> directing the hidden frame to reload itself with a URL that the server will
> generate data in a js datatype for).  Once the data container has the data,
> have it notify the main component that it's ready.  You now have a data
> bridge to your javascript ... if you need to get the most recent data,
> reload the data frame.
> 
> The situation gets much more complicated if you're doing anything other
> than reading the data -- you'll probably want to avoid it.
> 
> This should get you off in the right direction ... there have been threads
> discussing similar problems.  Try searching the Tomcat archive for
> "javascript hidden frame data passing" or something along those lines.
> 
> justin
> 
> 
> 
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential
>   See http://www.nextengine.com/confidentiality.php
> ____________________________________
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Re: JavaScript and JSP/Servlets

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
At 10:58 AM 5/16/2003, you wrote:
>First some disclaimers.  I do know that JavaScript is a client side and 
>the JSP/Servlet is a server side technology.  I do know that JSPs can 
>handle pretty much any presentation layer task that JavaScript can and, of 
>course, way much more.  So why bother? Well, there are advantages to 
>having the client handle certain data tasks i.e., sorting tables.
> From a performance perspective, it doesn't make much sense to do a round 
> trip to the serve,r if all you need to do is rearrange the data that 
> already resides on the client side.   There are some nifty JavaScripts 
> out there that I would like to use for such tasks.   My question is, what 
> is/are the best ways to pass data to a JavaScript?

The general idea for this class of problems is to create a separate data 
"container" (in this case, it could be a hidden frame).  Have your main 
component (your main html page) tell the data container to get the data (by 
directing the hidden frame to reload itself with a URL that the server will 
generate data in a js datatype for).  Once the data container has the data, 
have it notify the main component that it's ready.  You now have a data 
bridge to your javascript ... if you need to get the most recent data, 
reload the data frame.

The situation gets much more complicated if you're doing anything other 
than reading the data -- you'll probably want to avoid it.

This should get you off in the right direction ... there have been threads 
discussing similar problems.  Try searching the Tomcat archive for 
"javascript hidden frame data passing" or something along those lines.

justin



____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


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


Re: JavaScript and JSP/Servlets

Posted by Jacob Kjome <ho...@visi.com>.
At 12:58 PM 5/16/2003 -0500, you wrote:
>First some disclaimers.  I do know that JavaScript is a client side and 
>the JSP/Servlet is a server side technology.  I do know that JSPs can 
>handle pretty much any presentation layer task that JavaScript can and, of 
>course, way much more.  So why bother? Well, there are advantages to 
>having the client handle certain data tasks i.e., sorting tables.
> From a performance perspective, it doesn't make much sense to do a round 
> trip to the serve,r if all you need to do is rearrange the data that 
> already resides on the client side.   There are some nifty JavaScripts 
> out there that I would like to use for such tasks.   My question is, what 
> is/are the best ways to pass data to a JavaScript?
>
>Here's my  thought history:
>
>1.  Use HttpSession:  I can't. This object lives  on the server side web 
>container.
>2.  Use cookies:  Are JSP/Servlet cookies compatible with JavaScript 
>cookies? I don't know... But in any event, cookies cannot designed to 
>handle large amounts of data.
>3. Brute force: use a JSP to get data and then drop it on a client side 
>flat file and then read it from JavaScript.  Yucky! as my daughter would 
>put it. But theoretically possible, I guess.

You could import a .js file and format the data in a way that javascript 
can read.  You can't, however, open arbitrary files via javascript.  That 
would be a *serious* security issue.

Jake

>What are your thoughts on the matter?
>
>Thanks!
>-FB
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org