File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
aatish pandya
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic