Re: Just a stab in the dark

2011-03-14 Thread Adam Hardy
Matt Meola on 14/03/11 00:04, wrote: On 03/12/2011 05:57 AM, Adam Hardy wrote: Hi List this is a bit OT but it's the weekend and I have a question which I am desperate to answer and my googling skills are no match for it. Does anyone know where I can get a Java implementation of scanf? Does

Re: [OT] Re: Just a stab in the dark

2011-03-14 Thread Adam Hardy
scanf functionality and an underlying implementation; a micro-DSL, more or less. Dave On Mon, Mar 14, 2011 at 7:15 AM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: Matt Meola on 14/03/11 00:04, wrote: On 03/12/2011 05:57 AM, Adam Hardy wrote: Hi List this is a bit OT but it's the weekend

Re: Just a stab in the dark

2011-03-14 Thread Adam Hardy
Martin Gainty on 14/03/11 11:25, wrote: this is a bit OT but it's the weekend and I have a question which I am desperate to answer and my googling skills are no match for it. Does anyone know where I can get a Java implementation of scanf? Does java.text.MessageFormat.parse() perhaps meet at

Re: Just a stab in the dark

2011-03-13 Thread Adam Hardy
I actually hoped I would find it in commons lang already - I was only asking on the struts list because I know the user list here is so much more diverse and would more likely know if it existed already somewhere. Do you Maurizio already have a scanf implementation? Or am I misinterpreting

Re: Just a stab in the dark

2011-03-13 Thread Adam Hardy
Marting thought so :). Adam, again, why do you prefer scanf to scanner? On 13 March 2011 15:53, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: I actually hoped I would find it in commons lang already - I was only asking on the struts list because I know the user list here is so much more

Just a stab in the dark

2011-03-12 Thread Adam Hardy
Hi List this is a bit OT but it's the weekend and I have a question which I am desperate to answer and my googling skills are no match for it. Does anyone know where I can get a Java implementation of scanf? I want to do C-style scanf and read a string into a list of parameters - the exact

Re: Redirect After Post

2009-04-15 Thread Adam Hardy
I thought this pattern was called Post-Redirect-Get (PRG)? Strange that it's name has morphed into something else. You implement it using 'redirect' result types. Check them out in the struts user guide. Manoj Dhore on 15/04/09 15:42, wrote: Have a lot at this:

Re: post-redirect-get in Firefox

2009-04-01 Thread Adam Hardy
and does another redirect and another confirmation status saved. Strange one. A firefox bug probably. I'm going to upgrade to FF3 soon so I'll find out if the issue has been resolved. Regards Adam Adam Hardy on 31/03/09 12:18, wrote: GET HTTP 302 according to httpheaders It looks fine

Re: post-redirect-get in Firefox

2009-03-31 Thread Adam Hardy
GET HTTP 302 according to httpheaders It looks fine and should be fine, assuming the struts2 redirect resulttype is OK. But somehow firefox seems to be too clever and appears to be breaking the standard browser contract to replace the POST with the GET To confuse me more, it is only doing

post-redirect-get in Firefox

2009-03-30 Thread Adam Hardy
I think this is likely to be nothing to do with struts but rather with firefox, however trawling the net for firefox info on the subject hasn't yielded anything interesting. I noticed a while back that my redirects are not replacing the history in the browser - firefox in particular, but

Re: OGNL ClassCastException

2009-02-16 Thread Adam Hardy
, Feb 15, 2009 at 7:14 PM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: Correct me if I'm wrong but this looks like a fundamental class mismatch. I can see in struts-default.xml that both Sets and Collections are configured to be accessed by the same PropertyAccessor. From debugging, I can see

Re: OGNL ClassCastException

2009-02-16 Thread Adam Hardy
struts jar with modified source. Adam Hardy on 16/02/09 09:40, wrote: I use Sets too and they're not the problem here. The reason why this bug occurs is because the proxy that is returned by my entity bean is not recognised as an ArrayList by OGNL. Rather OGNL sees it as a Collection. I guess

Re: OGNL and OpenJPA proxies

