struts2

JasperReport Issue using with struts2 - getting null in final PDF file

Hello, i am writing my jasper report problem with struts2. Following is the code that i am trying to execute : struts.xml contains : <action name="myJasperTest1" class="temp.JasperAction1"> <result name="success" type="jasper"> <param name="location">/jasper/our_compiled_template.jasper</param> ...

Is there any init method given for struts action class?

Hello Frieds, Is there any init method provided for struts action class that can be called before every method of that action class? For example, I have an action class for struts 2 as given below import com.opensymphony.xwork2.ActionSupport; public class EmployeeAction extends ActionSupport{ private DepartmentDaoService deptServic...

need help with some html/css trickery to get around drawback in struts2

I am trying to get an html page like http://jsbin.com/awoco This is a JSP page so it will include scriptlet. Final html will be kind of like this (i left tags unclosed to save space): <% Iterator it = MyList.iterator() While (it.hasNext()) SomeClass all = it.next(); SomeClass a = it.next(); SomeClass b = it.nex...

Struts2-File Upload Interceptor: after uploading file name is not appearing.

Hi All, In my struts2 application I am using “File Upload Interceptor”. Its running well but after uploading when same jsp page appears it does not show browsed file name in the textbox of <s:file> tag i.e textbox comes empty after successful uploading. Here is my code snippet- main.jsp <s:form action="smAction" enctype="multipart/form...

Pitfalls of Grails? Comparison to Struts 2?

I am looking for any comparative analysis of the Grails vs Struts 2. If any of you gurus have run into issues using Grails. Please do let me know if you have worked on large scale projects that use Grails. Peter Keller had mentioned in my previous post here that Sky News is using Grails. I was wondering if anyone else is using it. It wou...

Is it possible to access struts2 variable in jsp scriptlet?

Hello friends, Is it possible to access struts2 variable in jsp scriptlet? If I have struts2 variable like <s:set var="test" value="%{'true'}"/> Can I use variable "test" in JSP scriptlet? If yes. How is it possible? Can anyone give some idea about it? Thanks. ...

struts2: <s:checkbox> status is required bydefault on another jsp

In my struts 2 application I have a jsp (say first.jsp) with following checkboxes - <td><s:checkbox name="authority" fieldValue="ORIGINATOR"/></td> <td><s:checkbox name="authority" fieldValue="EVALUATOR"/></td> <td><s:checkbox name="authority" fieldValue="PURCHASE"/></td> <td><s:checkbox name="authority" fieldValue="EXTRA"/></td> Sup...

want to add dynamic content on jsp page

Hello All, I am using Struts2 tags for my designing page at front end side. Now i have a requirement for in my jsp page that i have put 3 simple fields & on some add link i want to so repetitively some another 3 or 4 field at same form dynamically. For example if user clicks 5 time on add link then 5 time that 3 or 4 field have to sho...

How can I display HashMap constructed by JSON?

I know I can display an ArrayList by using for(i=0;i<data.list.length;i++){ html += data.list[i] +"<br />"; } to display the AarryList Object, I tried the same with HashMap object but it simply doesn't work. Thanks in advance. ...

struts2 iterator tag help

I am using the Struts iterator tag and trying to get 3 elements of my list in 1 iteration. This is what I have. <s:iterator status="stat" value="(secondResultSet.size()/3).{ #this}" > <s:property value="#stat.count" /> <!-- Note that "count" is 1-based, "index" is 0-based. --> <s:property value="%{secondResultSet.get(#stat.inde...

is struts2 Framework dead? if so, which direction to go from here?

I've been working in struts2 framework for the past year and a half. As I look around SO it seems like struts2 questions get the least amount of hits. At first I thought it was because the SO community is not much into struts2, but this is the case in other forums as well. Only the struts2 mailing list is pretty active. I think str...

JPA @ManyToMany Writing On Create But Not Update

Hi gang, My team has two classes, User and Store, related by JPA @ManyToMany annotations. The relevant code is below. When creating a new User object and setting its stores, life is good. But we're seeing some unexpected behavior when trying to update User objects through our Struts 2 / Spring web UI. (These problems do not occur whe...

Struts2: value from Action - DAO (database) - VO - View (jsp). Suggest ?

Hi All, In my struts 2 application, I am generating a textual report in jsp. I have already fetched all the required value from databases in ResultSet available in my DAO class. Now, please suggest me the best way to get all the values (present in ResultSet) in my jsp page to show the report. I don’t want to write any login in my jsp. Pl...

Refreshing a Table Column via Ajax

I have a web page containing a table of jobs running on my system. As these jobs finish or change state the table needs to reflect the changes. Currently I refresh the whole table via AJAX every 8 seconds. This works fine for a certain number of jobs, but causes performance issues with very high (~100) job loads, eventually causing brow...

server side paging with jQgrid

I just took a look at jqgrid. Has anyone tried implementing this plugin, or used jQuery, to achieve server side pagination? I am using struts2 and populating a html table with list returned from DB. This list is returned from an Oracle SP. The SP, along with some other parameters, is taking in 'start' and 'begin'. So I can pass numb...

struts 2 : use multiple message resources on jsp

I need to use multiple resource files on my jsp to show localised messages. Whats the way to include it in struts 2. I have seen <s:i18n name="">, but this will make the code pretty messy as it need to be written and closed for each of the labels. I beleive there is message- resource tag in struts 1x which we can declare in struts conf...

Can someone explain how the struts2 XSL ResultType works?

I'm trying to figure out how to use the struts2 XSL ResultType. I just can't figure out how it is supposed to work and aside from the official documentation, I've found maybe two articles online that tried to explain it (unsuccessfully for me). My understanding of how it works is I create an xsl stylesheet, then I have a struts action ...

Populate Collection from Struts2 Form Submission

I'm trying to populate a List of beans from a form: public class Foo { public String attr1; public String attr2; } public class Bar { public List<Foo> foos; } public class StrutsAction extends Action { public Bar bar; } So in my Struts2 form, what's the best way to populate Foo? Intuitively, I want to do: <input type="...

how to return excel in Struts2 result?

I am trying to return an Excel sheet from my struts2 action class. I am not sure what result-type should I be using? Has anyone tried to return an excel from struts2 action class? I would like the user to be presented with open/save/cancel dialog box ...

how to access form array fields with struts2

Hello friends, Currently I am working on one form which contains 2 buttons. Clicking on 1 button I am getting block of html fields as below. ` <table width="100%"> <tbody><tr> <td class="style4" width="12%" align="center">CODE<span class="style3"> </span></td> <td width="18%"><input name="c_code[]" value="" id="c_...