RE: Using POSIX Regular Expressions for Internationalized Validation

2008-10-08 Thread Brad A Cupit
From: egetchell [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 08, 2008 11:56 AM > The one thing I noticed is that this escaped > data is not translated back to the character > set when fed into an input field. Perhaps this is an over simplification, but could you just persist the raw, une

RE: Iterate through a Map, OGNL Question about accessing a map with dynamic value [0]

2008-10-09 Thread Brad A Cupit
From: Torsten Krah [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2008 8:27 AM > > > > The below code should work in any JSP that has the Struts 2 tag library imported. It iterates over a Map whose keys are of type List. This code was inspired by [1] <%--

RE: Iterate through a Map, OGNL Question about accessing a map with dynamic value [0]

2008-10-09 Thread Brad A Cupit
From: Torsten Krah [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2008 9:15 AM > Your example does work fine, but its not my usecase, isn't it? Oops, sorry about that. My mistake. I'm assuming the list is a List> and the map is Map, List> if so, try this: <%-- begin setup, for example o

RE: Struts2 startup service/action

2008-10-10 Thread Brad A Cupit
From: dchicks [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2008 1:03 PM > Our experience, so far, has been that it's nearly > impossible to get another servlet to play nice with > Struts, though. You could try Spring's org.springframework.web.context.ContextLoaderListener instead of the Co

RE: Struts2 startup service/action

2008-10-10 Thread Brad A Cupit
David C. Hicks [mailto:[EMAIL PROTECTED] wrote > I'm stuck with version 2.0.3 due to dependencies - I > think because spring-jpa hasn't caught up Looks like spring-jpa has moved to spring-orm in 2.5 org.springframework spring-orm The ContextLoaderListener should work in Spring 2.0.x though. Have

struts 2.1.5 listed on http://struts.apache.org/2.x/

2009-01-05 Thread Brad A Cupit
http://struts.apache.org/2.x/ lists 2.1.5 as the version to download (in the big, blue Download Now 'button'). However, I could find no announcement or vote on any of the struts mailing lists mentioning that 2.1.5 is GA. Is this a bug in the http://struts.apache.org/2.x/ page? Or did Struts 2.1.5

interesting proxy + action chain issue

2008-04-07 Thread Brad A Cupit
Hi! I'm having a very interesting issue with CGLIB proxies. I'm proxying my actions with Spring AOP (to get declarative transactions on each Action). Everything is working great, except when I try action chaining, I get a class cast exception that Action2 can't be cast to Action1 (Action1 is first

RE: interesting proxy + action chain issue

2008-04-07 Thread Brad A Cupit
ve to write those dumb actions. Nice!! Brad Cupit Louisiana State University - UIS -Original Message- From: Brad A Cupit Sent: Monday, April 07, 2008 11:10 AM To: 'user@struts.apache.org' Subject: interesting proxy + action chain issue Hi! I'm having a very interestin

RE: Downloading file rendered in JSP

2008-04-08 Thread Brad A Cupit
To set the download file name, in addition to the "text/csv" mime type (which you already have set), write the following java code in your Action or (if necessary) as Java in your JSP: response.setHeader("Content-disposition", "attachment; filename=" + CSV_FILE_NAME); where CSV_FILE_NAME is the n

RE: interesting proxy + action chain issue

2008-04-08 Thread Brad A Cupit
Louisiana State University - UIS -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Monday, April 07, 2008 8:20 PM To: Struts Users Mailing List Subject: Re: interesting proxy + action chain issue Brad A Cupit wrote: > ServletActionRedirectResult worked when I used it i

RE: Downloading file rendered in JSP

2008-04-08 Thread Brad A Cupit
fine. -Original Message- From: Brad A Cupit [mailto:[EMAIL PROTECTED] Sent: 08 April 2008 14:25 To: Struts Users Mailing List Subject: RE: Downloading file rendered in JSP To set the download file name, in addition to the "text/csv" mime type (which you already have set), writ

RE: date conversion

2008-04-08 Thread Brad A Cupit
JSTL has the tag. If you want to do it in Java, rather than your JSP, you can use SimpleDateFormat. Be aware that SimpleDataFormat is not thread safe, so don't assign it to a static field or use it in a singleton. If you use it as an instance field on an Action you'll be safe, since Actions ar

RE: date conversion

2008-04-09 Thread Brad A Cupit
he current request" according to the type conversion >>> >> docs, >>>> >>> so yes, you'll need to do your own if you're using a different input >>> >> format. >>>> >>> Looking through the XWork conversion code it&

RE: date conversion

2008-04-09 Thread Brad A Cupit
(within the method) to avoid non-thread safe operations (guaranteed by the jvm spec). Brad A Cupit wrote: > the static SimpleDateFormat (assuming this code is in an S2 Action that > is instantiated per request) is not thread safe. > > http://java.sun.com/javase/6/docs/api/java/text/S

RE: interesting proxy + action chain issue

2008-04-10 Thread Brad A Cupit
The only problem with the scope plugin is that it will use the session, which may break the whole notion of POST-redirect-GET: if the data in the session is removed or replaced by later requests, then pressing the back or refresh buttons on the initial page with errors will not yield the same respo

RE: interesting proxy + action chain issue

2008-04-10 Thread Brad A Cupit
ms/struts_2_cookbook/post_and_redirect I've used this for a while with good results, although recently I've stumbled on WW-2170 ( https://issues.apache.org/struts/browse/WW-2170 ). It seems to occur only when using annotations though. Cheers, GB Brad A Cupit wrote: > > The only prob

RE: [OT] UML and Reverse Engineering

2008-04-11 Thread Brad A Cupit
it won't go from bytecode to UML but I've used JAD (and JadClipse) to go from bytecode to Java: http://www.kpdus.com/jad.html http://jadclipse.sourceforge.net/ As far as UML is concerned, I saw this non-free tool yesterday, which looked pretty interesting (especially the roundtrip feature): http:

RE: Scheduled DB clean up service with Struts2

2008-04-11 Thread Brad A Cupit
the @Resource annotation is included in Java SE 6. If you can't move to Java 6 and have to use Java 5, the annotation can be found in common-annotations.jar (note that a Java EE 5 app can still run in the Java SE 6 JRE) as per the DB clean up service, if you're using Spring for DI you could proba

RE: interesting proxy + action chain issue

2008-04-11 Thread Brad A Cupit
. That's where something like flash scope would be useful and is unfortunately lacking in 2.0. Cheers, GB Brad A Cupit wrote: > > Hi Guillaume, > yep, I'm familiar with the ServletActionRedirectResult, and I'm > especially familiar with bug you mentioned (you and I bo

RE: Does Struts 2 support clustering?

2008-04-11 Thread Brad A Cupit
>> Would it not be perhaps safer and more efficient (and reduce the >> possibility of clustered session replication issues) to simply >> get the session yourself and set the >> attributes directly into it? the Map passed in when you implement SessionAware is just a wrapper around the real session.

RE: [S2] Spring: Interceptors, prototype or singleton?

2008-04-14 Thread Brad A Cupit
wow that was a terrific explanation. Thanks Don! [note: I was not the original poster] Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Don Brown [mailto:[EMAIL PROTECTED] Sent: Monday, April 14, 2008 10:13 AM To: Struts

RE: Is there such a thing as flash in S2?

2008-04-15 Thread Brad A Cupit
link to the webwork Flash result Ian mentioned: http://wiki.opensymphony.com/display/WW/Flash+Result Brad Cupit Louisiana State University - UIS -Original Message- From: Ian Roughley [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 15, 2008 8:39 AM To: Struts Users Mailing List Subject: Re

RE: ServletRedirectActionResult - is there a way to set parameters?

2008-04-16 Thread Brad A Cupit
> I need to tag along a request paramter. So my annotation looks > like this: > > @Result(name="enterNewContactInfo",value="enterNewContactInfo", > type=ServletActionRedirectResult.class,params={"country","AUT"}) > > I get a nasty NPE if I add the params. If I remove it everything works fine.

RE: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Brad A Cupit
>> You can declare your different interceptor stacks in different >> packages and then declare the parent package on the action like >> this: >> @ParentPackage("packageWithEmptyStack") >> public class FooAction ... Guillaume is right. In 2.0.x when Actions are auto-discovered (via the actionPacka

RE: Is there such a thing as flash in S2?

2008-04-17 Thread Brad A Cupit
>> What would be great is if an interceptor would inject all >> properties that are shared by the previous and the current >> action (by name? by type?) in the current action, in a similar >> fashion to HTTP parameter injection. If you use an ActionChainResult it will automatically do this, but ac

return Result instantiated within Action

2008-04-17 Thread Brad A Cupit
[creating a new thread so as not to hijack the "ServletRedirectActionResult - is there a way to set parameters?" thread] Don Brown said: >> The easiest solution is to simply return a >> ServletActionRedirectResult instance from >> your action method. I've tried that myself as it seemed a very cle

RE: return Result instantiated within Action

2008-04-17 Thread Brad A Cupit
>> Ah, good point. Yes, please file this as a request, as it >> should be pretty easy to do and would make things much easier. done, thanks! automatically set ActionMapper for ServletRedirectResult https://issues.apache.org/struts/browse/WW-2598 Brad Cupit Louisiana State University - UIS

RE: Is there such a thing as flash in S2?

2008-04-17 Thread Brad A Cupit
>> This hypothetical flash result could list the properties >> that should survive the redirect >> >> I'll investigate writing such a result / interceptor pair. Wouldn't that be the same as the ServletActionRedirectResult, where param values can be ognl expressions? (assuming a version of strut

RE: Converting action configuration from 2.0 to 2.1 - how to convert parameters to actions

2008-04-18 Thread Brad A Cupit
>> I'm wondering if this is related to the CGLIB issue. Hrm...he's using the redirectAction which has been immune to the CGLIB issue (assuming we're talking about the same issue). The 'chain' result is prone to the CGLIB problem. Having said that, I haven't used Struts 2.1.x at all. The exception

RE: how to use xwork-2.1.1.jar with struts 2.0.11.1

2008-04-23 Thread Brad A Cupit
>> I downloaded and installed struts 2.0.11.1. I noticed it >> still uses xwork-2.0.4.jar. Maybe you meant to download Struts 2.1.1? http://people.apache.org/repo/m2-snapshot-repository/org/apache/struts/s truts2-core/ Struts 2.1.1 comes with xwork 2.1.1 out-of-the-box. note: Struts 2.1.x has n

RE: Two problems: Struts2 + https + file load and Struts2 + file load + java.lang.IllegalStateException: getOutputStream()

2008-04-24 Thread Brad A Cupit
>> And it is strange because it happens only when I use https and >> IE6. When it is http and IE6 it seems to be fine. these links may help: http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with -internet-explorer/ http://forum.java.sun.com/thread.jspa?threadID=233446&forumID=4

RE: Struts2.1: Is Validation Annotations on Nested Objects Supported?

2008-04-25 Thread Brad A Cupit
Jeromy Evans wrote: > by nature of the way proxies are created, the don't carry > the method annotations of the proxied implementation. This is true, the methods on the proxy will not be annotated, but Struts 2 does search super classes for those annotations. Since proxies generated by CGLIB e

RE: Building First strut

2008-04-25 Thread Brad A Cupit
Vinay Nagrik wrote: > I am using struts2.0.11.1. > I am thoroughly confused about the configuration and where goes what. you could also download the example applications and see how things are laid out: http://struts.apache.org/download.cgi#struts20111 This won't necessarily work out of the box w

RE: Building First strut

2008-04-25 Thread Brad A Cupit
Vinay Nagrik wrote: > I started my download from the link you provided. And that > link does not give any info. this is the direct link to the Blank war file: http://www.devlib.org/apache/struts/examples/struts2-blank-2.0.11.war you can put that in your web server (like Tomcat) and run it. war

RE: Best way to access Session with regards to cluster

2008-04-30 Thread Brad A Cupit
> but I still have some confusion about the proper way to do > this so that my session values will be available and > replicated properly in a cluster environment. The Struts 2 session maps are actually just wrappers around the real underlying session. The methods that return (or set) a HttpServle

RE: Redirect-Action type result warns of caught exception when passing param

2008-04-30 Thread Brad A Cupit
> I'm of the opinion that an exception in my > console means something is amiss though... you've stumbled upon a little wart in the code. First things first, the exception is harmless and can be safely ignored. A more detailed explanation can be found in a comment within ObjectFactory.buildResult

RE: Best way to access Session with regards to cluster

2008-04-30 Thread Brad A Cupit
> The latter assuming you are implementing > StrutsStatics in the interceptor. or using Java 5's static imports :-) Brad Cupit Louisiana State University - UIS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: Paging with DisplayTag and encoded table name

2008-05-01 Thread Brad A Cupit
> I'm curious if there is a neat way to have the page > parameter mapped onto action or something alike You should be able to put a setter on the Action. So, if your url parameter is named pageNum, your action would have a setPageNum() method. Brad Cupit Louisiana State University - UIS

simple struts tag to eval OGNL

2008-06-18 Thread Brad A Cupit
Hi, is there a simple tag I can use to just evaluate some OGNL? For example, if I have the following line in a JSP it's kind of clunky: does anyone know of a more elegant way? Brad Cupit Louisiana State University - UIS - To

RE: simple struts tag to eval OGNL

2008-06-18 Thread Brad A Cupit
t;true", you can add debug=console to your URL and you will get an OGNL console. musachy On Wed, Jun 18, 2008 at 1:32 PM, Brad A Cupit <[EMAIL PROTECTED]> wrote: > Hi, is there a simple tag I can use to just evaluate some OGNL? For > example, if I have the following line in a JSP

RE: simple struts tag to eval OGNL

2008-06-18 Thread Brad A Cupit
Lukasz Lenart wrote: > what I’m really trying to do is have nice integration between s:select and enums. I want a select box with each of the enum choices in it. For this to work, I'd need the enum name as the key in a map, and a user-friendly-string-representation of the enum as the value. I

RE: simple struts tag to eval OGNL

2008-06-18 Thread Brad A Cupit
Lukasz Lenart wrote: > I'm using something like this: > > list="employeeTypes" listKey="shortcut" > listValue="name()" required="true"/> Oh wonderful! I didn't know that’s what listKey and listValue were for. I was able to take my four lines of JSP and convert them into just

RE: Struts 2: Providing Tiles Controller-like Functionality

2008-06-23 Thread Brad A Cupit
Asleson, Ryan wrote: > I'm familiar with the Struts 2 Preparable interface, but I don't > like this because prepare() is always called -- even on form posts Do you have one Action with two public methods that are called by Struts 2? For example view() and submit() methods? If that's the case, I ca

RE: Struts 2: Providing Tiles Controller-like Functionality

2008-06-24 Thread Brad A Cupit
Asleson, Ryan wrote: > I've thought about writing a PreResultListener > I've tried ActionInvocation.getResult(), but it only returns null. > Is there a way to get the current Result object before it is > actually executed? Looking at the code for DefaultActionInvocation, it seems that createResul

RE: Grabbing the "current" Result

2008-06-24 Thread Brad A Cupit
> I want to write an PreResultListener that checks the current > Result and performs actions based on the Result. I see that > the ActionInvocation that's passed into the beforeResult > method has a getResult() method, but when I tried this, the > result of the getResult() method is null. just fo

use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
I have an object that I need to access in a JSP, and the object has a getter on my Action. When the page is initially viewed the object is retrieved off the Value Stack, but if the user is redirected back to the page (due to validation errors) the value comes from the session. When using EL things

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Musachy Barroso wrote: > "#attr" does something similar: right, but it's kind of yucky in the sense that each of these objects needs a block like this: and then I change use of it from: to: I can live with that, but it seems like a step backward. JSP EL could automatically look

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Musachy Barroso wrote: > "#attr" does something similar: oh wow! you gave me the answer and I didn't read it! I incorrectly assumed you were using attr to refer to a property on the value stack. I should have followed the link instead of being arrogant. Sorry! Thanks for the answer Musachy! That

RE: use OGNL to automatically look in the session?

2008-06-24 Thread Brad A Cupit
Chris Pratt wrote: > #attr doesn't sound like it will work in your case since > it only searches the old four scopes, and never searches > the value stack. After I figured out that Musachy had given me the right answer (and Martin also gave the right answer), I was a little worried that this would

RE: use OGNL to automatically look in the session?

2008-06-25 Thread Brad A Cupit
Brad Cupit wrote: > I'm not sure which order the scopes are checked For anyone who's interested, #attr appears to check scopes in the following order: 1. page / action * 2. request 3. value stack 4. session 5. application * I used to set one value at page scope and one at action scope, and whic

RE: Struts2 + applicationContext.xml

2008-06-30 Thread Brad A Cupit
Lukasz Lenart wrote: > Exactly, first, Struts (default object factory) will > create action object and then it will *ask* Spring > to inject depended beans, base on applicationConfig.xml. > I'm just wondering, if there any drawbacks for this? The only one I can think of is that your actions wouldn

ActionSupport.input()-- what's it for?

2008-07-15 Thread Brad A Cupit
Hi, Anybody know what the input() method on ActionSupport is for? It doesn't seem to be defined by any interfaces. I was hoping that it was called whenever there was a validation error, but that doesn't seem to be the case. Here's the method definition: public String input() throws Exception {

RE: ActionSupport.input()-- what's it for?

2008-07-16 Thread Brad A Cupit
Tuesday, July 15, 2008 4:52 PM, Dave Newton wrote: > It's the default implementation of a method designed for form > input; validation is skipped by default. > When you have an action implementing Prepareable it's a > convenience, before annotation-based configuration you'd > configure two action

RE: RE: ActionSupport.input()-- what's it for?

2008-07-16 Thread Brad A Cupit
> No, you'd go to form display via input(), and submit to > execute(). Oh that makes perfect sense! Got it now. > the input() method always skipped validation That makes sense too. The input method is listed in struts-default.xml as an excludeMethod for the validation interceptor. >> Even then

RE: S2: Multiple unknown handlers?

2008-07-21 Thread Brad A Cupit
On Sat, Jul 19, 2008 at 9:52 PM, Paul Benedict <[EMAIL PROTECTED]> wrote: > Using Struts 2.0.x, is it possible to have multiple unknown handlers? I am > using the Codebehind plugin and want to extend it. On Sat, Jul 19, 2008 at 11:41 PM, Musachy Barroso <[EMAIL PROTECTED]> wrote: > You will need t

RE: namespace headpain

2008-07-24 Thread Brad A Cupit
on Wednesday, July 23, 2008 3:22 AM, Lyallex [mailto:[EMAIL PROTECTED] wrote: > > > > ">Create New > Establishment > (absolutely no idea why this works) I seem to remember that there is a difference between and If the namespace is omitted, S2 puts it in the "default namespace" [1] which b

RE: [S2] problem still with "actionRedirect" and "redirect" results (Struts2.1.2)

2008-08-01 Thread Brad A Cupit
Pierre Thibaudeau [mailto:[EMAIL PROTECTED] wrote: > The JIRA tracker lists the following issues: > https://issues.apache.org/struts/browse/WW-1714 > as fixed in version 2.0.8, but it certainly doesn't work in 2.1.2. have you tried Struts 2.0.11.2? You may already know it, but Struts 2.1.2 is stil

RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found

2008-08-04 Thread Brad A Cupit
I can't say that I see the problem, but I do see a few small issues. > class="uk.co.prodia.prosoc.struts2.action.ActionUpdateEmail"> > > be sure to add scope="prototype". S2 actions are per-request (since they have getters and setters with request specific information being set on the

RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found

2008-08-04 Thread Brad A Cupit
> I have tried setting the scope="prototype" but it > didn't change the error I am seeing. right, that makes sense. This setting will stop you from having big problems later on though. > I am unsure what could be causing this but maybe someone could > clarify that the: > > com.opensymphony.xwork

RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found

2008-08-04 Thread Brad A Cupit
kage name attribute is called "spring-default" and extends "struts-default". Would you expect that to mean that my package should be extending the "spring-default" rather than "struts-default"? I have tried it and it made no difference; it was just an oddity I n

RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found

2008-08-05 Thread Brad A Cupit
I noticed that you have this: > >contextConfigLocation >/WEB-INF/applicationContext-security.xml > but the prosoc-spring-beans.xml is not listed, so Spring won't know to pick it up. I did see that prosoc-spring-beans.xml was listed as an init-param to the uk.co.prodia.prosoc.Config serv

RE: Struts2 and spring plugin - Action class [springManagedProsocActionUpdateEmail] not found

2008-08-05 Thread Brad A Cupit
on August 05, 2008 8:14 AM, doahh <[EMAIL PROTECTED]> wrote: > I didn't see your reply before I sent my last post. > > You were absolutely correct and I must say that, looking > through that mass of config, well spotted. > > Thanks for your help Bard. Terrific!!! Brad Cupit Louisiana State Unive

RE: OGNL Help

2008-08-06 Thread Brad A Cupit
Zoran Avtarovski <[EMAIL PROTECTED]> wrote: > reflection has a heavy performance > penalty and from what I've seen of OGNL Just a quick side note, with modern JVMs (1.4 and later) the reflection penalty is significantly reduced. IMHO, reflection is quite fast. And OGNL uses reflection internally

chain interceptor

2008-08-12 Thread Brad A Cupit
I have a question about the placement of the chain interceptor in the defaultStack. Take the following situation: * preferredUserId is a form field submitted by the user. It is the user id they want (if that user id is not already taken) * Action1 has a setPreferredUserId() method but if the use