Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting an exception while trying to check the radio button

 
Dee Gee
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am getting an exception while trying to check the radio button.
The exception is:-

org.apache.jasper.JasperException: /request.jsp(39,4) Attribute checked invalid for tag radio according to TLD

Is the exception and the code is----------------------------
html:radio
value="Event is not recurring" property="recurring" checked="checked"
----------------------------------------------------------------

Please help me out.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at The documentation for the html:radio tag you'll see that there is no checked property for this tag. If you want the button to show as checked when the JSP is displayed, set the property "recurring" of your form bean to "event is not recurring" before displaying the JSP. That's how all <html:xxx> tags work: They take their value from the ActionForm property.
 
Dee Gee
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This didn't work.-----------------------
In form bean:
String recurring = "Event is not recurring";
------------------------------
In JSP:
html:radio
value="Event is not recurring" property="recurring"
---------------------------------------------------
One more thing how do you have html:checkbox selected.
And how can you put one of the html ption of html:select as the selected option?


Thank You
DG
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "didn't work", what do you mean?

I just tried this in a test page and it works great for me.

Here's the code:

testForm



And how can you put one of the htmlption of html:select as the selected option?


<html:select> works exactly the same way. If you populate the property of the form bean specified in the <html:select> tag with the value of the option you want selected, that option will show as selected when the page is displayed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic