struts-config

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

别等时光非礼了梦想. 提交于 2020-01-02 03:17:12
问题 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

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

Why my first “Hello World” LifeRay portlet result to be “temporarily unavailable.”?

泄露秘密 提交于 2019-12-24 11:35:26
问题 I am absolutly new in LifeRay portlet development and I have some problem to create an "Hello World" test portlet into a project on which I am working on. In this project it is used Structs 2 to do the dispatchment. So I have done the following operations: 1) I create the TestPortlet1Action class into this folder: /Web/src/main/java/mypackage/actions/ where I define the startTestPortlet1() method that is the starting method of my protlet (I think that this is the portlet entry point): package

Struts struts-config.xml action-mapping explained

只愿长相守 提交于 2019-12-21 05:06:14
问题 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

Avoid Return “input” Automatically in Struts

泪湿孤枕 提交于 2019-12-18 07:13:07
问题 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.

How to define a global page when requested page or method is not found?

♀尐吖头ヾ 提交于 2019-12-17 20:29:54
问题 I know how to fine a global error redirect page in our defined package when exception encountered that just by adding the following configuration in the parent package in struts.xml : <global-results> <result name="error">/error.jsp</result> </global-results> <global-exception-mappings> <exception-mapping exception="java.lang.Exception" result="error" /> </global-exception-mappings> But It seems to not able to catch those exceptions like requested resources, methods, pages are not found, I