First, you have to validate the data that the user entered in your form. This can be done in many ways, with Annotations (section Validation Annotations), with XML or with a simple validate()
method in your action. You can search on the Internet lots of examples of how to validate data with Struts2 if the official documentation isn't enough.
Then I want to add something related with your jsp. Struts2 has built-in tags that render lots of things and help you to communicate the action with jsps. If we are talking about forms, we have for example <s:form>
that can help you, for example, not to hardcode the url of the action in an HTML form or <s:textfield>
that can be useful for render validation errors.
If the problem is that you want to use the Twitter Bootstrap notation for build your page, there is a plugin that render the HTML ready to use that CSS Framework.
EDIT
WARNING: Error setting expression 'courseBean.fee'
with value '[Ljava.lang.String;@1b40489'
The problem with your aproach is that you are trying to assign a String []
to a field that probably isn't a String []
(maybe it's a Date
). You have to take the String
and parse it to convert it to a Date
object. Also, if you don't know how <s:textfield>
and <s:form>
work in Struts2, you should take a look at this tutorial. It could be helpful for you.