This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending variable values

 
Bon Gun
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to send a post request using html input tags but is it possible to send a variable value to the server?
I have this variable:

<%!String name="gon";%>

I want to send the variable value ( gon ) using post request, can i? How?

Thanks...
 
Lokesh Dulla
Greenhorn
Posts: 18
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using hidden fields
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. In fact, there should be no Java variables, or Java code of any kind, in a modern JSP.
 
Frederik Nielsen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is possible, and you can do it in many ways.

What is your requirements?
what is gon? it is something static? if so make it a hidden field. is it not static? what is it then? how does it change? what makes it change?

should gon be send when you hit a submit button in a form ?

It is hard to say what the best solution is for you without the excact requirements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic