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
14
votes
3 answers

Basic flow of Struts

Well I want to study Struts so I am going to begin with Struts 1, I would like to know the general flow. What files are required? Whats the function of struts-config.xml? validation.xml? validation-rules.xml When you visit your JSP page, and an…
user478636
  • 3,304
  • 15
  • 49
  • 76
9
votes
4 answers

Difference between Struts 1 and Struts 2?

I had been using struts 2, but for few reasons i am shifting (back) to Struts 1 . I would like to know major diffrences between them like about programatic availabilities and general flows.
Nils
  • 806
  • 1
  • 9
  • 24
8
votes
4 answers

Why is struts validation not working for me?

I'm trying to use Struts validation to check various fields entered by users. If anyone is able to help me see what I lack, I would be extremely grateful. Here's what I have: I put validation.xml and TestAction-validation.xml in…
Eric Wilson
  • 57,719
  • 77
  • 200
  • 270
8
votes
2 answers

Struts 2 Download - How to configure the file name dynamically?

I am developing one application , where people will download the required file from a location mentioned in the DB to their Local. I am using struts 2 for downloading the file from the server . I can download the file without any exception and it…
Esh
  • 836
  • 5
  • 16
  • 43
7
votes
3 answers

struts tutorial or example

I'm trying to make a login page in Struts. The idea is to validate if the user exists, etc, and then if there is an error, return to the login page with the errors in red (the typical login or any form page validation). I would like to know if…
Tere
  • 245
  • 1
  • 3
  • 14
5
votes
1 answer

FreeMarker template error! in struts2

I'm using sturts 2 annotation based validations in my class while dispalying action error i got this strange "FreeMarker template error!" This is my entity class. @Entity public class User implements Serializable { private static final long…
4
votes
4 answers

Displaying struts validations message

I want to display errors detected in an action class, I use: errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage("some_string_in_properties_file"));` and it works fine. However, I have written some generic error messages, and I would like…
jeevs
  • 261
  • 6
  • 20
4
votes
2 answers

Reusing Custom Expression Validator in Struts 2

In Struts 2 we can develop @CustomValidator which can be used in application wide @CustomValidator(type = "CustomerNumberValidator", fieldName = "customerNo") For validation more than one field we use…
4
votes
1 answer

Struts 2 : Apply different XML validation files to one Action Methods

I'm new in Struts 2 Framework, and I've used the XML validation file to validate the fields of a form. My question is: How can I Apply different XML validation files to the Methods of one Action ? I also wants to use the same XML validation file…
4
votes
1 answer

struts2 conventions plugin not working properly

I was trying to run the application with convention plugin Struts2. The application was fine with struts.xml configured like this:
4
votes
1 answer

Struts 2 Validation using Message Store Interceptor

I have an action where I am trying to log the user in. public class RegisteredUserAction extends ActionSupport implements SessionAware { .. .. public String login() throws Exception { DBLogic dBLogic = new DBLogic(); RegisteredUser…
3
votes
2 answers

How to do validation in struts2 when calling action from jquery ajax?

i am calling struts2 action from jquery ajax on success it returns string and on error it should be dispatched to same page and should display errors. i have used following code check it.. $(document).ready(function(){ …
user1140574
3
votes
4 answers

Struts 2.2.3 annotations based validation

I am using struts 2.2.3 in web application. I want to use struts2 annotations based validations for the form data submitted from UI. The scenario is: User fills all the form fields and click on submit button. I have created a Person class for…
Arun
  • 141
  • 2
  • 4
  • 11
3
votes
1 answer

Struts2 timeout during validation

I get a TimeOut error when I try to validate my login form BUT only the first time. Could you tell me what I'm doing wrong? My [...]-validation.xml :
jBravo
  • 873
  • 1
  • 9
  • 28
3
votes
1 answer

Chaining visitor validator in Struts 2

An action class has a property to be validated. The property is a class (MyClass1), one of whose properties is also a class (MyClass2). Each of the classes to be validated will be used by multiple actions, so I defined a "MyClass*-validation.xml"…
Matt
  • 4,515
  • 5
  • 22
  • 29
1
2 3
9 10