struts2

Jquery progress bar server side

僤鯓⒐⒋嵵緔 提交于 2021-02-07 09:14:15
问题 I have a long running process(not definite time) in server-side(which runs number of queries in db) which takes more than 30s. I want to display the progress in % to the user. I'm using jquery ,struts in my application. Is there a way to do it? 回答1: This is how we did it. When the process is triggered create a GUID from the client and pass it to the server. In the server side, run the process and during the run, keep storing the progress in session/cache using the GUID as key. In the client

How to post data from AngularJS to Struts2 using REST

戏子无情 提交于 2021-02-05 11:57:18
问题 I need to get the value from client side to server side. I am using AngularJS and Struts2 REST. Newbie in AngularJS here. My controller doesn't get the value passed or am i wrong in passing or using restful controller? Here is my code: angularcontroller.js app.controller('saveAddCatCtrl', function($scope, $http){ $scope.save = function(newAddCat){ $http({ method: "POST", url: "api/additionalcategory", data: $scope.additionalCategory.addCatName }).success(function(data, status, header, config)

Tiles2 Wildcard not working

风流意气都作罢 提交于 2021-02-04 21:28:10
问题 I'm using Spring-Struts2-Tiles2 in my project and I'm trying to use wildcard notation here to remove the duplicate in my setup from here <definition name="home-template1" template="/WEB-INF/jsp/templates/template1.jsp"> <put-attribute name="banner" value="/WEB-INF/jsp/sitePages/banner.jsp" /> <put-attribute name="header" value="/WEB-INF/jsp/sitePages/header.jsp" /> <put-attribute name="body" value="/WEB-INF/jsp/sitePages/body.jsp" /> <put-attribute name="archive" value="/WEB-INF/jsp/sitePages

Unable to use Bootstrap plugin with Struts 2 in Eclipse project

雨燕双飞 提交于 2021-02-04 21:12:22
问题 I have been trying to use Bootstrap plugin with my Struts 2 project, but whenever I try to add the Bootstrap or JQuery jar file to my WEB-INF/lib folder, the project doesn't run and shows up a 404 error . I have gone through few examples in the Internet, where people have been using bootstrap in Maven project and its working fine, but mine isn't a Maven project. This is the error I have been getting in the Eclipse console. Unable to load configuration. - [unknown location] at com.opensymphony

Migration error handling to Struts2

可紊 提交于 2021-02-04 21:09:25
问题 To display errors we need message keys which contains the error messages. I create a new resource bundle named ApplicationError.properties which contain this property: app.error=Error: {0} I try to change this class from struts1 to struts2, but I have a problem with error handling.I have not found the equivalent in struts2 public class MyAction extends Action{ public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse

Migration error handling to Struts2

旧城冷巷雨未停 提交于 2021-02-04 21:08:00
问题 To display errors we need message keys which contains the error messages. I create a new resource bundle named ApplicationError.properties which contain this property: app.error=Error: {0} I try to change this class from struts1 to struts2, but I have a problem with error handling.I have not found the equivalent in struts2 public class MyAction extends Action{ public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse

org.apache.tiles.definition.NoSuchDefinitionException: Cannot find definition named 'addCustomer.tiles'

旧街凉风 提交于 2021-01-29 10:43:00
问题 I am new to tiles.I have configured my tiles.xml in following way: <tiles-definitions> <definition name="baseLayout" template="/template/BaseLayout.jsp"> <put-attribute name="title" value="" /> <put-attribute name="header" value="/template/Header.jsp" /> <put-attribute name="menu" value="/template/Menu.jsp" /> <put-attribute name="body" value="" /> <put-attribute name="footer" value="/template/Footer.jsp" /> </definition> <definition name="/addCustomer.tiles" extends="baseLayout"> <put

What are different ways to access variables with OGNL in Struts 2

女生的网名这么多〃 提交于 2021-01-29 07:02:49
问题 I am working now in a Struts2 project which uses OGNL. I see three different ways to access data in JSP using OGNL. value1 ="previousList" value2 = "#previousList" value3 = "%{previousList}" What these will do and are there other ways to access data from OGNL? 回答1: The value stack which is an implementation of ValueStack has two methods push and set . The first method pushes the variable to the stack, but the second sets in to the value stack's context. If the variable in the value stack's

Struts 2 convention plugin not working !.How to get it running?

大憨熊 提交于 2021-01-29 06:50:52
问题 I have tried to use the Struts 2 convention plugin using the tutorial on the official documentation but I can't get it to run. Here's how I have configured it: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>Struts2Convention</groupId> <artifactId>Struts2Convention</artifactId> <version

Populating dropdown from database via struts2 action class (using jtable)

一个人想着一个人 提交于 2021-01-28 12:40:33
问题 I am using jtable http://jtable.org/ in my project. jTable is a jQuery plugin that is used to create AJAX based CRUD tables without coding HTML or Javascript. http://i62.tinypic.com/3461eo3.jpg jtable code for above form is HTML code <div id="StudentTableContainer"></div> Javascript code <script type="text/javascript"> $(document).ready(function () { $('#StudentTableContainer').jtable({ title: 'Student List', paging: true, pageSize: 10, sorting: true, defaultSorting: 'Name ASC', actions: {