This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to access javascript variable inside scriptlet in a jsp file?

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I want to access a javascript variable inside scriptlet block in a jsp file..

If you have answer plese clear my doubt..

Thanks in advance..
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not possible. JSP scriptlets are executed on the server, while JavaScript is executed in the browser (i.e., on the client), at which point JSP has long since finished its job. What are you trying to accomplish?
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. Thanks..
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like share this thread with you.

where we discuss the same topic. It could more help you on others seniors views.
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I get one of the form parameter value inside a JSP file?
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jessica James:
Can I get one of the form parameter value inside a JSP file?



didn't get what you have mean by form parameters?

assume that you are asking about getting a record from all elements inside the form.

if it is then the answer is Yes,

Just define you JSP file (path) inside the form action attribute.
When the form is submitted, the specified name and value are included in the GET or POST data, Then you can use request.getParameter() method in your jsp to retrieve these value by the name of elements.

hope it helps.
[ April 16, 2007: Message edited by: Saif uddin ]
 
Have you no shame? Have you no decency? Have you no tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic