my dog learned polymorphism*
The moose likes JSP and the fly likes how to assign a java variable as a value to an html radio button? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to assign a java variable as a value to an html radio button?" Watch "how to assign a java variable as a value to an html radio button?" New topic
Author

how to assign a java variable as a value to an html radio button?

aatish pandya
Greenhorn

Joined: Apr 20, 2011
Posts: 21
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: 61224
    
  66

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:


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to assign a java variable as a value to an html radio button?