model-driven

Angular 2 ng-required

天涯浪子 提交于 2019-12-10 13:38:25
问题 I made a model-driven form in angular 2, and one of the input fields must show up only if a checkbox above is unchecked.I did this with *ngIf. My question is how can I set that input required only if the checkbox is unchecked? In angular 1.x i could make this happen with the ng-required="condition" in the view. Here is the html: //the checkbox <div class="checkbox col-sm-9"> <label> <input type="checkbox" id="getCompanyAddress" style="cursor: pointer;" [formControl]="form.controls['address']"

List in struts2 select cant resoved when in use the modeldriven interface

妖精的绣舞 提交于 2019-12-08 13:13:07
问题 Hello I use the interface modeldriven in my struts2 application. I have a problem rendering the page because I always get an error: 19 nov. 2013 11:23:12 org.apache.catalina.core.StandardWrapperValve invoke GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception tag 'select', field 'list': The requested list key 'listeItems' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] at org.apache.struts2

difference in the property value fetched in validate and model method in Struts2

旧时模样 提交于 2019-12-08 09:15:39
问题 I am running a basic Struts2 application in which I got one confusion. My action class implements Preparable and ModelDriven interfaces and extends ActionSupport class.The model bean has a single property named "User". My home page(jsp) has one input field corresponding to the only property "User" of a model bean. In prepare() method I am initializing the bean and setting its property to some default value say "Test" and the model() method is returning this bean object. In validate(), I have

The sequence of ModelDriven and Prepare?

隐身守侯 提交于 2019-12-08 06:29:29
I put the println() in each method of Action class. public String execute() throws Exception { System.out.println("execute"); //... } public void prepare() throws Exception { System.out.println("prepare"); //... } public Object getModel() { System.out.print("getModel"); //... } I thought the order would be; prepare → execute → getModel. Because I remember I read it in the book, so I used to construct beans class and do some logics in prepare() , and just return SUCCESS in execute() . And I think getModel is for pushing the bean to the valueStack, right? ...anyway the console showed me this. It

java.sql.SQLException: Invalid argument value: java.io.NotSerializableException

蓝咒 提交于 2019-12-08 06:03:56
问题 This is my code of SQL Connection class where I am getting error. public class SqlConnection { static Connection con; ....... static public ResultSet getData(String sql, List<LogModel> alist) throws ClassNotFoundException, SQLException { PreparedStatement pst = con.prepareStatement(sql); if (alist != null) { for (int i = 1; i <= alist.size(); i++) { pst.setObject(i, alist.get(i-1)); //Exception at this Line } } ResultSet rs = pst.executeQuery(); return rs; } } Here is the LogAction class

How to implement validations using annotations in struts2 in action that implements ModelDriven interface?

不羁的心 提交于 2019-12-08 02:09:46
问题 I am trying to implement validation using annotations, but these validations don't work and the form gets submitted with null values. I don't know what is missing, how to implement validations using annotations in struts2 in action that implements ModelDriven interface? This is my struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="default" extends="struts-default"> <action

ModelDriven on struts 2

≯℡__Kan透↙ 提交于 2019-12-07 03:07:36
I am developing a project using hibernate, struts2 and spring, but my problems are with struts. I have created 3 classes extending ActionSupport and are implementing modeldriven for the same class in all of them. I have implemented some methods to be executed when the actions are called. The structure for the classes is like (Class1Action.java): public class Class1Action extends ActionSupport implements ModelDriven<ModelDrivenClass> { private ModelDrivenClass modelDrivenClass; // getter and setter for modelDrivenClass public String methodName() { System.out.println("Entrou!"); return SUCCESS;

difference in the property value fetched in validate and model method in Struts2

元气小坏坏 提交于 2019-12-06 14:35:29
I am running a basic Struts2 application in which I got one confusion. My action class implements Preparable and ModelDriven interfaces and extends ActionSupport class.The model bean has a single property named "User". My home page(jsp) has one input field corresponding to the only property "User" of a model bean. In prepare() method I am initializing the bean and setting its property to some default value say "Test" and the model() method is returning this bean object. In validate(), I have a validation that if "User" property of bean has value equals to "Test" then addFieldError else proceed

How to implement validations using annotations in struts2 in action that implements ModelDriven interface?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 07:40:25
I am trying to implement validation using annotations, but these validations don't work and the form gets submitted with null values. I don't know what is missing, how to implement validations using annotations in struts2 in action that implements ModelDriven interface? This is my struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="default" extends="struts-default"> <action name="saveOrUpdateUser" method="saveOrUpdate1" class="com.vaannila.web.Userqqqq"> <result name=

Do you use MDA/MDD/MDSD, any kind of model-driven approach? Will it be the future?

北城以北 提交于 2019-12-04 12:29:57
问题 Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it is either rather easy in the beginning to get started but as well to get stuck at some point when you try something that was unanticipated or pretty hard to find enough information