struts2

Why are my actionErrors and fieldErrors displayed with braces []?

时光总嘲笑我的痴心妄想 提交于 2021-01-28 09:54:32
问题 Once the pages have captured errors within my Struts 2 application the errors are displayed correctly from my resource bundles however they are always displayed with a braces [] For example [first name must not be empty] These are displayed through the tags <s:actionerror /> <s:iterator value="fieldErrors"> <s:property value="value" /> </s:iterator> These come through the Action-validation.xml and setting a addFieldError() through the validation method Is this something to do with my theme

Cannot redirect a jsp file and display values using Struts 2

别等时光非礼了梦想. 提交于 2021-01-28 06:06:21
问题 I have created a simple program that gets the firstname and lastname of a user using a textfield. But the problem is that when I click the submit button I cannot redirect it to another jsp file which shows the firstname and lastname of the user. Here's my HelloAction class: package com.novamsc.training.struts.action; import com.opensymphony.xwork2.ActionSupport; public class HelloAction extends ActionSupport { private String firstName; private String lastName; public String user(){ return

Cannot redirect a jsp file and display values using Struts 2

荒凉一梦 提交于 2021-01-28 05:55:35
问题 I have created a simple program that gets the firstname and lastname of a user using a textfield. But the problem is that when I click the submit button I cannot redirect it to another jsp file which shows the firstname and lastname of the user. Here's my HelloAction class: package com.novamsc.training.struts.action; import com.opensymphony.xwork2.ActionSupport; public class HelloAction extends ActionSupport { private String firstName; private String lastName; public String user(){ return

No result defined for action <class> and result input

雨燕双飞 提交于 2021-01-28 01:39:02
问题 Here is my struts.xml <package name="ajax" extends="json-default" > <action name="loadcity" method="loadcity" class="roseindia.action.user.RegisterUser" > <result type="json" /> </action> </package> When I am calling loadcity.action I am getting following error No result defined for action roseindia.action.user.RegisterUser and result input Here is my action method: public String loadcity() { country=request.getParameter("country"); cityList= dao.loadcity(country); return ActionSupport

Struts 2 jquery plugin, chart plugin does not support categories

依然范特西╮ 提交于 2021-01-24 08:31:54
问题 The chart component in the Struts 2 jQuery plugin version 3.6 seems not supporting the category plugin for the sjc:chart . I want to use Flot With “String” x-axis for chart and the best solution is to use jquery.flot.categories.js (Described at Flot With "String" x-axis). As I reviewed some struts-jquery-plugin code, I found that the jquery.chart.struts2.js does not use this plugin, on the other hand the jquery.flot.categories.js file is in the struts2-jquery-chart-plugin-3.7.1.jar file.

Struts 2 jquery plugin, chart plugin does not support categories

孤街浪徒 提交于 2021-01-24 08:31:09
问题 The chart component in the Struts 2 jQuery plugin version 3.6 seems not supporting the category plugin for the sjc:chart . I want to use Flot With “String” x-axis for chart and the best solution is to use jquery.flot.categories.js (Described at Flot With "String" x-axis). As I reviewed some struts-jquery-plugin code, I found that the jquery.chart.struts2.js does not use this plugin, on the other hand the jquery.flot.categories.js file is in the struts2-jquery-chart-plugin-3.7.1.jar file.

Struts 2 jquery plugin, chart plugin does not support categories

旧街凉风 提交于 2021-01-24 08:30:10
问题 The chart component in the Struts 2 jQuery plugin version 3.6 seems not supporting the category plugin for the sjc:chart . I want to use Flot With “String” x-axis for chart and the best solution is to use jquery.flot.categories.js (Described at Flot With "String" x-axis). As I reviewed some struts-jquery-plugin code, I found that the jquery.chart.struts2.js does not use this plugin, on the other hand the jquery.flot.categories.js file is in the struts2-jquery-chart-plugin-3.7.1.jar file.

Using getText() for the getting property in Struts 2

白昼怎懂夜的黑 提交于 2021-01-18 04:41:07
问题 I am working on the Struts2 framework with JSP. In my samplePrj.properties file, in that com.samplePrj.Successmessage = Saved Successful is an attribute. I need to use this value in my JSP page, using Struts2. so how can I get the value of "com.samplePrj.Successmessage" in my JSP page. 回答1: Use the text tag <s:i18n name="samplePrj"> <s:text name="com.samplePrj.Successmessage" /> </s:i18n> it will load the bundle using i18n tag from samplePrj.properties and print the value from key com

Access url parameters in Action classes Struts 2 in AJAX call?

和自甴很熟 提交于 2020-12-06 07:01:46
问题 I know that S2 provides a clean way to fetch the request parameters in you action class all you need to follow these simple rules. Create a property with same name as request parameter name. Create getter and setters for this property or make property public (for S2.1+) However, when I do this in an AJAX call like this: $.ajax({ url: '/gma/getJSONData.action?tspName='+tspName+'&thresholdType='+thresholdType, I don't get the tspName parameter inside action class. I created the getter/setter

Access url parameters in Action classes Struts 2 in AJAX call?

喜夏-厌秋 提交于 2020-12-06 07:01:25
问题 I know that S2 provides a clean way to fetch the request parameters in you action class all you need to follow these simple rules. Create a property with same name as request parameter name. Create getter and setters for this property or make property public (for S2.1+) However, when I do this in an AJAX call like this: $.ajax({ url: '/gma/getJSONData.action?tspName='+tspName+'&thresholdType='+thresholdType, I don't get the tspName parameter inside action class. I created the getter/setter