How to set action scope in struts 2
In struts the action scope was defined as <action scope="session" .../> How do you set the scope in Struts2? ...
In struts the action scope was defined as <action scope="session" .../> How do you set the scope in Struts2? ...
Hello friends, I Have following in my struts.xml file <action name="ProductVerification" class="com.frontend.ProductVerification"> <result name="success">/jsp/product_verification.jsp</result> <result name="input">/jsp/product_verification.jsp</result> <result name="error">/jsp/product_verification.jsp</result> </action> ...
Hi, I am working with struts2 portlet sample and deployed in liferay portel using liferay server. It is working fine. But now I am trying to validate my form even that working perfectly for first time. But after first attempt when form is submitted with desired values it is not proceedin further and not recogonizing the desired action t...
I've got a struts2 action that responds to an AJAX request by taking some request parameters, calling a remote service that returns XML data, then transforming the data via XSL and returning the resulting XHTML via a Stream Result. The response is different depending on the given parameters. Here is the action class with a bunch of stu...
I am writing a small widget in struts which I want to include. The height of the widget should be auto unless I pass in a param of height. For example: # Example 1: <s:include value="myWidget.jsp"> <s:param name="height">300 px</s:param> </s:include> # Example 2: <s:include value="myWidget.jsp"> </s:include> Inside myWidget.jsp I...
Hi all, Can anyone please tell me how to create a EAR file of a web application ? Thanks in advance. ...
I have an s:iterator tag like the following <s:iterator value="results"> <s:property value="someIntValue"/> </s:iterator> At the end of this loop i want the total of someIntValue. In plain java I would do something like this variable += someIntValue but can this be done inside the struts2 tag? I looked at documentation for s:s...
Hi Gurus I am using spring+struts2 and I have a large number of action classes that required a single service (mailService). Instead of injecting service into these action classes, I am wondering is there a way to create a parent class and inject the resources and then have all these classes extending the parent. So I do no need to repe...
If I have an action where the result is a redirectAction to another action in a different class, is it possible to get validation errors to display in the resulting action? E.g. in the following example, if a user executes actionA (which has no views associated with it), and there are errors, is there any way to display those errors in t...
I'm using Struts2 and Java to create an iFrame Facebook-application utilizing the Facebook-Java-Api in version 2.1.0. Unfortunately, and not surprisingly, I have encountered some issues regarding the authentication. Every request to the application is intercepted by a filter. My plan is to take care of the authentication part in the fil...
i have a map and i want to validate in struts 2 validation framework by using expression validation how can i access the elements of the map dynamically? if Map myMap; how can i validate the map with dynamic key? if mymap has static key like "Salary", i could validate like <field name="myMap['Salary']"> <field-validator type="reg...
Hello, I am creating a form where a user will register with a struts2 application. It will be required for the user to input a date in a specific format. Since I am not going to use the datepicker ajax tag, I am using a textfield with a date tag in the form like this: <s:date name="birthDate" id="bDateId" format="yyyy-MM-dd"/> <s:te...
I'm trying to get an array of input into my action class but it always returns null; Here's the HTML for the input <input class="activityInput" type="text" name="sentdate[" + i + "]" value="1" /> <input class="activityInput" type="text" name="sentdate[" + i + "]" value="2" /> and here's the class for the action public class Activity...
In struts I notice there are two different ways to access variables. I am curious what the difference is and when to properly use each one. For example, suppose we set the variable height like so: <s:set var="height">300px</s:set> Now I can use it two ways: <div style="height: ${height}"> </div> ..or.. <div style="height: <...
Hello, I am using strus2 tags in a jsp to iterate over a collection: <s:if test="parent.entries.size > 0"> <table border="3"> <s:iterator value="parent.entries"> <tr /> <td><s:property value="entry"></td> <td><s:property value="date" ></td> </tr> </s:iterator> </table> </s:if> I ...
Using Struts2, I have a very simple radio tag like following <s:radio label="correctOption" name="correctAnswer" list=" #{'1':'1','2':'2','3':'3','4':'4'}" value="questionVo.correctAnswer"/> questionVo.correctAnswer returns 2. So I want the second radio button to be preselected but it is not happening. I even tried: <s:radi...
Freemarker has the ability to do text escaping using something like this: <#escape x as x?html> Foo: ${someVal} Bar: ${someOtherVal} </#escape> xml, xhtml, and html are all built in escapers. Is there a way to register a custom written escaper? I want to generate CSV and have each individual element escaped and that seems like a good ...
I am having a problem using expression language and struts tags together in a struts2 project. The following code snippet from a jsp file illustrates my problem. The fruits object is passed by a servlet. I know that the error is not from the servlet because when I comment out the form code, it correctly prints out each fruit. <c:forEach...
Hello, I am having issues deleting value-type embeddable objects from a collection in struts2. <display:table name="parent.collection" requestURI=""> <display:column property="entry" /> <display:column property="date" sortable="true" defaultorder="ascending"/> <display:column> </display:table> i am using the above di...
Hi, I am using struts2 in my application and trying to diplay error message using "s:actionerror/". It diaplays fine but a dot(.) also appears with the error message which looks ugly and is displayed like list. Is there any way to cuatomize the error message in struts2. Thanks in advance. ...