Radio button struts 2 example
radio button in struts2 is stateful mean we can get default selected radio button with defining in radio button tag with value attribute. Radio button can be use with list attribute where can define value and label of the radio button.
Example will show you how to use radio button in struts2
<s:radio name="smonth" list="#{'1':'Jan','2':'Feb','3':'Mar'}" value="2" />

- 1. list will set radio button with value and label
- 2. value is attribute which set default selected value of radio button, if we set 2 value it will automatically selected Feb month radiobutton
Tags: struts2





Link to Us
this is my code.
am getting following error:
org.apache.jasper.JasperException: /CreatePost.jsp(24,2) “#{’Daily’:'DAI’,'After Every Reply’,'No Mails’}” contains invalid expression(s): javax.el.ELException: Error Parsing: #{’Daily’:'DAI’,'After Every Reply’,'No Mails’}
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:168)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:414)
root cause
org.apache.jasper.JasperException: /CreatePost.jsp(24,2) “#{’Daily’:'DAI’,'After Every Reply’,'No Mails’}” contains invalid expression(s): javax.el.ELException: Error Parsing: #{’Daily’:'DAI’,'After Every Reply’,'No Mails’}
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:196)
org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1157)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:994)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:773)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1492)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2321)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2371)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:792)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1492)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2321)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2371)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2377)
org.apache.jasper.compiler.Node$Root.accept(Node.java:482)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2321)
org.apache.jasper.compiler.Validator.validate(Validator.java:1549)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:177)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:305)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:272)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:313)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:168)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:414)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.0 logs.