struts-config

Struts 2 Download - How to configure the file name dynamically?

ぃ、小莉子 提交于 2019-12-05 07:48:08
I am developing one application , where people will download the required file from a location mentioned in the DB to their Local. I am using struts 2 for downloading the file from the server . I can download the file without any exception and it works perfectly. But the files am download has the filename i specified in struts.xml , i want it to be the exact filename which am downloading . example if the original file name is struts.pdf , i am downloading it as download.pdf, how to prevent it and download the file with actual filename My struts.xml configuration as follows , <action name=

Struts struts-config.xml action-mapping explained

大兔子大兔子 提交于 2019-12-03 17:04:40
I am a noob to Struts framework. I am trying to understand how action-mapping works exactly. Suppose I have a JavaScript file that sends an AJAX request: $("button").click(function(){ $.ajax({url: "myTestUrl.do", success: function(result){ //do something with result }); }); and my struts-config.xml file looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <struts-config> <form-beans> <form-bean name="testForm" type="com.test

Basic flow of Struts

时间秒杀一切 提交于 2019-12-03 01:45:21
问题 Well I want to study Struts so I am going to begin with Struts 1, I would like to know the general flow. What files are required? Whats the function of struts-config.xml? validation.xml? validation-rules.xml When you visit your JSP page, and an action gets fired, what happens? What does the Action and Form class do? Which class is called first when an action gets fired. I just downloaded a sample form, and all these files are confusing at first. I would like to know whats going on to get a

Basic flow of Struts

点点圈 提交于 2019-12-02 15:19:00
Well I want to study Struts so I am going to begin with Struts 1, I would like to know the general flow. What files are required? Whats the function of struts-config.xml? validation.xml? validation-rules.xml When you visit your JSP page, and an action gets fired, what happens? What does the Action and Form class do? Which class is called first when an action gets fired. I just downloaded a sample form, and all these files are confusing at first. I would like to know whats going on to get a better idea of Struts. You should start with a tutorial on Struts, that will make it easy to understand

What is the default package name for Struts in struts.xml?

冷暖自知 提交于 2019-11-30 09:46:03
问题 I created a new class called RegesterAction but I didn't keep this class in any package. How can I configure this class in the struts.xml ? Below is the struts.xml file but I'm unable to understand the attribute values "default" and struts-default . <struts> <package name="default" extends="struts-default"> <action name="*Register" method="{1}" class="RegisterAction"> <result name="populate">/register.jsp</result> </package> </struts> 回答1: The package name is completely independent of your

Avoid Return “input” Automatically in Struts

Deadly 提交于 2019-11-29 12:29:59
There is no problem when the action configuration in struts.xml is like this: <action name="customer-form"> <result name="success" type="tiles">/customer.tiles</result> </action> The problem comes when I access the action class on action configuration (struts.xml). I access the class before displaying the form because I want the dropdown option in the form to display the appropriate value as I instantiate it in action class. But it turns out, it will return "input" and I must handle it. method in action class: public String addCusto(){ custoType = new ArrayList<String>(); custoType.add("ABC");

Changing struts.xml file name for a multi-module Maven web project

流过昼夜 提交于 2019-11-28 11:44:08
I have a Maven project with multiple modules. Out of four modules, two of them are web modules. Here is the structure. MyProject | |__ api | |__ commons | |__ web_child | |__ web_main web_main module is the main one and it can include web_child module also. web_child module structure is web_child | |__ src/main/java //java action classes and all |__ src/main/resources | |__ struts-config.xml | |__ WEB-INF |__ JSP Pages web_main module structure is web_main | |__ src/main/java //java action classes and all |__ src/main/resources | |__ struts.xml | |__ WEB-INF |__ JSP Pages Both modules are war

Changing struts.xml file name for a multi-module Maven web project

孤街浪徒 提交于 2019-11-27 06:25:08
问题 I have a Maven project with multiple modules. Out of four modules, two of them are web modules. Here is the structure. MyProject | |__ api | |__ commons | |__ web_child | |__ web_main web_main module is the main one and it can include web_child module also. web_child module structure is web_child | |__ src/main/java //java action classes and all |__ src/main/resources | |__ struts-config.xml | |__ WEB-INF |__ JSP Pages web_main module structure is web_main | |__ src/main/java //java action

Struts2 .action extension causing CSS, JavaScript and Struts Dojo to break

风格不统一 提交于 2019-11-26 21:02:09
We have been running on Struts 2.1.8 for some time and all Struts actions have been working as expected, i.e. href's to the Struts actions are rendered with the action name with no extension. Here is the JSP code that set's up the links: <ul id="top_menu"> <li id="itemHome" class="active"><s:a action="viewHome">Home</s:a></li> <li><s:a action="viewSearch">Search</s:a></li> <li><s:a action="viewBookMarks">My Bookmarks</s:a></li> <li><s:a action="viewSupport">Support</s:a></li> </ul> The links rendered correctly to http://localhost/viewHome , http://localhost/viewSearch , etc. under 2.1.8 We