Questions tagged [model-driven]

An interface to support model component of the Struts2 MVC architecture.

An interface to support model component of the Struts2 MVC architecture. This interface should implement action classes which applying a user model as a generic parameter. If an action class implements the interface ModelDriven then it needs to return an object from the getModel() method. Struts2 will then populate the fields of this object with the request parameters, and this object will be placed on top of the valueStack once the action is executed. Validation will also be performed on this model object, instead of the action.

ModelDriven action uses it's own interceptor modelDriven which included in the defaultStack interceptor stack. Thus every action that uses that stack invokes this interceptor to check if an action is instance of ModelDriven then applying a model to it.

There's also a ScopedModelDriven interface that is used for models that has lifecycle for the specified scope.

128 questions
3
votes
1 answer

How to refine the mandatory property of nodes from a grouping in YANG language?

I defined a grouping which has a leaf with mandatory property set to false. But in some cases, I would like to use this grouping and specify that the leaf should be mandatory. How do I achieve this in YANG?
HAO
  • 85
  • 8
3
votes
2 answers

Angular form keep returning false (Angular 2)

I have a form in Angular 2 which I'm validating by the model-driven way. I wanna know how do I change the status from false to true, because I have the rules of validation and even if the user fills everything right, it keeps returning me invalid…
Renê Silva Lima
  • 2,535
  • 2
  • 13
  • 20
3
votes
1 answer

Is Inheritance in Struts2 Model-Driven Action possible?

I have a Model-Driven Struts2 action that provides correct JSON response. When I re-structure the action I get an empty JSON response back. Has anyone got inheritance working with Struts2 Model-Driven actions? Ive tried explicitly setting include…
mryan
  • 382
  • 1
  • 4
  • 18
3
votes
1 answer

Struts2 model driven validation does not work

I have implemented model driven validation in my application but the validation does not work with following warning. WARNING: The visited object is null, VisitorValidator will not be able to handle validation properly. Please make sure the visited…
Zaheer Baloch
  • 536
  • 3
  • 9
  • 28
3
votes
1 answer

Struts 2/ Foundation 5 - ModelDriven class and File upload

I am new to Java programming and I am trying to create a basic webpage with form etc for placing an order. I decided to use Struts 2 after attending a couple of sessions at work. I also used zurb Foundation 5 for responsive UI. I was able to create…
A M
  • 107
  • 1
  • 8
3
votes
1 answer

How to access properties in the POJO using Struts 2 ModelDriven interface when you are using JSP?

I have an action class that implements ModelDriven interface. This ModelDriven is a regular POJO, the problem is that one of its properties is another object. Imagine that my ModelDrivenis a object calledPersonand my person has an attribute…
Philippe Gioseffi
  • 1,488
  • 3
  • 24
  • 41
2
votes
2 answers

In Struts2 I can't use modeldriven with validate

In the struts.xml: /jsp/user_form.jsp success_register My…
Troncador
  • 3,356
  • 3
  • 23
  • 40
2
votes
1 answer

Is there a way to load mutiple ModelDriven models for one action class in Struts2?

Is there a way to load mutiple ModelDriven models for one action class or swtich the model on one action class in struts2?
user1055108
  • 125
  • 3
  • 9
2
votes
2 answers

Struts2 returns empty JSON in my AJAX call

I am struggling to get the JSON response from my Struts2 Action class, I think i am missing something. The following set up I have in my Project. in my module level action definition , The configuration looks like :
2
votes
1 answer

How to focus input field created dynamically using an Angular model driven form

I'm using model driven forms in an Angular 7 application, and one of them allows the user to add/delete a group of fields dynamically. Here's a visual reference of what I mean: This is the FormModel I use: this.formModel = new FormGroup( { id :…
Fel
  • 4,428
  • 9
  • 43
  • 94
2
votes
2 answers

angular cant find toggle function in model

I am binding data in model class and looping the data fine. But I failed to bind toggle function in model class to the template click event. I created a model to bind the data from a jokelist component and looping the jokes with ngFor directive.…
chandoo
  • 1,276
  • 2
  • 21
  • 32
2
votes
0 answers

FormGroup.patchValue not patching object element correctly Ionic 2 Angular 2

I know guys there are lot of solutions regarding this question. But none works for me. I'm working with Ionic 2 Angular 2. On keyup event I want to patch Validator.required. Here Ownership is ion-select with 2 ion-options. On selecting Double 2…
Zeeshan Malik
  • 627
  • 1
  • 14
  • 31
2
votes
2 answers

Angular2 FormControl

I'm building a form using model-driven forms and building my form elements with formcontrol. I have a service where I put some functions and I send the formgroup to this function to access the formcontrols. I would like to know how could I change…
2
votes
1 answer

Multiple different POJOs using ModelDriven in Struts 2

How to use different POJOs like Address and Certificate class object using ModelDriven interface in same Action to perform collection mapping using Hibernate in Struts2? Here is the code sample: package com.acv.in.action; import…
Shaurya
  • 136
  • 1
  • 4
  • 20
2
votes
2 answers

How to reset a ngFormModel and lose the validation errors in Angular 2 Typescript?

I have a ngFormModel with a ngControl textbox.
On dirty an error message is displayed.
Nishanthd
  • 199
  • 2
  • 13
1
2
3
8 9