struts2

struts 2, tiles 2 dynamic title

Hi Gurus, I am using tiles 2.0.6 as my template framework together with struts 2.1.6. I am writing a simple cms page and want to let the user to define the title of each html page. I have a title definition like this <definition name="base" template="/WEB-INF/jsp/templates/base.jsp"> <put-attribute name="title" value=" "/>...

Format number in Struts 2 <s:property/> tag

I would like to format number displayed by <s:property value="summary.total"/> tag in Struts 2. There is a double value. How can I do that? Should I use OGNL? Or maybe I must use <s:text/> tag and define my format in resuource file? ...

What is the best Struts2 compliant LGPL Javascript UI components library out there?

Hi community. We currently have an application built with Struts 1.2. We are currently migrating it to Struts2 and are looking for a nice LGPL library of UI web components that will still exists within the next couple of years : The cream of the cream would have been ExtJS, but the GPL license (and its subtle move from LGPL to GPL) is...

Img embedding problem in Struts2 jsp page.

I have a page called home.jsp in my struts2 application. I have embedded a html (screencompany.html) page within this home.jsp. I am trying to embed an image within the html page. But the image is not loading. Please help me out. Im very new to struts2 and jsp. Here is the home.jsp code. <iframe id="displayFrame" src="http://localhost:...

How to rewrite URL in Tomcat 6

Hello. I'll build a web application and I want to use url rewriting. In apache this is done with mod_rewrite. But how can I rewrite urls with Tomcat 6? I want to use Struts 2 framework. ...

Struts2 plugins - Dojo or jQuery or...?

Since Apache Struts has deprecated Dojo plugin from Struts 2.1.x I am thinking to change everything to jQuery. I especially noticed the difference in sizes (170kb vs 19kb - something like that). I had troubles with IE browser with handling dojo scripts, is this happening also with jQuery (when user is working with the application for a l...

Categorize Struts Action Message

Currently struts actions only handle error messages and any other messages by the following methods: addactionerror(..) addactionmessage(..) I was wondering if we can categorize action messages as : SUCESS, WARN so I can apply the correct styles to them in UI. Appreciate your help in advance. ...

BigDecimal evaluated as a string in Velocity, Struts2

I am using struts2 with Velocity 1.5 and Velocity Tools 1.3. In my template I want to do a loop like: #set ($count = ${item.qty}) #foreach($i in [1..$count]) ${item.price} ........... #end ${item.qty} is a BigDecimal but it seems like its passed to Velocity as a String maybe. Since this loop does not work. Replacing to $count...

reading and writing .xls file in arraylist

In my struts2 application, I met with a situation where I have to read .xls file and write it into an arraylist. The .xls file is of fixed format i.e no. of columns are fixed. Please suggest me the best way to do this? Thanks in advance. ...

struts2 request encoding

I am sending a XML in HTTP POST body. Question: Does struts2 support processing request in utf-8 encoding? Reference: http://www.experts-exchange.com/Programming/Languages/Java/Q%5F24061148.html (Around bottom of the page) ...

in toplink and struts 2 based application, even after commiting data data disappears from the database

I have a struts 2 application and a toplink persistence provider running on tomcat 6.0.20 and a MySql 5.1.38 server on a GNU/Linux machine. After committing the data the when i go to retrieve it the data it has disappeared from the database. I do a em.commit() and em.flush() after my queries have executed. How do they disappear? I am u...

HTTP Referer header in Struts 2

How can I get the Referer header under Struts2? Right now I'm using an ActionSupport class and I can't seem to get a ServletActionContext object or implement the ServletRequestAware interface? (Where is ServletRequestAware in Struts2? which jar?) I'm trying to set up an automatic redirect to a page's referer, stored in a session variabl...

Adding global error on any field error in struts2

I am using Struts2 and a bunch of Validation with Annotations. How do I add a global error message as well on top of field validation errors. Thanks, Fedor ...

struts2: adding VO objects in a list in action class-iterating list in jsp-getting list object in anothe action class

In my struts 2 application I am iterating list of VO objects in my jsp as follow - <s:iterator value="listOfVoObjects"> <tr> <td><s:property value="itemId" /></td> <td><s:property value="itemName" /></td> </tr> </s:iterator> Now I want to get this “listOfVoObjects” in my action class when user will click some button say 'freeze' and ...

Struts2 + Displaytag: Need to render with paging..

Hi at all.. this is my problem. My JSP need a pagination. Original version is this: <s:iterator value="listSurveyToRender" var="s"> <tr class="surveyTitle"><td><h4><s:property value="descrizione" /></h4></td></tr> <s:iterator value="listSurveyValuesToRender" var="sv" > ...

Custom struts2 tag?

Hi all, I want to write a custom struts2 tag,which has a separate action class for itself, and can be called from different jsp pages. Something like: <s:writetext type="aaa" parentid="xxx" parentname ="yyy" height ="50" width ="125" /> Is it possible? Please help, I'm very new to this and googling about this didn't help. Thanks, A...

struts2 StringTemplate support

I'm looking for a struts2 StringTemplate result type. Given an action result I'd like to render the html using StringTemplate. There are struts2 result types for Velocity, FreeMarker etc but I haven't been able to find one for StringTemplate, Google doesn't help. Has anyone seen such result type? Or perhaps this is something that mysteri...

How do I use an enum parameter in struts 2?

I'm trying to get an Action in Struts 2 to work with an Enum as an input parameter. What I've done so far looks like: public TestAction { public enum Module { VALUE1; } private Module module; public void setModule(Module module) { this.module = module; } public Module getModule() { return module; } } But wh...

Ajax error from Struts2 action

Ive got a struts2 action that is invoked via a jQuery ajax call, I am trying to determine how to trap any exceptions that may be thrown. I am trying to do the following in jQuery call. $.ajax({ type: "POST", url: theUrl, data: theData, success: function (data, textStatus) { // data could be x...

Struts 2 select tag filled by list property

Hi, I am new to struts 2. I am facing problem in filling Select tag with list property. The values are supplied from action class.Please provide me sample sode for this scenario. My action class public class TripDetailsAdd extends ActionSupport { @Override public String execute() throws Exception { return SUCCESS; } ...