model-driven

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

二次信任 提交于 2019-12-03 21:39:56
问题 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 ModelDriven is a object called Person and my person has an attribute called Address that is another object. Address has regular properties such as String, Long and etc. In the JSP when I submit the form, all the regular properties used such as String, int, long in Person are mapped correctly, but all the data that should

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

核能气质少年 提交于 2019-12-03 07:27:27
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 that tells you how to start your project because there may be a lot of things to consider. I think an

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

早过忘川 提交于 2019-12-01 00:49:20
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 ModelDriven is a object called Person and my person has an attribute called Address that is another object. Address has regular properties such as String, Long and etc. In the JSP when I submit the form, all the regular properties used such as String, int, long in Person are mapped correctly, but all the data that should be mapped to address are not. <s:textfield name="name" id="name" size="25" maxlength="15" /> <s

How Struts2 ModelDriven interface works

时间秒杀一切 提交于 2019-11-28 10:06:49
I have a doubt. How the Struts2 Modeldriven interface works. In my application I used for a single form. And I placed setters and getters as same as form names. Is it possible to place multiple ModelDriven objects with setter and getter. If I placed like that then how it will recognize? Any action implementing the ModelDriven interface must supply a getModel() method which returns the object that represents the action's model. Any parameters passed to the action are assumed to be sub-properties of the model. You may only have one model per action in a ModelDriven action. For example, lets

Error setting expression 'spa.amount' with value '[Ljava.lang.String;@10dd65e' )

好久不见. 提交于 2019-11-27 07:18:41
问题 I am trying following code to get data in spa object fields. Thus, I am using the following code but it is showing null values and giving the following error Error setting expression 'spa.amount' with value '[Ljava.lang.String;@10dd65e' ognl.OgnlException: target is null for setProperty(null, "amount", [Ljava.lang.String;@10dd65e) Jsp code: <s:form action="UpdatedPaid" method="post"> <s:if test="paidList.size > 0"> <s:iterator value="paidList" var="pdlst"> <div class="box"> <span class="label

How Struts2 ModelDriven interface works

风流意气都作罢 提交于 2019-11-27 03:24:21
问题 I have a doubt. How the Struts2 Modeldriven interface works. In my application I used for a single form. And I placed setters and getters as same as form names. Is it possible to place multiple ModelDriven objects with setter and getter. If I placed like that then how it will recognize? 回答1: Any action implementing the ModelDriven interface must supply a getModel() method which returns the object that represents the action's model. Any parameters passed to the action are assumed to be sub

Unexpected Exception caught setting 'xxx' on 'class xxx: Error setting expression 'xxx' with value ['x', ]

馋奶兔 提交于 2019-11-26 22:31:03
I'm passing some parameters to an action class implementing ModelDriven<Transporter> through a query-string. <s:form namespace="/admin_side" action="Test" id="dataForm" name="dataForm"> <s:url id="editURL" action="EditTest" escapeAmp="false"> <s:param name="transporterId" value="1"/> <s:param name="transporterName" value="'DHL'"/> </s:url> <s:a href="%{editURL}">Click</s:a> </s:form> The action class is as follows. @Namespace("/admin_side") @ResultPath("/WEB-INF/content") @ParentPackage(value = "struts-default") public final class TestAction extends ActionSupport implements Serializable,

Unexpected Exception caught setting &#39;xxx&#39; on &#39;class xxx: Error setting expression &#39;xxx&#39; with value [&#39;x&#39;, ]

耗尽温柔 提交于 2019-11-26 08:23:21
问题 I\'m passing some parameters to an action class implementing ModelDriven<Transporter> through a query-string. <s:form namespace=\"/admin_side\" action=\"Test\" id=\"dataForm\" name=\"dataForm\"> <s:url id=\"editURL\" action=\"EditTest\" escapeAmp=\"false\"> <s:param name=\"transporterId\" value=\"1\"/> <s:param name=\"transporterName\" value=\"\'DHL\'\"/> </s:url> <s:a href=\"%{editURL}\">Click</s:a> </s:form> The action class is as follows. @Namespace(\"/admin_side\") @ResultPath(\"/WEB-INF