dcsimg
about jsp and javascript
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   prathima_Gaitonde
Posted On:   Sunday, May 9, 2004 04:37 AM

how can i get the value of a variable declared in javascript within jsp

Re: about jsp and javascript

Posted By:   Amir_Pashazadeh  
Posted On:   Monday, May 10, 2004 12:29 PM

Hi


You can define some hidden inputs in your page forms, and fill its values with JavaScript, after submit you can access the values.


Amir Pashazadeh

Re: about jsp and javascript

Posted By:   Steve_Lawton  
Posted On:   Monday, May 10, 2004 06:23 AM

Sorry you cannot do this. jsp gets compiled at the server end, and javascript at the browser. You can do it, if you write your own servlet to retreive a request. ie.. You use a form object to call and process your javascript, which appends values to the url, which processes your form.
So....your url = blabla?name=jscripVal&poo=AnotherJscriptVal, which is picked up by your servlet, processing the HttpSessionRequest Object. This all assumes of course that you know how to write servlets, and deal with the request modules. This is the simplist way; Other methods are secret, since they take far to long to explain.
About | Sitemap | Contact