2009-02-16 Thread Adam Hardy
of enhancing OpenJPA entities which I'll try if time allows. Musachy Barroso on 16/02/09 14:58, wrote: If you can create an xwork ticket and attach a patch it will be appreciated :) musachy On Mon, Feb 16, 2009 at 5:52 AM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: I figured out how

Re: OGNL ClassCastException

2009-02-15 Thread Adam Hardy
with Collections rather than Sets, but this is surely a bug. I'm just wondering why no-one else is suffering with it. Adam Hardy on 14/02/09 13:35, wrote: Yes, it is a JPA entity bean proxied by OpenJPA. It has a list property - the bean is a parent in a parent-child relationship

Re: OGNL ClassCastException

2009-02-14 Thread Adam Hardy
it is not a list but a proxy to it org.apache.openjpa.util.java$util$ArrayList$proxy which could be the root of the problem. musachy On Fri, Feb 13, 2009 at 12:00 PM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: I have a situation where OGNL seems to be misinterpreting the class of the HTTP parameter

OGNL ClassCastException

2009-02-13 Thread Adam Hardy
I have a situation where OGNL seems to be misinterpreting the class of the HTTP parameter property it is setting during the ParameterInterceptor call. As you can see from the exception message, the object is an ArrayList and certainly not a Set which OGNL thinks it is. I have double, triple

Re: 2.1.6 slams a few doors shut, doesn't it?

2009-02-05 Thread Adam Hardy
at 1:49 PM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: Now that 2.1.6 won't let me add to the resultConfig to add my redirect httpParameters myself, I figured I'd have to obtain the actual Result object. The way that DefaultActionInvocation is programmed to do this though makes it impossible

Re: 2.1.6 slams a few doors shut, doesn't it?

2009-02-05 Thread Adam Hardy
/parameters-in-configuration-results.html Overall it is not a good idea to use internal Struts classes, as they can change, and they often do. musachy On Thu, Feb 5, 2009 at 4:28 AM, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: Hi Musachy, I'm adding it in my action. That's why it gets

Re: 2.1.6 slams a few doors shut, doesn't it?

2009-02-05 Thread Adam Hardy
Dave Newton on 05/02/09 16:47, wrote: Adam Hardy wrote: Tell you the truth, I don't really dig the idea of having to specify parameter in config file like that - I think it adds another thing that can go wrong when you're refactoring. And it also needs special testing requirements. What

Re: 2.1.6 upgrade from 2.0.11 - ResultConfig

2009-02-04 Thread Adam Hardy (struts)
Barroso I think just need to pass a string, instead of an object in the value param. musachy On Mon, Jan 26, 2009 at 10:37 AM, Adam Hardy wrote: Hi, got a compilation error after upgrading from 2.0.11 to 2.1.6 due to changes in com.opensymphony.xwork2.config.entities.ResultConfig I am doing

Re: 2.1.6 - 2.0.11 - ResultConfig -- will a custom Result class work?

2009-02-04 Thread Adam Hardy
to extend ServletActionRedirectResult - someone give me a shout if I'm barking up the wrong tree. Thanks Adam Adam Hardy (struts) on 04/02/09 15:16, wrote: I'm prevented from adding my redirect parameter programmatically with 2.1.6! Look: MapString, ResultConfig resultsMap

Re: Problem passing interface implementing object to an action from a jsp

2009-02-04 Thread Adam Hardy
Hi Mike, I can't quite figure out what you're doing wrong. Don't know what you mean exactly about the iterator value - but I guess the problem lies with the config for your type conversions. Do you have an xwork-conversions or an action-conversion.properties? That's where you tell the xwork

Re: Problem passing interface implementing object to an action from a jsp

2009-02-04 Thread Adam Hardy
method) or substitute in an implementation. I'm not smart enough to understand what that means... -Original Message- From: Adam Hardy [mailto:ahardy.str...@cyberspaceroad.com] Sent: Wednesday, February 04, 2009 11:41 AM To: Struts Users Mailing List Subject: Re: Problem passing interface

Re: 2.1.6 slams a few doors shut, doesn't it?

