title: struts2 validation
body: <p>I have a text field and a selectbox (users can select multiple values by ctrl) in a form.  </p>
  
  <p>I was reading validation provided by struts2: <a href="http://struts.apache.org/2.x/docs/validation.html" rel="nofollow noreferrer">http://struts.apache.org/2.x/docs/validation.html</a></p>
  
  <p>However, it doesnt seem to have the validation I need. </p>
  
  <p>I want to make the text field a required field ONLY when certain strings are selected from the selectbox.  </p>
  
  <p>Do I have to write a custom validator for this purpose or is there a simpler way to achieve this in struts2. </p>
  
  <p>thanks!</p>
  
  <p>PS: I would like to know how other languages/frameworks might handle this case also. </p>