struts2-interceptors

No result defined for action <class> and result input

雨燕双飞 提交于 2021-01-28 01:39:02
问题 Here is my struts.xml <package name="ajax" extends="json-default" > <action name="loadcity" method="loadcity" class="roseindia.action.user.RegisterUser" > <result type="json" /> </action> </package> When I am calling loadcity.action I am getting following error No result defined for action roseindia.action.user.RegisterUser and result input Here is my action method: public String loadcity() { country=request.getParameter("country"); cityList= dao.loadcity(country); return ActionSupport

File not downloaded with execAndWait Struts Interceptor after inserting delay

 ̄綄美尐妖づ 提交于 2020-02-16 06:57:31
问题 My code downloads a file from back-end server. Since we will be retrieving records numbering in millions, we have used Struts2 execAndWait Interceptor. To test this, we are inserting delay of 30 secs. I am able to download file without inserting delay (where test data very small), but after inserting it, i never get the file. Logs show that action class is being repeatedly executed due to <meta-refresh> of 5 secs in wait file, even input-stream is populated. What could be the reason for such

Why SessionMap is not instantiated?

旧城冷巷雨未停 提交于 2020-02-05 05:38:07
问题 The first time a member registers, the session needs to be set, which normally happens in login, so I thought I'd reuse the LoginAction without routing to it. But the sessionmap isn't getting instantiated. member logging in is: model.hibernate.Member@549c8a8c session map not instantiated RegisterAction public class RegisterAction extends ActionSupport implements SessionAware{ private String username, password, email; SessionMap<String,Object> sessionmap; MemberDAO mdao = new MemberDAO();

Negative integer request parameters not recognized when language is Arabic, other languages like english, german, french & chinese work fine

安稳与你 提交于 2020-01-16 00:41:06
问题 I have a struts2 web-application. When I change the language to arabic, all query string urls, give un-certain results. I guess that's because ? is considered to be some variable name and then it's not mapped properly to the target action by Struts2. Although examples present on internet seems to work fine, so I guess this has something to do with my struts configuration. <constant name="struts.devMode" value="false" /> <constant name="struts.ognl.allowStaticMethodAccess" value="true"/>

Parameters with no mutators and accessors (setters/getters) along with the parameters interceptor in Struts 2

十年热恋 提交于 2020-01-10 03:56:07
问题 In the following action class, I'm using the parameters interceptor. @Namespace("/admin_side") @ResultPath("/WEB-INF/content") @ParentPackage(value = "struts-default") @InterceptorRefs(@InterceptorRef(value="store", params={"operationMode", "AUTOMATIC"})) public final class TestAction extends ActionSupport implements Serializable, ValidationAware, Preparable { private static final long serialVersionUID = 1L; private String param1; private String param2; //Getters and setters. public

NullPointerException when uploading a file

荒凉一梦 提交于 2019-12-28 04:33:06
问题 When uploading a file, I get the following error: Struts Problem Report Struts has detected an unhandled exception: Messages: File: java/io/File.java Line number: 317 Stacktraces java.lang.NullPointerException java.io.File.(File.java:317) example.uploadFile.execute(uploadFile.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke

Login redirect after authentication in struts 2 using interceptors

老子叫甜甜 提交于 2019-12-25 07:59:20
问题 I have a login page. Requests for login can come from multiple action classes. Once the user is validated i have to redirect it to the previous action class (from which the request to login has come). I am using interceptors for doing this. But i have missed something and it is not able to redirect properly. Here is my code. public class SetTargetInterceptor extends MethodFilterInterceptor implements Interceptor { private static final long serialVersionUID = 1L; public String doIntercept

NullPointerException when using Struts fileuploading [duplicate]

£可爱£侵袭症+ 提交于 2019-12-24 20:37:20
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) NullPointerException when uploading a file (1 answer) Closed 3 years ago . I am following the example here http://www.tutorialspoint.com/struts_2/struts_file_uploads.htm In this example,interceptor fileUpload and basicStack are used <action name="upload" class="com.rwy.demo.action.UploadFile"> <interceptor-ref name="basicStack"> <interceptor-ref name="fileUpload"> <param name=

How to call an action method using OGNL

霸气de小男生 提交于 2019-12-23 04:12:25
问题 How to call an action method using OGNL? helloAction.java public String getQuote() { return "Don't think, just do"; } success.jsp <b>quote() :</b> <s:property value="quote()"/> <br> struts.xml <action name="greet" class="com.struts2.helloAction" > <interceptor-ref name="firewallStack"></interceptor-ref> <result name="SUCCESS">/WEB-INF/resources/success.jsp</result> <result name="input">/WEB-INF/resources/success.jsp</result> </action> I got the ref link from struts 2 OGNL This quote() method

Struts 2 - Understanding the working between OGNL and params interceptor

被刻印的时光 ゝ 提交于 2019-12-22 19:25:44
问题 I am new to Struts 2. I am studying it from the book Struts2 In Action. I am having difficulty in understanding some concepts in OGNL which are as follows- We know that params interceptor moves the data from the request parameters to the action object in ValueStack . Now while reading, I came upon a line that says- "The tricky part of the job is mapping the name of the parameter to an actual property on the ValueStack . This is where OGNL comes in. The params interceptor interprets the