2009-02-04 Thread Adam Hardy
, the result gets overwritten later anyway. It looks like I must downgrade from here - unless anyone can think of another way of programmatically adding the parameters to the redirect URL. Adam Adam Hardy on 04/02/09 16:34, wrote: From the ActionConfig.Builder#build() javadoc: The builder

Re: Handling JSP exceptions in Struts2

2009-01-28 Thread Adam Hardy
Dave Newton on 26/01/09 21:21, wrote: Andy wrote: it appears that the Exception interceptor will fire after the Result has completed, which would theoretically catch any exceptions thrown by the JSP. It's not that it fires after the result is completed, it's that everything happens

Re: Handling JSP exceptions in Struts2

2009-01-26 Thread Adam Hardy
Did you sort this out already Andy? I can't remember whether the web.xml error page is the same mechanism as the error page declaration. As for grabbing the exception object, I guess it must be in some servlet container scope like the request attributes under some key or other. You could

2.1.6 upgrade from 2.0.11 - ResultConfig

2009-01-26 Thread Adam Hardy
Hi, got a compilation error after upgrading from 2.0.11 to 2.1.6 due to changes in com.opensymphony.xwork2.config.entities.ResultConfig I am doing this: public boolean addRedirectParameter(String resultName, String paramName, Object paramValue) { MapString,

Re: 2.1.6 upgrade from 2.0.11 - ResultConfig

2009-01-26 Thread Adam Hardy
, Adam Hardy ahardy.str...@cyberspaceroad.com wrote: Hi, got a compilation error after upgrading from 2.0.11 to 2.1.6 due to changes in com.opensymphony.xwork2.config.entities.ResultConfig I am doing this: public boolean addRedirectParameter(String resultName, String paramName, Object

Re: Handling JSP exceptions in Struts2

2009-01-22 Thread Adam Hardy
Andy on 20/01/09 17:49, wrote: Using the Exception interceptor works great for catching exceptions throw by actions. However I am wondering what is the recommended method for catching and handling exceptions thrown by a JSP? I assume that JSP exceptions are outside the S2 scope and are to be

Re: REST Again

2009-01-11 Thread Adam Hardy
Musachy Barroso on 08/01/09 16:23, wrote: ok, here we go. Looking at the rest showcase application, when you hit this url: /orders/10 the REST plugin (to simplify) says I have to invoke the 'show' method in the 'orders' action, and set its 'id' parameter to 10. How does the REST plugin know

Re: launching some code after action execution and before result

2008-12-08 Thread Adam Hardy (struts)
Thanks for that. Don't know how I missed it in the documentation, it is of course pretty much exactly what I need. Ideally I guess I'd like it to be configurable in the struts.xml, but it's fine as it is. PreResultListener? --- On Sun, 12/7/08, Adam Hardy [EMAIL PROTECTED] wrote: From

launching some code after action execution and before result

2008-12-07 Thread Adam Hardy
Is this possible somehow in the struts2 framework? I'd like to execute some code for all requests after the action has executed, but before the result, the JSP and all are processed. The code will look at the result type from the action and do some work based on that. Something like an

Re: Problem when using result type=redirect-action

2008-12-02 Thread Adam Hardy
It's a feature! If you look below the stacktrace, you'll see it is logged as a warning. Nothing is actually wrong - it is a struts internal quirk. ravindra on 02/12/08 09:25, wrote: I think some thing is wrong at these lines, result name=* type=redirect-action

Re: Struts Factory

2008-10-29 Thread Adam Hardy
And you could automate that for all your actions by writing an interceptor for it. (assumption: googlecode EJB plugin doesn't contain one already). esemba on 28/10/08 12:33, wrote: DI by default doesn't work, because POJOs (S2 actions) are not container-managed resources. You may use JNDI

Re: Correct implementation of parameterInterceptor??

2008-10-27 Thread Adam Hardy
Burton Rhodes on 24/10/08 11:49, wrote: I have a simple page the has 2 parts... Part 1) Information at the top about a contact that the user is viewing. Part 2) A form where a user can edit the information of a transaction that relates to the contact. When the user enters a invalid entry for a

Re: s:if test= how to find out the NULL value?

2008-10-21 Thread Adam Hardy
Mead Lai on 20/10/08 08:25, wrote: Hi All, s:if test=${username !=null}Show something here/s:if You can do this with JSTL tags: c:if test=${not empty username} - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

xwork injecting parameters into requestScope

2008-10-21 Thread Adam Hardy
I have an Action and corresponding JSP form with the property portfolio. In my JSP, I have this JSTL tag test: c:if test=${not empty portfolio and portfolio.id gt 0} stuff /c:if which works fine for my purposes. But then when I submit the form and validation fails and myAction.portfolio is

Re: xwork injecting parameters into requestScope

2008-10-21 Thread Adam Hardy
Adam Hardy on 21/10/08 14:12, wrote: I have an Action and corresponding JSP form with the property portfolio. In my JSP, I have this JSTL tag test: c:if test=${not empty portfolio and portfolio.id gt 0} stuff /c:if which works fine for my purposes. But then when I submit the form

Re: Any way to disable autowire on struts 2 actions?

2008-10-14 Thread Adam Hardy
Peter Butler on 14/10/08 16:45, wrote: the recommendation is to use explicit configuration using either the Spring config file or Annotations. Why did the Struts team choose not to follow these recommendations? I don't think so, you can setup Spring-plugin to use autowiring by type not by

Re: devMode dead

2008-10-12 Thread Adam Hardy
Wendy Smoak on 11/10/08 22:24, wrote: On Sat, Oct 11, 2008 at 2:15 PM, Martin Gainty [EMAIL PROTECTED] wrote: a really basic question..what does/is/will do devMode supposed to do? I couldnt find any doc on this? http://struts.apache.org/2.0.11.2/docs/devmode.html And the page before that

devMode dead

2008-10-11 Thread Adam Hardy
Is anybody else having trouble with devMode not working? Certainly seems like I'm the only one and I can't find anything wrong with my setup. It's really slowing me down doing the i18n labels on my JSPs without struts doing a refresh on the package.properties file. Looks like it's time to

Re: devMode dead

2008-10-11 Thread Adam Hardy
Lukasz Lenart on 11/10/08 12:21, wrote: 2008/10/11 Adam Hardy [EMAIL PROTECTED]: Is anybody else having trouble with devMode not working? Certainly seems like I'm the only one and I can't find anything wrong with my setup. It's really slowing me down doing the i18n labels on my JSPs without

Re: any struts 2 unit testers out there?

2008-10-10 Thread Adam Hardy (struts)
I am unit testing my MVC layer and looking for the best way to override ActionSupport.getText() cleanly and efficiently for testing purposes (from a developer time point of view). Rather than reinventing the wheel, is there anything out there now that people are willing to share? (Did I miss it

Re: devMode

2008-10-09 Thread Adam Hardy
value=org.permacode.patternrepo.package / Adam Hardy on 08/10/08 18:50, wrote: OK: with devMode=false, the logging misses out this one line (otherwise the same): INFO 17:58:36 DefaultConfiguration.setProperty(): Overriding property struts.configuration.xml.reload - old value: false new

devMode

2008-10-08 Thread Adam Hardy
I fully expect that there's a simple answer to this one but I can't find it in the wiki or the mailing list archives. devMode is set to true in my struts.xml, which loads as per the logging, but my webapp is not reloading the i18n bundle. Actually it's not giving me enhanced exceptions

Re: devMode

2008-10-08 Thread Adam Hardy
anywhere. Alberto Flores on 08/10/08 18:11, wrote: A few questions: - Try to set devMode=false and see if you get the same logs. - Do you have a struts.properties with devMode=false/true. If so, this file will override struts.xml. Adam Hardy wrote: I fully expect that there's a simple answer

Re: JPA Toplink without Spring

2008-10-03 Thread Adam Hardy
You're not going to have any IoC container? Or just the struts one? Or something else? I would definitely use the OpenEntityManagerInView Filter / Interceptor pattern. I rolled my own 'context manager' which has some static methods to access things like EntityManagers in a threadsafe way, and

Re: Showing messages after a redirect

2008-07-01 Thread Adam Hardy
Dimitris Mouchritsas on 01/07/08 16:50, wrote: Ian Roughley wrote: Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did (but it's more or less specific for the action) is to just forward, not redirect. But I've got another question now? Is there a way I can pass a parameter in

Re: Showing messages after a redirect

2008-07-01 Thread Adam Hardy
Dimitris Mouchritsas on 01/07/08 16:50, wrote: Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did (but it's more or less specific for the action) is to just forward, not redirect. But I've got another question now? Is there a way I can pass a parameter in the request? I need

Re: default result name other than SUCCESS?

2008-06-18 Thread Adam Hardy
is a workaround: Write a custom interceptor that each time your action result is LIST, you change it to SUCCESS. This way you could leave your result tags untouched. However, right now I could not imagine the value of doing that. 2008/6/17, Adam Hardy [EMAIL PROTECTED]: Hi, is it possible to do

default result name other than SUCCESS?

2008-06-17 Thread Adam Hardy
Hi, is it possible to do this: action name=category/list class=repo.CategoryAction method=list resultcategoryList.tile/result /action for result = LIST rather than SUCCESS? - I mean I want to use LIST as the default when none is defined, rather than SUCCESS - I find it more intuitive for

Re: Action-Redirect Parameter Problem

2008-06-04 Thread Adam Hardy
will just pass the params thru the interface method, instead of trying to set them as properties. musachy On Mon, Jun 2, 2008 at 6:20 PM, Adam Hardy [EMAIL PROTECTED] wrote: That's a lucid explanation alright, but there are still a few unanswered questions: - it's marked as resolved for 2.0.8

Re: OGNL

2008-05-09 Thread Adam Hardy
Jeromy Evans on 09/05/08 08:05, wrote: Adam Hardy wrote: I initially shied away from doing that because I figured that later on in the show we might want to use Collection sub-class x, y or z. However the alternatives were too time-consuming, so I have done just what you said. I am now

OGNL

2008-05-08 Thread Adam Hardy
Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Thanks Adam

Re: OGNL

2008-05-08 Thread Adam Hardy
Jeromy Evans on 08/05/08 09:26, wrote: Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would

Re: OGNL

2008-05-08 Thread Adam Hardy
Jeromy Evans on 08/05/08 11:41, wrote: Adam Hardy wrote: Jeromy Evans on 08/05/08 09:26, wrote: Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use

Re: OGNL

2008-05-08 Thread Adam Hardy
Adam Hardy on 08/05/08 12:21, wrote: when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed

Re: OGNL

2008-05-08 Thread Adam Hardy
list implementation rather than using a generic list. Then your list implementation can maintain the relationships instead of the action. (*Chris*) On Thu, May 8, 2008 at 7:04 AM, Adam Hardy [EMAIL PROTECTED] wrote: Adam Hardy on 08/05/08 12:21, wrote: when the Params interceptor populates my

usage of Preparable interface?

2008-05-01 Thread Adam Hardy
I have been casting around for a while for the most elegant and quick-to-code mechanism for putting populating lists for select controls. I wanted to run this one idea past the struts users to get any feedback on something I may have missed or need to know. One requirement I set myself is

Re: usage of Preparable interface?

2008-05-01 Thread Adam Hardy
Jeromy Evans on 01/05/08 12:48, wrote: Adam Hardy wrote: I have been casting around for a while for the most elegant and quick-to-code mechanism for putting populating lists for select controls. I wanted to run this one idea past the struts users to get any feedback on something I may have

Re: usage of Preparable interface?

2008-05-01 Thread Adam Hardy
Adam Hardy on 01/05/08 13:51, wrote: Jeromy Evans on 01/05/08 12:48, wrote: Adam Hardy wrote: I have been casting around for a while for the most elegant and quick-to-code mechanism for putting populating lists for select controls. I wanted to run this one idea past the struts users to get

Re: usage of Preparable interface?

2008-05-01 Thread Adam Hardy
Jeromy Evans on 01/05/08 14:49, wrote: That way you could remove all the boilerplate from your actions. eg, If it placed the model into the actioncontext you could potentially use s:select name=state list=#states/ without your action providing the list or getter at all (except something must

Re: Struts2 Unit Testing

2008-04-28 Thread Adam Hardy
Nils-Helge Garli Hegvik on 28/04/08 09:02, wrote: - Don't get caught up in the code coverage hysteria. Focus on writing good tests instead of how many lines and branches of code you have tested. I've no idea what level of code coverage Nils holds to be hysterical, but I wouldn't take his

Re: Struts2 Unit Testing

2008-04-28 Thread Adam Hardy
Nils-Helge Garli Hegvik on 28/04/08 17:51, wrote: - Don't get caught up in the code coverage hysteria. Focus on writing good tests instead of how many lines and branches of code you have tested. I've no idea what level of code coverage Nils holds to be hysterical, but I wouldn't take his

Re: devMode + Windows + Eclipse + Tomcat = not reloading struts.xml

2008-04-28 Thread Adam Hardy
Chase on 28/04/08 22:14, wrote: Anyone had issues with devMode not working fully on Windows? I've got constant name=struts.devMode value=true / set and in my Tomcat console log I'm seeing: INFO: Overriding property struts.configuration.xml.reload - old value: false new value: true Windows

Re: [OT] Looking for a util to set parameters on an object

2008-04-23 Thread Adam Hardy
Greg Lindholm on 23/04/08 20:36, wrote: I have an object and a Map of parameter/values and I'm looking for a utility that will match up the parameters with the setters on the object, call the setters and handle conversions for primitive types. I know that OGNL is being used to do this on

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Adam Hardy
Hi Toni there are several different approaches. The one I use has an Edit action and a Save action. The Edit action fetches the dropdown list and puts it in the request and results in the form jsp. The form submits to Save and if validation fails, the Input result is resultType=chain and

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Adam Hardy
instead of the request, but I don't really like cluttering the session with such things. On Mon, Apr 21, 2008 at 12:55 PM, Adam Hardy [EMAIL PROTECTED] wrote: Hi Toni there are several different approaches. The one I use has an Edit action and a Save action. The Edit action fetches the dropdown

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Adam Hardy
, Adam Hardy [EMAIL PROTECTED] wrote: I think so - the chain is just a forward inside the same request so you shouldn't lose the field errors. But I'm just setting up a new website now with this approach, so actually I'm as inexperienced as you are - my previous Struts2 project had a different

Re: Best practise for populating a select from database so that it works for all result types

2008-04-21 Thread Adam Hardy
at 2:20 PM, Adam Hardy [EMAIL PROTECTED] wrote: Yes, I get the picture. If you haven't already, download the source bundle and look at the examples. Actually I don't think I understood one thing you said. You're using an action taglib in the JSP, which invokes the list retrieval. Surely that's

ActionMapper - obtaining it in a taglib

2008-04-21 Thread Adam Hardy
Just had a long search through the struts source and can't see how this is done. I want to obtain the ActionMapper so that I can get the URL for an action, in the same way that the Form taglib does it: ActionMapping mapping = new ActionMapping(action, namespace, actionMethod, parameters);

Re: ActionMapper - obtaining it in a taglib

2008-04-21 Thread Adam Hardy
Ralf Fischer on 21/04/08 18:24, wrote: On Mon, Apr 21, 2008 at 6:02 PM, Adam Hardy [EMAIL PROTECTED] wrote: Just had a long search through the struts source and can't see how this is done. I want to obtain the ActionMapper so that I can get the URL for an action, in the same way that the Form

Re: ActionMapper - obtaining it in a taglib

2008-04-21 Thread Adam Hardy
Dave Newton on 21/04/08 18:29, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: I want to obtain the ActionMapper so that I can get the URL for an action, in the same way that the Form taglib does it: Does the @Inject annotation not work for you? It works, but it doesn't light my fire. I just

Re: from Action to PageContext: how's it done?

2008-04-20 Thread Adam Hardy
Dave Newton on 20/04/08 02:24, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: What you're saying is clear except one thing - in JSTL I can access the action. And in JSTL, I'm not calling request.getAttribute() - I'm _not_ doing this: ${requestScope['myObject']} I'm just doing

from Action to PageContext: how's it done?

2008-04-19 Thread Adam Hardy
From looking at the struts2 architecture, one of the big questions that I can't find the answer to is how struts/xwork moves objects such as the properties on an action into the PageContext. When an interceptor is executing for example, calling ServletActionContext.getPageContext() will

Re: from Action to PageContext: how's it done?

2008-04-19 Thread Adam Hardy
Ralf Fischer on 19/04/08 18:43, wrote: On Sat, Apr 19, 2008 at 7:29 PM, Adam Hardy [EMAIL PROTECTED] wrote: From looking at the struts2 architecture, one of the big questions that I can't find the answer to is how struts/xwork moves objects such as the properties on an action

Re: from Action to PageContext: how's it done?

2008-04-19 Thread Adam Hardy
Dave Newton on 19/04/08 23:54, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: The struts interceptors encompass both the actions and the results, but how does struts put the action properties into the pageContext? It doesn't; it puts the action on the stack. The tags use OGNL to get values

Re: from Action to PageContext: how's it done?

2008-04-19 Thread Adam Hardy
Dave Newton on 20/04/08 00:23, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: So you say the StrutsRequestWrapper holds the struts context [...] No, I'm saying it has access to it via ActionContext.getContext(). and is accessed somewhere in the Result to pull everything down

date conversion

2008-04-08 Thread Adam Hardy
Hi quick question, I can't find any specific mention of what I want so I assume I have to code my own Converter. I need a date in the ISO format -MM-DD There is no converter that I can configure in the struts package, is there? Thanks Adam

Re: date conversion

2008-04-08 Thread Adam Hardy
has FastDateFormat: http://commons.apache.org/lang/ Brad Cupit Louisiana State University - UIS e-mail: [EMAIL PROTECTED] office: 225.578.4774 -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 12:11 PM To: Struts Users Mailing List Subject: date

Re: date conversion

2008-04-08 Thread Adam Hardy
Can you patch a whole class? What would be useful is parameterizable type converters, to specify the date format in this case. (they're not parameterizable, are they?) Dave Newton on 08/04/08 22:13, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: One area where S1 actually had the upper hand

Re: struts.xml

2008-04-04 Thread Adam Hardy
see any way to get hold of the Dispatcher (since Dispatcher.getInstance() returns null before I launch the request). Adam Hardy on 04/04/08 00:46, wrote: Brian, thanks for the low-down. It works well. Relph,Brian on 03/04/08 15:53, wrote: Copy paste error, you need to initialize

Re: struts.xml

2008-04-03 Thread Adam Hardy
Adam Hardy on 02/04/08 12:23, wrote: Can I have a second struts.xml in my test directory, and if so, how do I configure it? I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp

Re: struts.xml

2008-04-03 Thread Adam Hardy
Dispatcher(servletContext, new HashMapString, String()); dispatcher.init(); Dispatcher.setInstance(dispatcher); -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2008 5:00 AM To: Struts Users Mailing List Subject: Re

struts.xml

2008-04-02 Thread Adam Hardy
Can I have a second struts.xml in my test directory, and if so, how do I configure it? I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp, allow me to drop stuff I don't need for

Re: Struts - Spring - hibernate and lazy initialization

2008-04-02 Thread Adam Hardy
Yayo on 02/04/08 20:23, wrote: I'm developing a struts - spring based application. I've got actions-delegates-managers and daos and I use the open session in view filter from hibernate. In some cases I've got to return lazy results to the user so I've got to launch a new worker thread and

testing file uploads

2008-03-31 Thread Adam Hardy
I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. MultiPartRequestWrapper multiWrapper = (MultiPartRequestWrapper) ServletActionContext.getRequest()

Re: testing file uploads

2008-03-31 Thread Adam Hardy
Dave Newton on 31/03/08 18:42, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. What, specifically

Re: testing file uploads

2008-03-31 Thread Adam Hardy
(), MockHttpServletResponse(), MockServletContext() from org.apache.struts2.ServletActionContextTest.java ? - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, March 31, 2008 12:04 PM Subject: testing file uploads I

Re: testing file uploads

2008-03-31 Thread Adam Hardy
Dave Newton on 31/03/08 22:00, wrote: --- Adam Hardy [EMAIL PROTECTED] wrote: Dave Newton on 31/03/08 18:42, wrote: What, specifically, are you trying to test? The action has to get strings out of the request, work out which file they are from and call the appropriate managers

Re: testing file uploads

2008-03-31 Thread Adam Hardy
at using Mock classes of MockHttpServletRequest(), MockHttpServletResponse(), MockServletContext() from org.apache.struts2.ServletActionContextTest.java ? Martin - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, March 31

Re: S2: Actions/DAO interaction getting messy...

2008-03-27 Thread Adam Hardy
Eric D Nielsen on 26/03/08 15:31, wrote: Adam Hardy on 26/03/08 00:28:43 Eric D Nielsen on 25/03/08 14:29, wrote: Its a Struts2/Spring2/JPA(Hibernate) based project. I'm using a slightly modified version of the Generic DAO pattern shown in the Java persistence with Hibernate book

Re: S2: Actions/DAO interaction getting messy...

2008-03-25 Thread Adam Hardy
Eric D Nielsen on 25/03/08 14:29, wrote: Its a Struts2/Spring2/JPA(Hibernate) based project. I'm using a slightly modified version of the Generic DAO pattern shown in the Java persistence with Hibernate book and/or the IBM ThoughtWorks very similar example. (Modified to allow Spring Based

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread Adam Hardy
I didn't see the second half of your message until I'd sent that. What calls to the setters are you asking about? Do you mean any random property? Are you talking about HTTP parameters? Have you checked out the commons-beanutils API? Adam Hardy on 06/03/08 12:47, wrote: Unless you want to do

Re: [S2] Writing a simple interceptor that set a properties of the action.

2008-03-06 Thread Adam Hardy
Unless you want to do it via introspection, then a good way would be to set the appropriate actions to implement an interface having that setter. Then you can use instanceof to see if the action in your interceptor implements your interface. If so, cast it to the interface and call the setter.

Re: xwork-conversion.properties

2008-02-24 Thread Adam Hardy
of instrument.market. Regards Kedar -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Sunday, February 24, 2008 1:02 AM To: Struts Users Mailing List Subject: Re: xwork-conversion.properties Adam Hardy on 22/02/08 17:32, wrote: I wrote a TypeConverter and configured S2 with xwork

Re: Conversation Scope?

2008-02-24 Thread Adam Hardy
Is it worth building a mechanism for conversation scope, compared to the complexity it introduces? I really dislike Spring Webflow with its conversation scope, stringent encapsulation and storage of massive amounts of data in various maps that locks away everything out of sight and makes it all

Re: xwork-conversion.properties

2008-02-23 Thread Adam Hardy
Adam Hardy on 22/02/08 17:32, wrote: I wrote a TypeConverter and configured S2 with xwork-conversion.properties to use it so: org.permacode.patternrepo.domain.Market=org.permacode.atomic.web.DomainObjectTypeConverter as per the wiki. However, from debugging it looks as though struts

Re: Pagination in Struts2

2008-02-22 Thread Adam Hardy
Just thought it's worth pointing out that displaytag does tables, whereas google search results are actually table-less. I'd be very interested if anyone knows whether displaytag or any other project is or will offer a table-less solution. There are so many extras that would be nice to have

xwork-conversion.properties

2008-02-22 Thread Adam Hardy
I wrote a TypeConverter and configured S2 with xwork-conversion.properties to use it so: org.permacode.patternrepo.domain.Market=org.permacode.atomic.web.DomainObjectTypeConverter as per the wiki. However, from debugging it looks as though struts is completely ignoring the TypeConverter and

  1   2   3   4   5   >