jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes how can assign hidden variable value to JSTL variable,with out submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how can assign hidden variable value to JSTL variable,with out submit" Watch "how can assign hidden variable value to JSTL variable,with out submit" New topic
Author

how can assign hidden variable value to JSTL variable,with out submit

test check
Greenhorn

Joined: Oct 20, 2010
Posts: 2
Is it possible to assign JSP hidden variable value to JSTL var

the code is something like this




<input type="hidden" id ="setDay" name ="setDay" value ="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31" />

(in javascript function i am modifying value of setDay based month value which will be available from database.. after that i want to assign this value to coDate)

<c:set var ="coDate" value ="${setDay}" />

How that can be done?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61071
    
  66

It can't. The JSP executes on the server long before the HTML page gets sent to the client for JavaScript to execute there. SO not only do the JSP and the JavaScript run at different times, they do not even run on the same machine. There can be no direct interaction.

Please read this article to understand how JSP operates.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

By JSP you can't, but you can use javascript again.

take a look here. I've just talked about that... http://www.coderanch.com/t/514547/JSP/java/Process-Custom-tag-based-given#2328212


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
test check
Greenhorn

Joined: Oct 20, 2010
Posts: 2
Thank you friends for your inputs.
 
Consider Paul's rocket mass heater.
 
subject: how can assign hidden variable value to JSTL variable,with out submit