Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
test check
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
test check
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you friends for your inputs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic