struts-1

Struts 1.x vs Struts 2.x

泄露秘密 提交于 2019-12-30 08:22:22
问题 I have reviewed a few Struts 1 vs 2 questions on SO but none seem to answer the question in the perspective that I am looking at it with. I am about to start work architecting a new system, a complete re-engineering of a very old desktop application. The goal is to make it web based, add more functionality, make it more usable etc (the usual reengineering reasons). The team who will be developing the system are mainly Java developers and have worked on Struts 1.x extensively over the past 5

How to get the data in Struts from AngularJS post

匆匆过客 提交于 2019-12-29 04:55:29
问题 I’m using Struts1.2 with Angular to post some data and want to get the data in java. I’m able to retrieve the data from the server and able to display it in the screen. Now I’m trying to post some data with Angular to the server and trying to get the data from request.getParameter in java. I made three tries but i couldn't. Below I have also provided the following files, with explanation and screenshots of my three tries. 1. CartController.js var myApp = angular.module('cartApp',[]); myApp

Source Code fir Tiles struts-tiles2-1.4.0-SNAPSHOT

Deadly 提交于 2019-12-25 04:26:41
问题 I am not able to find the source code of struts-tiles2-1.4.0-SNAPSHOT.jar version of tiles. The jar files are present at http://people.apache.org/~pbenedict/struts-osgi/org/apache/struts/struts-tiles2/1.4.0-SNAPSHOT/ location. 回答1: While choosing a Struts2 Tiles plugin, you must ensure it is the one designed for your version of Tiles ( 2 or 3 ), and it is the exact version of your Struts2 JAR ( 2.3.16 , for example) List for Tiles 2: Struts 2 Tiles 2 Plugin List for Tiles 3: Struts 2 Tiles 3

jQuery modal form AJAX to Struts 1.3 Action

折月煮酒 提交于 2019-12-25 02:39:12
问题 Making a new question, as was suggested to me. I'm trying to send data from a jQuery UI modal form to a Struts ActionForm using AJAX. The URL looks something like this (using HTTP GET): localhost.../insertVenue.do?param1=param1&param2=param2... However, when I try to to do this I get 404 not found. /insertVenue.do is found, but not the URL with the extra parametres. Hope anyone can shed some light on the issue! This is what my struts-config.xml looks like (for the specific action): <action

How to come back to form without reset the values?

荒凉一梦 提交于 2019-12-25 02:22:21
问题 I have a web application that is made with Java+Struts. There is a form that when is submited it executes an Action that shows the results of the search. Since here, all ok. What I need is to put a link in the results page to come back to the form without erasing the search parameters. I've put a link that goes back to the form page, but allways erase the search parameters. I've thinking about saving and restoring this parameters to the java session, or adding the parameters to the url (like:

Where to store database connection & global variables in struts 1.3

旧街凉风 提交于 2019-12-25 00:48:33
问题 I am new to struts java application & i want to store database connections & global variables. What is best option to store values (Web.xml or struts-config.xml). and How to access the variables defined in that xml files. Is there any other way to store & access database connections. There should be way so that i can go & edit the files like variables and databases connections easily. 回答1: Best way to store your database connection is Configure DataSource & ConnectionPool on application

Struts 1 login application example error

半腔热情 提交于 2019-12-24 20:36:23
问题 I am new to Struts and tried to execute Login Form. But it's not getting executed after the default constructor in the ACTION class. LoginForm.java package struts.login.action; import org.apache.struts.action.ActionForm; @SuppressWarnings("serial") public class LoginForm extends ActionForm { public LoginForm() { } private String username; private String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public

How to retrieve the data from the database and display it on a jsp using Struts and Hibernate

家住魔仙堡 提交于 2019-12-24 14:12:24
问题 I am new to Struts. I want to display all the details from a table to the user on a JSP page. Here is my code: public class ListeActeurAction extends Action{ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception { System.out.println("Action"); ListeActeur ListeActeur= (ListeActeur) form; String query = "select nomActeur from Acteur " ; ListeActeur.setLis( HibernateUtil.ListeActeur(query, req)); req.setAttribute(

Equivalent of TagUtils.getInstance().lookup() Struts1 in Struts 2

南楼画角 提交于 2019-12-24 06:04:07
问题 I have this function in Struts 1: /* * (non-Javadoc) * * @see org.apache.struts.taglib.bean.WriteTag#doStartTag() */ public int doStartTag() throws JspException { Carac carac = (Carac) TagUtils.getInstance().lookup(pageContext, name, property, scope); // Code here return SKIP_BODY; } and I am trying to create the same tag in Struts 2 but don't know what's the purpose of this: TagUtils.getInstance().lookup() 回答1: I found a solution to get my object from the view to the tag in struts 2 : my tag

Passing a Java object from one Struts action to another

时光怂恿深爱的人放手 提交于 2019-12-24 05:32:24
问题 In one of my Struts action I've got the following code in a method: ... List<Object> retrievedListOfObjects = c.getListOfObjects(); return mapping.findForward("view"); } fw_view leads to a new Struts action with another Struts form. Let's say this form has got among others the following field List<Object> listOfObjects; I now want to pass the retrievedListOfObjects from within the first Struts action to the form of the following Struts action. Is this possible without storing it in the