I have Struts 2 actions with different (HTML and JSON ) result types. They use common interceptor. If needed to intercept the request, how to return a result based on given action result type? For example, my Action.ERROR forwards to JSP page. If action is JSON type I want to forward JSON error instead. Answer I have Struts2 actions with
Tag: struts2
What is the default package name for Struts in struts.xml?
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. Answer The package name is completely independent of your code artifacts. The struts-default package is… the Struts 2 default
How to put variable in OGNL tag
In this code questions is a list which contain questions object with In my program, I will make it appears in browser like The list may contain multiple question objects so I made it to show 5 question per page. My problem is (for example) the user may go from page 4 to page 2 and I want to refill
PageOutputStream causing java.lang.OutOfMemory
We have a struts2 web application running in Tomcat 7 that is intermittently experiencing the same problem: Application operating perfectly normally After a variable amount of time (anywhere from 10 minutes to 7 days) the application slows down to a halt Multiple java.lang.OutOfMemory errors in catalina.out Linux free -m shows all physical and swap memory is used up (even though
How to use blueimp jQuery file upload: Empty file upload result in Struts 2, fileitems are empty
I am using Blueimp and server side is Java, Struts2. I couldn’t find examples using Java, anyway I managed to use the sample code, but I am getting “Empty file upload result” when I am trying to upload a single file also. The HTML part is the same, I am not pasting here as it may go lengthy. The jQuery
Struts2 Tags Radio button
I have this iterator that loops through an object. where answer is a boolean value, that I am trying to set through radio buttons. but the problem is, upon on the generated html, teh radio buttons. is like this It did not have the indice/index. it only gave me the %{#key.index} Answer you have to use property tag to get
NoSuchMethodError when using submitting form in Struts 2
I’m currently working through the tutorial found on the Apache Struts website. Currently, whenever I press submit on the form, or when I click the Bruce Philips hyperlink, I get a NoSuchMethodError. I’m not too sure what the issue is either and I believe I’ve included everything the tutorial states. I’ve tried including the dependency in my pom.xml, but that