How to pass a variable from Javascript code to Java

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How to pass a variable from Javascript code to Java

Marwa
Hello, I am building a web application and I have to use an open source
Javascript package that is responsible for the visualization tasks. Now, I
need to pass a "string variable" from the javascript code to the java
code?? how to do this in tapestry5 ..Please refer me to a working example
if you can!!


--



*Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
& Information Assuit University*
<[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Marwa
Thanks for your replay but actually I scanned all the links and I couldn't
find an answer for my issue... Let me explain it in more details ..in the
.tml code I have this line
<p>Name: <span id="name"></span></p>
and in the javascript code, there is a function that calculates the "name"
for this element and another that creates a link containing the name of
this element to be displayed as a link.

function appendIriLabel(element, name, iri) {
var tag;
if (iri) {
tag = element.append("a")
.attr("href", iri)
.attr("title", iri)
.attr("target", "_blank");
} else {
tag = element.append("span");
}
tag.text(name);
}

and what I need is to pass the string variable "name" from the client side
javascriptcode, to the java code in order to use it in the server side
functions.
How to make this?

Hope I could illustrate my problem well ...


On Sun, Aug 26, 2018 at 12:00 PM Basile Chandesris <[hidden email]> wrote:

> Le 25/08/2018 à 08:32, marwa hussein a écrit :
> > Hello, I am building a web application and I have to use an open source
> > Javascript package that is responsible for the visualization tasks. Now,
> I
> > need to pass a "string variable" from the javascript code to the java
> > code?? how to do this in tapestry5 ..Please refer me to a working example
> > if you can!!
> >
> >
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
>
> https://tapestry.apache.org/legacy-javascript.html
>
> https://tapestry.apache.org/javascript.html
>
>
>
> http://tapestry5-jquery.com/
>
> https://github.com/ffacon/tapestry5-angular-demo
>
> https://github.com/eddyson-de/tapestry-react
>
> https://tapestry.apache.org/coffeescript.html
>
>
>
>

--



*Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
& Information Assuit University*
<[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Peter Skala
Hi Marwa,

there is an example in the bottom part of this page

https://tapestry.apache.org/ajax-and-zones.html

which you can use for your development. The paragraph "Invoking server-side event
handler methods from JavaScript" contains the corresponding explanation.

If you do not want to use zones and asynchronous requests, you cat use a hidden field
to transfer the value to java.
The hidden field hast to be contained in a form. You put the value with java script in
the hidden field. With a form submit it will be transferred to java.

Sorry that I am not referencing to an example, but possibly you manage it even with
this information..

With regards, Peter


> Thanks for your replay but actually I scanned all the links and I couldn't
> find an answer for my issue... Let me explain it in more details ..in the
> .tml code I have this line
> <p>Name: <span id="name"></span></p>
> and in the javascript code, there is a function that calculates the "name"
> for this element and another that creates a link containing the name of
> this element to be displayed as a link.
>
> function appendIriLabel(element, name, iri) {
> var tag;
> if (iri) {
> tag = element.append("a")
> .attr("href", iri)
> .attr("title", iri)
> .attr("target", "_blank");
> } else {
> tag = element.append("span");
> }
> tag.text(name);
> }
>
> and what I need is to pass the string variable "name" from the client side
> javascriptcode, to the java code in order to use it in the server side
> functions.
> How to make this?
>
> Hope I could illustrate my problem well ...
>
>
> On Sun, Aug 26, 2018 at 12:00 PM Basile Chandesris <[hidden email]> wrote:
>
>> Le 25/08/2018 à 08:32, marwa hussein a écrit :
>> > Hello, I am building a web application and I have to use an open source
>> > Javascript package that is responsible for the visualization tasks. Now,
>> I
>> > need to pass a "string variable" from the javascript code to the java
>> > code?? how to do this in tapestry5 ..Please refer me to a working example
>> > if you can!!
>> >
>> >
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
>>
>> https://tapestry.apache.org/legacy-javascript.html
>>
>> https://tapestry.apache.org/javascript.html
>>
>>
>>
>> http://tapestry5-jquery.com/
>>
>> https://github.com/ffacon/tapestry5-angular-demo
>>
>> https://github.com/eddyson-de/tapestry-react
>>
>> https://tapestry.apache.org/coffeescript.html
>>
>>
>>
>>
>
> --
>
>
>
> *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
> & Information Assuit University*
> <[hidden email]>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Thiago H de Paula Figueiredo
In reply to this post by Marwa
On Sat, Aug 25, 2018 at 3:33 AM marwa hussein <[hidden email]>
wrote:

> Hello,


Hi!


> I am building a web application and I have to use an open source
> Javascript package that is responsible for the visualization tasks. Now, I
> need to pass a "string variable" from the javascript code to the java
> code?? how to do this in tapestry5 ..Please refer me to a working example
> if you can!!
>

Just use HTML's data attributes, just as Tapestry 5.4+ itself does. For
example, supposing the div below is one which already exists in your page:

<div id="visualization" data-visualization-data="${vizualizationData}">

Then, in your Java code, you compute the visualization data:

public String getVisualizationData() {
    ...
    return data;
}

Then, in your JavaScript, supposing you're using jQuery:

var visualizationData = $('#visualization').attr('visualization-data');

Notice the code above isn't tested. Of course, feel free to adapt it to
your existing code.

--
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Thiago H de Paula Figueiredo
In reply to this post by Peter Skala
Hello!

See the Invoking server-side event handler methods from JavaScript in
https://tapestry.apache.org/ajax-and-zones.html. It has an example of how
to do it in Tapestry 5.4.2+. There's no easy way of doing it than this.

On Mon, Aug 27, 2018 at 4:47 AM <[hidden email]> wrote:

> Hi Marwa,
>
> there is an example in the bottom part of this page
>
> https://tapestry.apache.org/ajax-and-zones.html
>
> which you can use for your development. The paragraph "Invoking
> server-side event
> handler methods from JavaScript" contains the corresponding explanation.
>
> If you do not want to use zones and asynchronous requests, you cat use a
> hidden field
> to transfer the value to java.
> The hidden field hast to be contained in a form. You put the value with
> java script in
> the hidden field. With a form submit it will be transferred to java.
>
> Sorry that I am not referencing to an example, but possibly you manage it
> even with
> this information..
>
> With regards, Peter
>
>
> > Thanks for your replay but actually I scanned all the links and I
> couldn't
> > find an answer for my issue... Let me explain it in more details ..in the
> > .tml code I have this line
> > <p>Name: <span id="name"></span></p>
> > and in the javascript code, there is a function that calculates the
> "name"
> > for this element and another that creates a link containing the name of
> > this element to be displayed as a link.
> >
> > function appendIriLabel(element, name, iri) {
> > var tag;
> > if (iri) {
> > tag = element.append("a")
> > .attr("href", iri)
> > .attr("title", iri)
> > .attr("target", "_blank");
> > } else {
> > tag = element.append("span");
> > }
> > tag.text(name);
> > }
> >
> > and what I need is to pass the string variable "name" from the client
> side
> > javascriptcode, to the java code in order to use it in the server side
> > functions.
> > How to make this?
> >
> > Hope I could illustrate my problem well ...
> >
> >
> > On Sun, Aug 26, 2018 at 12:00 PM Basile Chandesris <[hidden email]>
> wrote:
> >
> >> Le 25/08/2018 à 08:32, marwa hussein a écrit :
> >> > Hello, I am building a web application and I have to use an open
> source
> >> > Javascript package that is responsible for the visualization tasks.
> Now,
> >> I
> >> > need to pass a "string variable" from the javascript code to the java
> >> > code?? how to do this in tapestry5 ..Please refer me to a working
> example
> >> > if you can!!
> >> >
> >> >
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/javascript
> >>
> >> https://tapestry.apache.org/legacy-javascript.html
> >>
> >> https://tapestry.apache.org/javascript.html
> >>
> >>
> >>
> >> http://tapestry5-jquery.com/
> >>
> >> https://github.com/ffacon/tapestry5-angular-demo
> >>
> >> https://github.com/eddyson-de/tapestry-react
> >>
> >> https://tapestry.apache.org/coffeescript.html
> >>
> >>
> >>
> >>
> >
> > --
> >
> >
> >
> > *Marwa Hussein M. TA @ Information Systems Department Faculty of
> Computers
> > & Information Assuit University*
> > <[hidden email]>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Thiago H de Paula Figueiredo
In reply to this post by Thiago H de Paula Figueiredo
I've just noticed Peter had already posted the same answer as me. I'm sorry.

On Mon, Aug 27, 2018 at 3:24 PM Thiago H. de Paula Figueiredo <
[hidden email]> wrote:

> On Sat, Aug 25, 2018 at 3:33 AM marwa hussein <[hidden email]>
> wrote:
>
>> Hello,
>
>
> Hi!
>
>
>> I am building a web application and I have to use an open source
>> Javascript package that is responsible for the visualization tasks. Now, I
>> need to pass a "string variable" from the javascript code to the java
>> code?? how to do this in tapestry5 ..Please refer me to a working example
>> if you can!!
>>
>
> Just use HTML's data attributes, just as Tapestry 5.4+ itself does. For
> example, supposing the div below is one which already exists in your page:
>
> <div id="visualization" data-visualization-data="${vizualizationData}">
>
> Then, in your Java code, you compute the visualization data:
>
> public String getVisualizationData() {
>     ...
>     return data;
> }
>
> Then, in your JavaScript, supposing you're using jQuery:
>
> var visualizationData = $('#visualization').attr('visualization-data');
>
> Notice the code above isn't tested. Of course, feel free to adapt it to
> your existing code.
>
> --
> Thiago
>


--
Thiago
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Marwa
Hello,

Thanks all for your suggestions. I followed the example shown in
https://tapestry.apache.org/ajax-and-zones.html in "Invoking server-side
event handler methods from JavaScript"   but here the event is in the java
code "server-side" and is invoked from the Javascript code "onClick()" ,
but what I want is the opposite direction, sending a "string variable" from
a tag appended in  the clientside javascript code to the java code "in the
serverside".
For now, I will test to use hidden input (although I didn't want to use a
form submit) and I will see if I can make it or not ...

Thank you all for your help and valuable suggestions, and of course, if
anyone face the same problem before and could give me hints to how to do it
please tell me.
Regards,
Marwa
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Numa Schmeder-5
Hello Marwa,

The answer provided by Thiago is much simpler.
Just put your data in a data attribute of a tag and then use the tutorial ajax and zones to send this data to a server side event handler.
If you want to do it automatically without triggering a javascript event, just put you script in an on document ready event, to make sure your javascript code is called once the page is rendered and loaded by the browser.


===> in html page

<div id=“myId” data-mydata=“mydata"></div>

===> javascript at the end of html page

$(function() {
        var dataToSend = $(‘#myId’).data(‘mydata’);
        ajax(‘pageData', {
                        data: dataToSend, // This doesn't need to be the same element as the one two lines above
            // Callback called when the request is finished.
            // response.json is the object returned by the event handler method
                        success: function(response) {
                                alert('sent to server');
                        }
                });
});


=====> in java page

JSONObject onPageData()
    {
        return new JSONObject("origin", "componentAction");
    }  


You can use jquery or something else.

Best
Numa



  <http://www.dfacto.ch/> Numa Schmeder    www.dfacto.ch  <http://www.dfacto.ch/>
[hidden email] <mailto:[hidden email]>   |   M +41 79 538 30 01

DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT


 

> Le 28 août 2018 à 12:22, marwa hussein <[hidden email]> a écrit :
>
> Hello,
>
> Thanks all for your suggestions. I followed the example shown in
> https://tapestry.apache.org/ajax-and-zones.html in "Invoking server-side
> event handler methods from JavaScript"   but here the event is in the java
> code "server-side" and is invoked from the Javascript code "onClick()" ,
> but what I want is the opposite direction, sending a "string variable" from
> a tag appended in  the clientside javascript code to the java code "in the
> serverside".
> For now, I will test to use hidden input (although I didn't want to use a
> form submit) and I will see if I can make it or not ...
>
> Thank you all for your help and valuable suggestions, and of course, if
> anyone face the same problem before and could give me hints to how to do it
> please tell me.
> Regards,
> Marwa

Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Marwa
Hi,
Thank you all for guiding me to the solution especially "Numa" .. and this
is how I solved it:
for the .tml
<p id="myId" data-mydata="testvalue"/>

and in the JS JQuery file, I passed the variable in a JSON object --> data:
{myData:dataToSend}
$('#myId').click(function() {
var dataToSend=  $('#myId').data('mydata');
ajax('answer', {
element: $('#myId'),
data:{ myData:dataToSend},
success: function(response) {
}
});
});

and in java file, I used @RequestParameter("myData") to get the value from
the JSON object:
 @OnEvent("answer")
 @PublishEvent
public void answer(@RequestParameter("myData") String varName)
    {
    System.out.println("Variable name is :"+  varName  );
    }

Regards,
Marwa


On Tue, Aug 28, 2018 at 3:20 PM Numa Schmeder <[hidden email]> wrote:

> Hello Marwa,
>
> The answer provided by Thiago is much simpler.
> Just put your data in a data attribute of a tag and then use the tutorial
> ajax and zones to send this data to a server side event handler.
> If you want to do it automatically without triggering a javascript event,
> just put you script in an on document ready event, to make sure your
> javascript code is called once the page is rendered and loaded by the
> browser.
>
>
> ===> in html page
>
> <div id=“myId” data-mydata=“mydata"></div>
>
> ===> javascript at the end of html page
>
> $(function() {
>         var dataToSend = $(‘#myId’).data(‘mydata’);
>         ajax(‘pageData', {
>                         data: dataToSend, // This doesn't need to be the
> same element as the one two lines above
>             // Callback called when the request is finished.
>             // response.json is the object returned by the event handler
> method
>                         success: function(response) {
>                                 alert('sent to server');
>                         }
>                 });
> });
>
>
> =====> in java page
>
> JSONObject onPageData()
>     {
>         return new JSONObject("origin", "componentAction");
>     }
>
>
> You can use jquery or something else.
>
> Best
> Numa
>
>
>
>   <http://www.dfacto.ch/>       Numa Schmeder    www.dfacto.ch  <
> http://www.dfacto.ch/>
> [hidden email] <mailto:[hidden email]>   |   M +41 79 538 30 01
>
> DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT
>
>
>
>
> > Le 28 août 2018 à 12:22, marwa hussein <[hidden email]> a
> écrit :
> >
> > Hello,
> >
> > Thanks all for your suggestions. I followed the example shown in
> > https://tapestry.apache.org/ajax-and-zones.html in "Invoking server-side
> > event handler methods from JavaScript"   but here the event is in the
> java
> > code "server-side" and is invoked from the Javascript code "onClick()" ,
> > but what I want is the opposite direction, sending a "string variable"
> from
> > a tag appended in  the clientside javascript code to the java code "in
> the
> > serverside".
> > For now, I will test to use hidden input (although I didn't want to use a
> > form submit) and I will see if I can make it or not ...
> >
> > Thank you all for your help and valuable suggestions, and of course, if
> > anyone face the same problem before and could give me hints to how to do
> it
> > please tell me.
> > Regards,
> > Marwa
>
>

--



*Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
& Information Assuit University*
<[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

h3ph3st0s
And how about storing the value to a session or a cookie from javascript
and reading from java server through an implemantation of observer
parttern? It would work in any case, in any framework.

Στις Τετ, 29 Αυγ 2018, 2:39 μ.μ. ο χρήστης marwa hussein <
[hidden email]> έγραψε:

> Hi,
> Thank you all for guiding me to the solution especially "Numa" .. and this
> is how I solved it:
> for the .tml
> <p id="myId" data-mydata="testvalue"/>
>
> and in the JS JQuery file, I passed the variable in a JSON object --> data:
> {myData:dataToSend}
> $('#myId').click(function() {
> var dataToSend=  $('#myId').data('mydata');
> ajax('answer', {
> element: $('#myId'),
> data:{ myData:dataToSend},
> success: function(response) {
> }
> });
> });
>
> and in java file, I used @RequestParameter("myData") to get the value from
> the JSON object:
>  @OnEvent("answer")
>  @PublishEvent
> public void answer(@RequestParameter("myData") String varName)
>     {
>     System.out.println("Variable name is :"+  varName  );
>     }
>
> Regards,
> Marwa
>
>
> On Tue, Aug 28, 2018 at 3:20 PM Numa Schmeder <[hidden email]> wrote:
>
> > Hello Marwa,
> >
> > The answer provided by Thiago is much simpler.
> > Just put your data in a data attribute of a tag and then use the tutorial
> > ajax and zones to send this data to a server side event handler.
> > If you want to do it automatically without triggering a javascript event,
> > just put you script in an on document ready event, to make sure your
> > javascript code is called once the page is rendered and loaded by the
> > browser.
> >
> >
> > ===> in html page
> >
> > <div id=“myId” data-mydata=“mydata"></div>
> >
> > ===> javascript at the end of html page
> >
> > $(function() {
> >         var dataToSend = $(‘#myId’).data(‘mydata’);
> >         ajax(‘pageData', {
> >                         data: dataToSend, // This doesn't need to be the
> > same element as the one two lines above
> >             // Callback called when the request is finished.
> >             // response.json is the object returned by the event handler
> > method
> >                         success: function(response) {
> >                                 alert('sent to server');
> >                         }
> >                 });
> > });
> >
> >
> > =====> in java page
> >
> > JSONObject onPageData()
> >     {
> >         return new JSONObject("origin", "componentAction");
> >     }
> >
> >
> > You can use jquery or something else.
> >
> > Best
> > Numa
> >
> >
> >
> >   <http://www.dfacto.ch/>       Numa Schmeder    www.dfacto.ch  <
> > http://www.dfacto.ch/>
> > [hidden email] <mailto:[hidden email]>   |   M +41 79 538 30 01
> >
> > DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT
> >
> >
> >
> >
> > > Le 28 août 2018 à 12:22, marwa hussein <[hidden email]> a
> > écrit :
> > >
> > > Hello,
> > >
> > > Thanks all for your suggestions. I followed the example shown in
> > > https://tapestry.apache.org/ajax-and-zones.html in "Invoking
> server-side
> > > event handler methods from JavaScript"   but here the event is in the
> > java
> > > code "server-side" and is invoked from the Javascript code "onClick()"
> ,
> > > but what I want is the opposite direction, sending a "string variable"
> > from
> > > a tag appended in  the clientside javascript code to the java code "in
> > the
> > > serverside".
> > > For now, I will test to use hidden input (although I didn't want to
> use a
> > > form submit) and I will see if I can make it or not ...
> > >
> > > Thank you all for your help and valuable suggestions, and of course, if
> > > anyone face the same problem before and could give me hints to how to
> do
> > it
> > > please tell me.
> > > Regards,
> > > Marwa
> >
> >
>
> --
>
>
>
> *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers
> & Information Assuit University*
> <[hidden email]>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to pass a variable from Javascript code to Java

Cezary Biernacki
While cookies can be used the way you describe, I would like to warn that
they have several drawbacks. They are added to every requests from the
browser to the server, until they expire or some code explicitly deletes
them. It means that the size of unrelated requests might grow. Also it
complicates handling situations when user opens a page in several
tabs/windows, and the code would try to pass back different values (e.g.
based on user interactions with the page). There are also limits on the
size and number of cookies. Of course in some situations, cookies are the
best option (e.g. tracking some per-user state), but more often they are
not.

Cezary




On Thu, Aug 30, 2018 at 12:23 AM heph estos <[hidden email]> wrote:

> And how about storing the value to a session or a cookie from javascript
> and reading from java server through an implemantation of observer
> parttern? It would work in any case, in any framework.
>
> Στις Τετ, 29 Αυγ 2018, 2:39 μ.μ. ο χρήστης marwa hussein <
> [hidden email]> έγραψε:
>
> > Hi,
> > Thank you all for guiding me to the solution especially "Numa" .. and
> this
> > is how I solved it:
> > for the .tml
> > <p id="myId" data-mydata="testvalue"/>
> >
> > and in the JS JQuery file, I passed the variable in a JSON object -->
> data:
> > {myData:dataToSend}
> > $('#myId').click(function() {
> > var dataToSend=  $('#myId').data('mydata');
> > ajax('answer', {
> > element: $('#myId'),
> > data:{ myData:dataToSend},
> > success: function(response) {
> > }
> > });
> > });
> >
> > and in java file, I used @RequestParameter("myData") to get the value
> from
> > the JSON object:
> >  @OnEvent("answer")
> >  @PublishEvent
> > public void answer(@RequestParameter("myData") String varName)
> >     {
> >     System.out.println("Variable name is :"+  varName  );
> >     }
> >
> > Regards,
> > Marwa
> >
> >
> > On Tue, Aug 28, 2018 at 3:20 PM Numa Schmeder <[hidden email]> wrote:
> >
> > > Hello Marwa,
> > >
> > > The answer provided by Thiago is much simpler.
> > > Just put your data in a data attribute of a tag and then use the
> tutorial
> > > ajax and zones to send this data to a server side event handler.
> > > If you want to do it automatically without triggering a javascript
> event,
> > > just put you script in an on document ready event, to make sure your
> > > javascript code is called once the page is rendered and loaded by the
> > > browser.
> > >
> > >
> > > ===> in html page
> > >
> > > <div id=“myId” data-mydata=“mydata"></div>
> > >
> > > ===> javascript at the end of html page
> > >
> > > $(function() {
> > >         var dataToSend = $(‘#myId’).data(‘mydata’);
> > >         ajax(‘pageData', {
> > >                         data: dataToSend, // This doesn't need to be
> the
> > > same element as the one two lines above
> > >             // Callback called when the request is finished.
> > >             // response.json is the object returned by the event
> handler
> > > method
> > >                         success: function(response) {
> > >                                 alert('sent to server');
> > >                         }
> > >                 });
> > > });
> > >
> > >
> > > =====> in java page
> > >
> > > JSONObject onPageData()
> > >     {
> > >         return new JSONObject("origin", "componentAction");
> > >     }
> > >
> > >
> > > You can use jquery or something else.
> > >
> > > Best
> > > Numa
> > >
> > >
> > >
> > >   <http://www.dfacto.ch/>       Numa Schmeder    www.dfacto.ch  <
> > > http://www.dfacto.ch/>
> > > [hidden email] <mailto:[hidden email]>   |   M +41 79 538 30 01
> > >
> > > DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT
> > >
> > >
> > >
> > >
> > > > Le 28 août 2018 à 12:22, marwa hussein <[hidden email]> a
> > > écrit :
> > > >
> > > > Hello,
> > > >
> > > > Thanks all for your suggestions. I followed the example shown in
> > > > https://tapestry.apache.org/ajax-and-zones.html in "Invoking
> > server-side
> > > > event handler methods from JavaScript"   but here the event is in the
> > > java
> > > > code "server-side" and is invoked from the Javascript code
> "onClick()"
> > ,
> > > > but what I want is the opposite direction, sending a "string
> variable"
> > > from
> > > > a tag appended in  the clientside javascript code to the java code
> "in
> > > the
> > > > serverside".
> > > > For now, I will test to use hidden input (although I didn't want to
> > use a
> > > > form submit) and I will see if I can make it or not ...
> > > >
> > > > Thank you all for your help and valuable suggestions, and of course,
> if
> > > > anyone face the same problem before and could give me hints to how to
> > do
> > > it
> > > > please tell me.
> > > > Regards,
> > > > Marwa
> > >
> > >
> >
> > --
> >
> >
> >
> > *Marwa Hussein M. TA @ Information Systems Department Faculty of
> Computers
> > & Information Assuit University*
> > <[hidden email]>
> >
>