struts-1

Jquery Modal Forms with Struts 1.3

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:31:49
I'm builing a web application using Struts 1.3 for a class project, and I'm having some problems with the AJAX compatibility of Struts 1.x (I hear 2.x is way better with AJAX and jQuery). Thank you for the reply, this is the updated problem: I'm currently using a jquery UI modal form in the same jsp, and want to send the form data to a Struts Action when the user presses "create new venue" using AJAX. How do I go about sending (and retrieving) the data between the form and the Struts action? In other words, the connection between: "Create new venue": function() { $.ajax({ url: "/registered

struts.xml and struts-config.xml

前提是你 提交于 2019-12-03 05:43:52
What is the difference between struts.xml and struts-config.xml? Are both the same or is there any difference between them? The core configuration file for the Struts framework is by default the struts.xml for Struts 2 and struts-config.xml for Struts 1. They are both configuration files so that is the same, but they are different beasts because they refer to different versions of the Struts framework. There are large differences between Struts 1 and 2 as you can see here . The files have different structure and content so you can't really compare one with the other (except for their purpose).

Cross-site request forgery prevention using struts token

只愿长相守 提交于 2019-12-02 22:33:13
I want to implement Cross-site request forgery prevention for my web application which is base on struts 1.x framework. I know that struts 2 framework provide token interceptor for this and I can implement similar functionality using filters. I am bit confuse about few thinks 1 ) how I can generate unique token with straightforward way ? (can I use Action class token for this purpose which is use for avoiding duplicate form submission) Are there any issue in using struts 1.x framework token mechanism for CSRF Prevention Joseph Erickson The Struts 1 Action token methods work like the Struts 2

onChange event not working when change automated

一曲冷凌霜 提交于 2019-12-02 19:35:18
问题 I have an onChange event on one select box (usageDisplays), which populates the next select box based on the selected value of the first: <html:select name="usageDisplays" property="name" indexed="true" onchange='<%="populateYearsList(" + Id + "," + name + ")"%>' /> This works fine when the user selects the value in usageDisplays, but doesn't work at all when the value of usageDisplays is set based on a radio button choice earlier on the page getElementByName("usageDisplay.name").value =

Accessing External Files Into Our Web Application

社会主义新天地 提交于 2019-12-02 15:51:18
问题 This question might be asked many times, but I did not find a direct answer. Actually I am using WebSphere for running my Java web application, I wanted to save/store my uploaded files/resources to folder outside server directory, say D:/resources/ but my concern is, is it possible that we do this? As this might be sort of security breach. If it is possible then how to do it in Java web applications. 回答1: Below is code for uploading files in struts 1.x public class MyModel extends ActionForm

<html:multibox> equivalent in Struts 2

纵然是瞬间 提交于 2019-12-02 12:19:48
问题 Below is the html tag multibox which i want to migrate it to struts 2 <html:multibox name="unitForm" property="eservices"> <bean:write name="service"/> </html:multibox> as it is checkbox so thought of using simple checkbox which is in the iterator so i used below code <s:checkbox theme="simple" name="unitForm.eservices"></s:checkbox> in action String[] toArray = new String[selectedadminVOs.size()]; unitForm.setEservices(selectedadminVOs.toArray(toArray)); stuck here,without or minimal changes

Accessing External Files Into Our Web Application

做~自己de王妃 提交于 2019-12-02 09:47:31
This question might be asked many times, but I did not find a direct answer. Actually I am using WebSphere for running my Java web application, I wanted to save/store my uploaded files/resources to folder outside server directory, say D:/resources/ but my concern is, is it possible that we do this? As this might be sort of security breach. If it is possible then how to do it in Java web applications. Below is code for uploading files in struts 1.x public class MyModel extends ActionForm { private static final long serialVersionUID = 1L; private FormFile file = null; public void setFile

Java web app: Tomcat and configuration files .properties

六眼飞鱼酱① 提交于 2019-12-02 08:30:47
问题 I have a java web app with Tomcat as servlet container. I would to use different configuration files for different build configurations, i.e. 1) demo.properties 2) real.properties 3) test.properties in which I would to specify the database name, db user and password (now for the db I use JNDI resource configuration in app context.xml ), if send mail should be enabled or not (now I have two methods whose content I have to comment or not according to the purpose), some css image paths and some

<html:multibox> equivalent in Struts 2

ぃ、小莉子 提交于 2019-12-02 04:06:05
Below is the html tag multibox which i want to migrate it to struts 2 <html:multibox name="unitForm" property="eservices"> <bean:write name="service"/> </html:multibox> as it is checkbox so thought of using simple checkbox which is in the iterator so i used below code <s:checkbox theme="simple" name="unitForm.eservices"></s:checkbox> in action String[] toArray = new String[selectedadminVOs.size()]; unitForm.setEservices(selectedadminVOs.toArray(toArray)); stuck here,without or minimal changes in action code how can i migrate it to struts2 The equivalent in Strust2 is <s:iterator var="row"

cannot find my bean using the InitialContext.lookup() method

拟墨画扇 提交于 2019-12-01 12:14:02
I have tried to use struts 1.3 API to make a small application with EJB 3.0. Unfortunatelly i cannot use the @EJB annotation to call my bean object from inside my action class. I have solved this problem using different workarounds ( the first one is to use my global jndi name of my bean and the other is to call another class first and use the @EJB annotation from that class). Still these two workarounds have significant disadvantages. I would like to call my EJB directly from my action class. I have read plenty examples using the "java:comp/env/beanName" JNDI name but still haven't figure out