RE: Unit Testing Advice

2008-11-07 Thread Gundersen, Richard
PROTECTED] Sent: Friday, November 07, 2008 11:08 AM To: Struts Users Mailing List Subject: Re: Unit Testing Advice Is this what you're looking for? http://svn.opensymphony.com/svn/xwork/tags/xwork_2_0_6/ Nils-H On Fri, Nov 7, 2008 at 12:02 PM, Gundersen, Richard <[EMAIL PROTECTED]> w

RE: Unit Testing Advice

2008-11-07 Thread Gundersen, Richard
rly. Could anyone point me in the direction of the Xwork source used to build Struts 2.0.12 please? Thanks. Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From

RE: Programming help for a "print" function

2008-11-06 Thread Gundersen, Richard
I've just done the same thing - although it's nothing to do with Struts var a = window.open('','','width=500,height=400'); a.document.open("text/html"); a.document.write(document.getElementById('receipt').innerHTML); a.document.close(); a.print(); a.close();

RE: Unit Testing Advice

2008-11-06 Thread Gundersen, Richard
Hi I just have one smallish question: for some reason my messages.properties isn't being loaded. It's configured in struts.xml ...and I know that file is generally working because all the other Struts stuff is working. I'm getting this when my unit test runs (just at the point when it tries to

RE: Unit Testing Advice

2008-11-06 Thread Gundersen, Richard
ble though... Nils-H On Thu, Nov 6, 2008 at 1:53 PM, Gundersen, Richard <[EMAIL PROTECTED]> wrote: > This is what I have so far. It works but I would appreciate a little > peer review (particularly regarding how I set up my session and the > l

RE: Unit Testing Advice

2008-11-06 Thread Gundersen, Richard
This is what I have so far. It works but I would appreciate a little peer review (particularly regarding how I set up my session and the logged in user) Thanks! @Resource private CardPaymentAction cardPaymentAction; ActionContext acti

Unit Testing Advice

2008-11-06 Thread Gundersen, Richard
Hi Just after a bit of advice for the best way to unit test my Struts 2 app. I'm using a fairly standard Spring/Struts2/JPA/Junit architecture, and my tests need access to all my spring beans (which I'm doing using @Resource tags) The only sticking point is setting up all of the fake 'request' a

RE: Which is Best book for Struts 1.2.9??

