A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
JSP
Author
how to assign a java variable as a value to an html radio button?
aatish pandya
Greenhorn
Joined: Apr 20, 2011
Posts: 21
posted
Jan 22, 2013 04:04:21
0
Suppose,
[code=java]
<%
String type = "credit";
%>
<body>
<input type="radio" name="type" value=<I want to assign the above String variable [i]type[/i] here> />
.
.
.
</body>
[/code]
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56232
13
I like...
posted
Jan 22, 2013 08:28:04
0
You should not be using Java scriptlets in JSP any longer. Please read
this JspFaq entry
.
Using the EL, if a
String
existed as a scoped variable named
type
, the syntax would be:
value="${type}"
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: how to assign a java variable as a value to an html radio button?
Similar Threads
setting a radio button
help with radio buttons
parameter to servlet
Radio Button,Check Boxes
Problem integrating Input box with JSP
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter