Questions tagged [struts-validation]

Use this tag for questions related to validation of data for struts.

Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser i.e. client side as well as on the server side.

For Server side validation of form we can sub class any FormBean with DynaValidatorForm class and for client side validation we can do it using validation-rules.xml with javascript functions enclosed.

146 questions
2
votes
1 answer

Struts Action Validation

Hey People. I have been recently validating Struts 2 actions. In One of my action class, the save method to be precise must have two id's. That is an assessmenttype id and a course id. this is what is have so far. @Test public void testSave() { …
pundit
  • 772
  • 3
  • 18
  • 31
2
votes
1 answer

Strut2 validation - Select tags

I am having some problems Validating a select tag in one of my forms. The for code for select is as follows;
2
votes
1 answer

Avoid Return "input" Automatically in Struts

There is no problem when the action configuration in struts.xml is like this: /customer.tiles The problem comes when I access the action class on action…
Mahadi Siregar
  • 615
  • 3
  • 17
  • 38
2
votes
3 answers

execAndWait Interceptor not redirecting to success page after waiting

I have a login screen where some user input validation will happen, the user will be authenticated and finally redirected to the welcome screen. Below is the interceptor definition for the LoginAction:
user182944
  • 7,897
  • 33
  • 108
  • 174
2
votes
1 answer

Struts2 validations annotation gives multiple messages

I am using the convention plugin. Below is the @Validations annotation. @Validations( requiredFields={@RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName = "revenue", message = "You must enter a value for field.")}, …
Aadam
  • 1,521
  • 9
  • 30
  • 60
2
votes
4 answers
2
votes
1 answer

Struts2 text value displayed at incorrect position

I have created a struts2 login page, wherein I have all basic components necessary for login. I'm using struts2 text tag for a label. Below is my login page code snippet.

Demo - Login

srk
  • 4,857
  • 12
  • 65
  • 109
2
votes
1 answer

How to validate a request to a JSP page in Struts 1.2

How to validate a request/response to a JSP page in Struts 1.2 ?? Short scenario: the response from the action class is captured on the way to jsp and is tweaked. how to validate whether that response has been touched? (This is all part of VAPT so…
2
votes
1 answer

Struts2 Field Error key created by FileUploadInterceptor required

I am using Struts2 - FileUploadInterceptor to handle content type and maximum size of the file being uploaded. In order to display error messages, is displaying error message which is perfect. I am working on a page which has…
Pramod CA
  • 47
  • 3
  • 11
2
votes
3 answers

how to validate dynamic map elements

i have a map and i want to validate in struts 2 validation framework by using expression validation how can i access the elements of the map dynamically? if Map myMap; how can i validate the map with dynamic key? if mymap has static key like…
Helen
2
votes
2 answers

Struts ajax form validation

i have a problem with ajax form validation. I'm using struts-core 2.3.1.2, struts-jquery-plugin 3.3.0 and struts-json-plugin. The problem occurs if an ajax form will be submitted by an ajax request and validation fails. Cause then the whole form…
Caphalor40k
  • 31
  • 1
  • 5
2
votes
2 answers

struts 2 field error values not displaying

i have override validate method and added errors using addFieldError("test", "test print"); and in jsp used but the errors are not displayed in input.jsp. Also my jsp content type is <%@ page contentType="text/html;…
saket
  • 694
  • 5
  • 10
  • 20
1
vote
1 answer

Struts 2.5.12 / 2.5.13 - Validations stopped working after struts upgrade

I have upgraded Struts on one of the project from 2.3.x to 2.5.12 (tried with 2.5.13 also) and I see that after this upgrade no validations happening. I have in JSP:
Prasann
  • 1,263
  • 2
  • 11
  • 18
1
vote
2 answers

struts2 conditional xml validation

I have what I'd think is a common issue but an entire day of googling hasn't turned up anything useful. I have a form with a checkbox and a textfield. I'd like to do a regex validation of the textfield, but only if the checkbox is selected. Regex…
Greg
  • 11
  • 1
  • 2
1
vote
1 answer

How do i validate a date using combination of fields using the Struts validator

If i have 3 text fields on a form how can i use the struts validator to check that a compination of all 3 fields should form a valid date. For example