2008-10-29 Thread Gundersen, Richard
If you're starting from scratch, why not use Struts 2 instead? I used 'Practical Struts 2: Web 2.0 Projects' by Ian Roughly (who wrote a lot of Struts 2 I think??) to get to grips with the basics. It's easy to read and flows nicely, building an app step by step (as opposed to the Spring docs whic

RE: Custom Exception Interceptor

2008-10-29 Thread Gundersen, Richard
: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Gundersen, Richard [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2008 11:18 AM To: Struts Users Mailing List Subject: Custom Exception Interceptor Hi I'm tryi

Custom Exception Interceptor

2008-10-29 Thread Gundersen, Richard
Hi I'm trying to override the default global exception handler, because I need to remove a certain session attribute when an exception occurs. I think I've done most of what's needed, it's just not being executed. This is my struts.xml (I need my 'exception' to replace the one in the default stac

RE: losing jsessionid in a cluster

2008-10-28 Thread Gundersen, Richard
u balance your request between your tomcat servers? Do you use apache with mod_proxy, or mod_jk maybe or anything else? I had problems while using such architecture because of the way that tomcat build url from values present in the http header. Regards Sébastien Gundersen, Richard a écrit : &g

losing jsessionid in a cluster

2008-10-28 Thread Gundersen, Richard
Hi I'm using URL rewriting (I can't use session cookies for certain reasons). In my code, I have this: Locally, this generates my URL perfectly - preserving the jsessionid - like this: https://localhost/Payment/acsResponse.action;jsessionid=12DEE30A8983DF3D 151D However on our clustered prod

RE: Detect errors in OGNL

2008-10-15 Thread Gundersen, Richard
Doh, got it %{errors.size} Silly me :) Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Gundersen, Richard [mailto:[EMAIL PROTECTED] Sent

Detect errors in OGNL

2008-10-15 Thread Gundersen, Richard
Hi Is there an easy way to say 'if validation errors exist', in OGNL? Tried a few things but not hit on the right syntax yet e.g. if %{errorFieldNames.size() > 0} etc etc Thanks Richard Gundersen As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environme

RE: RegexFieldValidator

2008-10-07 Thread Gundersen, Richard
: Gundersen, Richard [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2008 11:09 AM To: Struts Users Mailing List Subject: RegexFieldValidator Sorry, basic question but my RegexFieldValidator isn't working quite as I thought it would. I just want to be able to specify a decimal point,

RegexFieldValidator

2008-10-07 Thread Gundersen, Richard
Sorry, basic question but my RegexFieldValidator isn't working quite as I thought it would. I just want to be able to specify a decimal point, so I escape the dot, but the compiler complains. Could someone tell me how to specify 12345.67 as a regex for this? ^[0-9]{1,5}\.[0-9]{2}$ (does

VisitorFieldValidator - different validation scenarios

2008-09-19 Thread Gundersen, Richard
Hi I'm using the VisitorFieldValidator (annotations) to push validation over to my model object in my Action. However, I want the validation rules in my model object to work differently depending on which Action method is being called. What's the best way of doing this please? Richard Gunderse

RE: Validation based on other fields

2008-09-04 Thread Gundersen, Richard
Cheers Dave, I'll check it out in the morning Appreciate you help -Richard -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thu 04/09/2008 17:14 To: Struts Users Mailing List Subject: Re: Validation based on other fields --- On Thu, 9/4/08, Gundersen, Ri

Validation based on other fields

2008-09-04 Thread Gundersen, Richard
Hi In Struts 2, I need to perform some validation based on other fields e.g. if cardType = 'Switch', issueNumber is mandatory I was looking for something like the validWhen tag from Struts 1. I'd like to do it with the client side javascript if possible (to prevent having to reload the

RE: Base64 & Newlines

2008-09-02 Thread Gundersen, Richard
8 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2008 9:18 AM To: Struts Users Mailing List Subject: Re: Base64 & Newlines 2008/9/2 Gundersen, Richard <[EMA

Base64 & Newlines

2008-09-02 Thread Gundersen, Richard
Hi I'm stuggling a bit with a parameter I need to pass through to a JSP in a frame. It's a base64-encoded string, so I thought I'd be able to just pass it through as a request parameter, but I found out it contains newline chars every 64 characters (which I read is correct), so any JavaScript I

RE: Credit card validator

2008-08-27 Thread Gundersen, Richard
Sent: Wednesday, August 27, 2008 3:47 PM To: Struts Users Mailing List Subject: Re: Credit card validator Don't know if it helps you, but Hibernate Validator has a credit card validator. It will work with JPA providers other than just Hibernate. On Thu, Aug 21, 2008 at 10:39 AM, Gundersen, Richa

Invalidating session

2008-08-27 Thread Gundersen, Richard
Hi all I came across this page for invalidating the session http://struts.apache.org/2.0.11.2/docs/how-do-we-get-invalidate-the-sess ion.html It mentions this way of invalidating the session: if (session instanceof org.apache.struts2.dispatcher.SessionMap) { ((org.

RE: Credit card validator

2008-08-21 Thread Gundersen, Richard
unt Street Manchester M2 3LS -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2008 3:17 PM To: Struts Users Mailing List Subject: Re: Credit card validator --- On Thu, 8/21/08, Gundersen, Richard wrote: > can someone tell me if there's a credit

Credit card validator

2008-08-21 Thread Gundersen, Richard
Sorry if I'm missing something obvious, but can someone tell me if there's a credit card validator in Struts 2? There's one in Struts 1, and in Struts 2 I found creditCard.js, which uses the Luhn algorithm, but I cant figure out a) how to use it or b) if there is a corresponding annotation for ser

RE: 2 Validation questions

2008-08-06 Thread Gundersen, Richard
, August 06, 2008 8:28 AM To: Struts Users Mailing List Subject: Re: 2 Validation questions Gundersen, Richard wrote: > Hi > > Basic question sorry (looked all over but can't find the answer) > > 1) When validation fails for my 'username' textfield, the error message

RE: 2 Validation Questions

2008-08-05 Thread Gundersen, Richard
textfield tag too. 2) IIRC, this javascript validation bug was resolved in the 2.1.x branch. 2008/8/5 Gundersen, Richard <[EMAIL PROTECTED]>: > Would really appreciate any help with the following (sent yesterday). > Just a pointer to some good docs wo

2 Validation Questions

2008-08-05 Thread Gundersen, Richard
Would really appreciate any help with the following (sent yesterday). Just a pointer to some good docs would be great - Basic question sorry (looked all over but can't find the answer) 1) When validation fails for my 'username' textfield, the error message is

2 Validation questions

2008-08-04 Thread Gundersen, Richard
Hi Basic question sorry (looked all over but can't find the answer) 1) When validation fails for my 'username' textfield, the error message is displayed ABOVE the text box. Is it possible to have more fine-grained control over how to position the error message. Ideally I would like it below (an

RE: Re: Wierd Validation

2008-07-31 Thread Gundersen, Richard
536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, July 30, 2008 10:18 PM To: user@struts.apache.org Subject: Re: Wierd Validation Gundersen, Richard wrote: > Hi > >

Wierd Validation

2008-07-30 Thread Gundersen, Richard
Hi When validation succeeds on my form, I still get returned to the input page. My execute() method does not seem to be getting called even when validation is OK. This is my Action (no @Validation annotation after I read that was deprecated)

RE: dynamic forwarding from Action class to any url

2007-09-07 Thread Gundersen, Richard
I do it this way (create a new ActionForward with the url you want in the Action method you are executing, and just return that instead of doing mapping.findForward... ActionForward forward = new ActionForward(url); return forward; Richard Gundersen

RE: Requiredif validator

2007-09-07 Thread Gundersen, Richard
Hi Pablo Try using validwhen instead - I think rewquiredif was deprecated. I changed all mine and you can achive the same thing although your logic might have to be turned around a bit. Here's an example:

Quick question about getParameterValues

2007-09-06 Thread Gundersen, Richard
Hi I was wondering if I can rely on the order of the values returned by request.getParameterValues()? In my form I have a checkbox, and then underneath I have a hidden field with the same name. I do this in case the checkbox is unchecked (and hence the value would not be sent). This way I always

RE: DownloadAction and a normal Forward

2007-08-02 Thread Gundersen, Richard
t;JavaScript, DOM Scripting and Ajax Projects" >> (2007, Apress, ISBN 1-59059-816-4) >> Java Web Parts - http://javawebparts.sourceforge.net >> Supplying the wheel, so you don't have to reinvent it! >> >> On Wed, August 1, 2007 10:38 am, Gundersen, Richard wrote:

RE: DownloadAction and a normal Forward

2007-08-01 Thread Gundersen, Richard
Ajax Projects With Java Technology" (2006, Apress, ISBN 1-59059-695-1) and "JavaScript, DOM Scripting and Ajax Projects" (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed,

DownloadAction and a normal Forward

2007-08-01 Thread Gundersen, Richard
Hi I'm using a DownloadAction to generate a PDF and return it the the browser. If there is a problem generating the PDF however, I want to redirect the user to a specific JSP. What's the best way of doing this? At the moment I am using protected StreamInfo getStreamInfo(ActionMapping mapping,

RE: Re: DynaValidatorForm and BigDecimal problem

2007-03-02 Thread Gundersen, Richard
r types in 'abc' for one of your money fields, you wont be able to re-display their incorrect input. That's the other major reason for making your form fields String-typed. L. Gundersen, Richard wrote: > Actually, I tried out your first solution, and it actually works very >

RE: DynaValidatorForm and BigDecimal problem

2007-03-01 Thread Gundersen, Richard
s. -ed On 3/1/07, Gundersen, Richard <[EMAIL PROTECTED]> wrote: > Hi > > Has anyone had problems with BigDecimal and DynaValidatorForms? > > I've got a form with two fields (advisorFee and grossIncome) defined as > java.lang.Double. I want to change them to java.mat

RE: DynaValidatorForm and BigDecimal problem

2007-03-01 Thread Gundersen, Richard
this populated by your action after validation succeeds. -ed On 3/1/07, Gundersen, Richard <[EMAIL PROTECTED]> wrote: > Hi > > Has anyone had problems with BigDecimal and DynaValidatorForms? > > I've got a form with two fields (advisorFee and grossIncome) defined as >

DynaValidatorForm and BigDecimal problem

2007-03-01 Thread Gundersen, Richard
Hi Has anyone had problems with BigDecimal and DynaValidatorForms? I've got a form with two fields (advisorFee and grossIncome) defined as java.lang.Double. I want to change them to java.math.BigDecimal because they are money fields. If I change advisorFee to BigDecimal, the validation fails wh

RE: OFF RECORD

2006-12-21 Thread Gundersen, Richard
Um, this might be wrong but I think you could open a connection using URLConnection (or similar), and hit the JSP URL that way. That should return a response (containing the HTML source) that you can then use for whatever you want. Not tried it though so I could be talking rubbish. Richard ---

RE: Brackets in validation.xml

2006-12-12 Thread Gundersen, Richard
, Gundersen, Richard wrote: > Can anyone please tell me why this works. It's two versions of a > validation rule from my commons validator xml file (for a validwhen > condition): The parser that the validation package uses cannot parse expressions of the form "A or B or C&quo

RE: Brackets in validation.xml

2006-12-12 Thread Gundersen, Richard
parentheses is it?! ;-) Cheers Richard -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 12, 2006 2:55 PM To: Struts Users Mailing List Subject: Re: Brackets in validation.xml -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Richard, Gundersen

Brackets in validation.xml

2006-12-12 Thread Gundersen, Richard
Hi Can anyone please tell me why this works. It's two versions of a validation rule from my commons validator xml file (for a validwhen condition): ( ( (oldProductStatusId == 21) and ((productStatusId == 21) or (productStatusId == 23) ) ) or ( (oldProductStatusId == 23) and ((produc

RE: Re: Map backed properties

2006-12-06 Thread Gundersen, Richard
ax Paul provided? L. Gundersen, Richard wrote: > Hi > > Thanks for replying. I have tried that actually and it didn't work. In > fact that particular example wont work for me unfortunately because my > property isn't part of a map inside a DynaActionForm - it's just

RE: Formatting numbers in text field

2006-12-05 Thread Gundersen, Richard
If you are using an ActionForm, you could modify your getter to do the formatting. Or, have an additional getter method e.g. Double amount; Double getAmount() { // bog standard method } String getFormattedAmount() { // do some formatting } Then, in the form, do something like

RE: Map backed properties

2006-12-05 Thread Gundersen, Richard
rd -Original Message- From: Strachan, Paul [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 11:23 PM To: Struts Users Mailing List Subject: RE: Map backed properties try something like: ... -Original Message- From: Gundersen, Richard [mailto:[EMAIL PROTECTED] Sent: Mond

RE: tiles: error

2006-12-04 Thread Gundersen, Richard
It could be that you have an error INSIDE the tile JSP. Are you doing anything that could result in a null pointer? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya Sent: Monday, December 04, 2006 4:01 PM To: user@struts.apache.org Subject: tiles: error please wha

RE: [OT] Did JIRA copy from LucasArts?

2006-12-04 Thread Gundersen, Richard
Forget about the logo and help me with my Map-backed property problem - I'm desperate! Only kidding! ;-)) -Original Message- From: Romu [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 2:14 PM To: Struts Users Mailing List Subject: Re: [OT] Did JIRA copy from LucasArts? similar

Map backed properties

2006-12-04 Thread Gundersen, Richard
Hi I've been happily working with map based properties in my forms for a while now, but I've come across something that I really can't figure out. I started off with a DynaValidatorForm, and in the mapping, I had this: I was able to use this nicely, by populating it in the action

RE: Date validation

2006-11-22 Thread Gundersen, Richard
This is how I do it: dateFormat dd/MM/ ... ... ... datePattern ${dateFormat} -Original Message- From: vacak [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 22, 2006 10:41 AM To: user@struts.apache.org Subject: Date validation Hi, I use

Map-Backed ActionForm without using scriptlets

2006-11-21 Thread Gundersen, Richard
Hi Is there a clean way to use map-backed ActionForms in a JSP without using scriptlets? Say I have a map of properties called 'userAttributes' in my ActionForm. I want to loop through these using something like a , and then for each one I find, I want to display an tag. The Struts tutori

RE: session maintenance in struts webapp

2006-11-21 Thread Gundersen, Richard
Maybe you could have a bit of JavaScript in a tile or other include that's in all your pages. Whenever a page loads, the session idle time will be reset automatically, so you will have seconds before it expires. In the JavaScript, you could just do a simple loop that counts down from zero. W

RE: Logging to db

2006-11-21 Thread Gundersen, Richard
Log4j provides this functionality Look at the docs for these two classes org.apache.log4j.jdbcplus.JDBCLogger; org.apache.log4j.jdbcplus.JDBCSqlHandler; I've implemented it here, and it works great. Richard -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED