struts-config

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

本秂侑毒 提交于 2019-12-17 05:13:20
问题 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

How to disable struts 2 validation before form submission?

一笑奈何 提交于 2019-12-12 04:39:20
问题 I'm doing a project with struts2, Hibernate. I want struts to validate my form. I have added a MyAction-validation.xml and it works fairly well. (I say fairly well because it doesn't validate on the client side. I have set the validate attribute of the <s:form/> tag to true) First it provided me some errors and googling it I got that I should add a result with input name. So now I have a result with input name in my action without understanding well how it works and why. My action returns a

Struts2 - Can an action name be repeated in the struts.xml using the same action class but for different methods?

守給你的承諾、 提交于 2019-12-11 22:18:19
问题 My idea is to perform actions using Struts2 the below way using a single Action class and multiple methods in it: View roles action: manage/roles.action?method%3Aview=View Add role action: manage/roles.action?method%3Aadd=Add The URLs are called through invoking submit buttons as shown below from test.jsp: <s:form namespace="/manage/" action="roles" method="get" > <s:submit method="view" value="View" /> <s:submit method="add" value="Add" /> <s:submit method="edit" value="Edit" /> <s:submit

JSP Timeout Issue in Struts2

一世执手 提交于 2019-12-11 10:57:52
问题 I am using struts framework in which a JSP page submits form data. In Action we have a REST call to other application whose timeout is set to -1 (infinite). The request is processed at the other application smoothly. But while the processing the request in Action, the JSP page is redirected to error page which is set in struts.xml config. What am assuming is the JSP page timeout or struts redirected to the error page because of long delay. How can i avoid this behaviour? 来源: https:/

Struts form automatically submitted when using validate() method

一个人想着一个人 提交于 2019-12-11 07:44:53
问题 I am using struts 1.2. My struts flow is working properly but when I am using validate() method of action form for validation. my form is automatically submitted. and this validation method get called. I am not sure this is normal behavior of struts or some configuration are missing in my application. Please help me to understand it. following are the config and code <action path="/Postaddd" type="bseller.postadd.PostaddAction" parameter="dispatch" scope="request" validate="true" name=

Why the Exception raised from my Interceptor is not caught by <global-exception-mappings>?

跟風遠走 提交于 2019-12-10 11:07:49
问题 I have a custom Interceptor, from which I throw an Exception; The Action(s) running that Interceptor is managed by Convention plugin; The Exception raised by the Interceptor is globally defined in struts.xml for the package the Action is running into. RESULT: the exception mapping is ignored and I get the Struts Problem Report Struts has detected an unhandled exception: ... Stacktraces java.lang.IllegalArgumentException: my message I guess I'm just missing something stupid... we've already

multiple struts actions on single form not working [duplicate]

拈花ヽ惹草 提交于 2019-12-08 17:41:35
This question already has answers here : How to detect submit button clicked in multiple submit buttons scenario in single Action class? (2 answers) Closed 4 years ago . I am trying to call an action on submit button but it is not working. index.jsp <s:form method="post" enctype="multipart/form-data"> <s:file label="Upload Matrix.csv file:" name="file"></s:file> <s:submit value="Upload" action="uploadFile" cssClass="btn btn-info"></s:submit> <s:submit value="Update" action="fileData" cssClass="btn btn-primary" /> <s:submit value="Show" action="sessionMatrix" cssClass="btn btn-primary"/> </s

multiple struts actions on single form not working [duplicate]

半腔热情 提交于 2019-12-08 06:42:49
问题 This question already has answers here : How to detect submit button clicked in multiple submit buttons scenario in single Action class? (2 answers) Closed 4 years ago . I am trying to call an action on submit button but it is not working. index.jsp <s:form method="post" enctype="multipart/form-data"> <s:file label="Upload Matrix.csv file:" name="file"></s:file> <s:submit value="Upload" action="uploadFile" cssClass="btn btn-info"></s:submit> <s:submit value="Update" action="fileData" cssClass

Getting JSON popup to save or open dialog instead of actual content?

故事扮演 提交于 2019-12-08 03:56:54
问题 My Problem : The json string returns as a file. When i call the getJSONResult action it will give me a file with the json string in it, which i can open or download. I think it’s a configuration problem, but i can’t find it. I would be very glad if somebody could help me, thanks guys! I have an opening form with a submit that uses an action and execute method to get the data. Then, the only way I could get jquery to work was to put an action and execute method that just returns 'success' and

Why the Exception raised from my Interceptor is not caught by <global-exception-mappings>?

人走茶凉 提交于 2019-12-06 10:21:11
I have a custom Interceptor, from which I throw an Exception; The Action(s) running that Interceptor is managed by Convention plugin; The Exception raised by the Interceptor is globally defined in struts.xml for the package the Action is running into. RESULT: the exception mapping is ignored and I get the Struts Problem Report Struts has detected an unhandled exception: ... Stacktraces java.lang.IllegalArgumentException: my message I guess I'm just missing something stupid... we've already discussed of this in a similar question , but it's still not clear if it can or can't work this way: