RE: Currency Formatting

2010-07-14 Thread James Cook
Ooo, didn't know I could use an iterator like that, I have always defined the var. Thanks for the tip, however do you not find that other way easier for readability? Just thinking an outsider might be left wondering where price came from.. Maybe I am missing the point. -Original Message-

RE: Get a list stored in the session to the struts tag

2010-06-23 Thread James Cook
Try %{#session.test} James -Original Message- From: Kushan Jayathilake [mailto:kusha...@gmail.com] Sent: 23 June 2010 11:49 To: Struts Users Mailing List Subject: Get a list stored in the session to the struts tag Hi Guys, I want to get a list stored in the session and feed that value

RE: Get a list stored in the session to the struts tag

2010-06-23 Thread James Cook
, s:iterator value='%{session.test}' no need of that # sign there. Thanks again, you helped me to solve this :) -- Regards Kushan Jayathilake On Wed, Jun 23, 2010 at 4:20 PM, James Cook james.c...@wecomm.com wrote: Try %{#session.test} James -Original Message- From: Kushan

RE: unit test the service layer (aka data access layer)

2010-06-21 Thread James Cook
Get involved with: Junit 4.4 Spring-test libs And started your service test class like such: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = classpath:/testConfigXML.xml) public class MyServiceImplTest extends AbstractJUnit4SpringContextTests { @Autowired(required

RE: unit test the service layer (aka data access layer)

2010-06-21 Thread James Cook
, 2010 at 5:02 AM, James Cook james.c...@wecomm.com wrote: Get involved with: Junit 4.4 Spring-test libs And started your service test class like such: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = classpath:/testConfigXML.xml) public class MyServiceImplTest

RE: Struts 2 Browser Caching

2010-06-14 Thread James Cook
I two would like to hear about solutions to this, after a quick Google, I found most people have it the other way with their JS files being cached and not reflecting there changes. How are you constructing your url's for the resources Roger? Do they end up with a dynamic element in them, that

RE: Struts 2 Browser Caching

2010-06-14 Thread James Cook
Subject: RE: Struts 2 Browser Caching James Cook-13 wrote: I two would like to hear about solutions to this, after a quick Google, I found most people have it the other way with their JS files being cached and not reflecting there changes. I think that either I haven't explained clearly

RE: Struts 2 Browser Caching

2010-06-14 Thread James Cook
...@googlemail.com] Sent: 14 June 2010 12:57 To: user@struts.apache.org Subject: RE: Struts 2 Browser Caching James Cook-13 wrote: Nope, no misunderstanding. All I was saying was that people seem to experience the opposite to what you are experiencing. Like you said, they have what you want... I

Struts.xml - Packages

2010-06-08 Thread James Cook
Hi All, Having a blank mind moment here. I was hoping someone might be able to clear it up with me. I am using my favourite Struts 2 setup of Convention + Spring. However I am just going through the process of adding a global exception mapping, so I created a struts.xml file which contains

RE: spring, struts2, convention plugin, how to wire an action class

2010-05-13 Thread James Cook
Hmm. I use the same combo. I found at some point I could jsut do public class MyAction extends ActionSupport { private MyInjectedService service etc etc But I have started doing: public class MyAction extends ActionSupport { @Autowired private MyInjectedService service I am not sure if

RE: spring, struts2, convention plugin, how to wire an action class

2010-05-13 Thread James Cook
remains, how can i use DI with struts2 (convention plugin) and spring on Action classes? or can i not? if i can't, end of story. if i can, how? On Thu, May 13, 2010 at 5:44 AM, James Cook james.c...@wecomm.com wrote: Hmm. I use the same combo. I found at some point I could jsut do public class

RE: spring, struts2, convention plugin, how to wire an action class

2010-05-13 Thread James Cook
, how to wire an action class doesn't answer the question but thanks anyways. On Thu, May 13, 2010 at 6:12 AM, James Cook james.c...@wecomm.com wrote: Nope, no they are not in the xml for me. I use the @Service/@Repository annotations on the class, coupled with the component scan in the Spring

RE: spring, struts2, convention plugin, how to wire an action class

2010-05-13 Thread James Cook
not too complicated, seem verbose with the xml). On Thu, May 13, 2010 at 6:20 AM, James Cook james.c...@wecomm.com wrote: Yeah sorry, short on time here, didn't see your question at the bottom. Add the spring jar from the spring project. -Original Message- From: Jake Vang [mailto:vangj

RE: spring, struts2, convention plugin, how to wire an action class

2010-05-13 Thread James Cook
...@googlemail.com] Sent: 13 May 2010 11:44 To: Struts Users Mailing List Subject: Re: spring, struts2, convention plugin, how to wire an action class yes. precisely. On Thu, May 13, 2010 at 6:41 AM, James Cook james.c...@wecomm.com wrote: Oh, did you want your action as a spring managed bean? Ah

RE: struts-blank-1.3.10.war has memory leak.

2010-05-13 Thread James Cook
Hey, I know this doesn't give you a direct answer. But I found this article quite interesting on the topic of undeploying an application and classes being left loaded, which in turn leaves the classloader. http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java -Original

RE: Some Spring/Struts questions

2010-05-12 Thread James Cook
You could, add the bean to the servlet context, and access it via a scriptlet in the jsp. Thus bypassing your actions all together. Or.. Create filter/Inteceptor and inject into them? -Original Message- From: Andy Law [mailto:andy@roslin.ed.ac.uk] Sent: 12 May 2010 09:58 To:

RE: Some Spring/Struts questions

2010-05-12 Thread James Cook
Spring/Struts questions James Cook-13 wrote: You could, add the bean to the servlet context, and access it via a scriptlet in the jsp. Thus bypassing your actions all together. What does the Spring configuration look like for that course of action? James Cook-13 wrote: Or.. Create

RE: Some Spring/Struts questions

2010-05-12 Thread James Cook
That would be my favoured route. Wes, side question. Using the convention plugin can you modify the stack in the xml file so you don't have to annotate the action itself? Or do you still have to add the annotation with the interceptor put in? James -Original Message- From: Wes

RE: Some Spring/Struts questions

2010-05-12 Thread James Cook
/convention-plugin.html#ConventionPlugin-Configurationreference I think the setting is - struts.convention.default.parent.package -Wes On Wed, May 12, 2010 at 9:39 AM, James Cook james.c...@wecomm.com wrote: That would be my favoured route. Wes, side question. Using the convention plugin

RE: Some Spring/Struts questions

2010-05-12 Thread James Cook
/param /result /global-results /package /struts On Wed, May 12, 2010 at 10:03 AM, James Cook james.c...@wecomm.com wrote: Ah, awesome. Thank you for clearing that one up and your package is defined in the struts.xml in the root of the source? -Original Message

Difference between ActionSupport and DefaultActionSupport

2010-05-11 Thread James Cook
Hi All, I was wondering if someone can dispel some confusion for me. When would I use DefaultActionSupport over ActionSupport, or viceversa? James

RE: Iterate over an ArrayList of arrays

2010-05-11 Thread James Cook
Where does 'top' come from? -Original Message- From: Dale Newfield [mailto:d...@newfield.org] Sent: 11 May 2010 14:49 To: Struts Users Mailing List Cc: Steven Yang Subject: Re: Iterate over an ArrayList of arrays On 5/11/10 5:59 AM, Steven Yang wrote: try s:iterator value=breadcrumbs

Struts 2 in an EAR

2010-04-15 Thread James Cook
Hi All, I have a Struts 2 enabled WAR that works fine when deployed on its own, but when packaged as part of an EAR it doesn't appear to be scanning for the annotations in the WAR as I get the unable to find Action message. I am running this on Glassfish 2.1.1 and using Struts 2.1.8.1

RE: Struts 2 in an EAR

2010-04-15 Thread James Cook
within an WAR/EAR combo on Glassfish 2.1. Chris -Original Message- From: James Cook [mailto:james.c...@wecomm.com] Sent: 15 April 2010 11:12 To: Struts Users Mailing List Subject: Struts 2 in an EAR Hi All, I have a Struts 2 enabled WAR that works fine when deployed on its own, but when

RE: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions

2009-12-04 Thread James Cook
EJB's can only be injected into other EJB's or Servlets, a struts 2 action is essentially a pojo not a servlet. So you would either have to do a lookup in the context, or if you are using Spring look at using a jndi lookup and inject that reference into your class. Cookie -Original

RE: Struts 2 Spring Plugin Usage

2009-11-03 Thread James Cook
The spring plugin will look by default auto wire your spring beans via type, it isn't tied to the getXXX(); method call. I myself only have the declaration and a setter, the autowiring injects the spring managed bean for me. Nothing is done with the getters DAO Class: public MyDAOImpl

RE: strust2: filter-mapping best practice - url-pattern/*/url-pattern

2009-11-02 Thread James Cook
Yes, this is what I do also, I have an app with a webservice so needed it to not get caught in the Struts filter. It is a shame however, as I would like to have kept the URLs neat without the action on the end. But as they say, don't get caught up in what the URL says. -Original Message-

RE: Struts 2 Spring Plugin Usage

2009-11-02 Thread James Cook
Hey Roger, If I am understanding you then that is fine. I often do the same, as I like to have a DAO as well as a Service layer. So inject my DAO's into my Service and my Service into my actions. Good ole' code by interface approach :) -Original Message- From: RogerV

RE: Struts 2 Spring Plugin Usage

2009-11-02 Thread James Cook
That is because of the default autowiring. I use the convention plugin for Struts and I take advantage of the spring auto wiring (by name) to automagically inject my service layer. You can do the same for the rest. Check out the reference guide over at spring framework to do so. Weirdly I like

RE: Struts 2.1 book

2009-11-02 Thread James Cook
I have that book and thoroughly enjoyed it, gave me a great platform for me to transition from S1 to S2... So I second the recommendation -Original Message- From: Phillips, Bruce A [mailto:bphill...@ku.edu] Sent: 02 November 2009 18:37 To: Muthu Velappan; Struts Users Mailing List

RE: ActionInvocation/ActionContext - NoSuchMethodError

2009-10-30 Thread James Cook
Try using StrutsStatics class instead. It is what I use. E.g. HttpServletResponse response = (HttpServletResponse) invocation.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE); HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST); Cookie

struts.convention.package.locators.basePackage

2009-10-29 Thread James Cook
Hi All, Pretty certain this is a bug, but I can't get struts.convention.package.locators.basePackage To be noticed, I am using 2.1.6 libs Any one suggest anything? Cheers James

RE: struts.convention.package.locators.basePackage

2009-10-29 Thread James Cook
- From: James Cook Sent: 29 October 2009 10:13 To: Struts Users Mailing List Subject: struts.convention.package.locators.basePackage Hi All, Pretty certain this is a bug, but I can't get struts.convention.package.locators.basePackage To be noticed, I am using 2.1.6 libs Any one

RE: Convention Plugin Struts Packages

2009-10-29 Thread James Cook
Hey Roger, You need to use @ParentPackage I believe. Or use this struts.convention.default.parent.package Check out: http://struts.apache.org/2.1.6/docs/convention-plugin.html#ConventionPlu gin-ParentPackageannotation Hope this helps Cookie -Original Message- From: RogerV

RE: Convention Plugin Struts Packages

2009-10-29 Thread James Cook
#ConventionPlugin-Par entPackageannotation Cookie -Original Message- From: RogerV [mailto:roger.var...@googlemail.com] Sent: 29 October 2009 13:22 To: user@struts.apache.org Subject: RE: Convention Plugin Struts Packages James Cook-13 wrote: Hey Roger, You need to use @ParentPackage I

RE: javax.el.ELException Select Tag

2009-10-29 Thread James Cook
Should a # s:select label=programType id=programType name=programType list=#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS Programs'} value=selectedProgram required=true/ I made the same oversight last night Cookie -Original Message- From: Bhaarat

RE: javax.el.ELException Select Tag

2009-10-29 Thread James Cook
: javax.el.ELException Select Tag you have the same code as my original code ...right? On Thu, Oct 29, 2009 at 11:39 AM, James Cook james.c...@wecomm.com wrote: Should a # s:select label=programType id=programType name=programType list=#{'ALL':'All Programs', 'BU':'BY Problems', 'TS':'TS

RE: javax.el.ELException Select Tag

2009-10-29 Thread James Cook
Hi, I checked the javadoc for select and this is what is listed. s:select label=Months name=months headerKey=-1 headerValue=Select Month list=#{'01':'Jan', '02':'Feb', [...]} value=selectedMonth required=true / This is what I used last night. So #{}

RE: struts.convention.package.locators.basePackage

2009-10-29 Thread James Cook
. musachy On Thu, Oct 29, 2009 at 3:16 AM, James Cook james.c...@wecomm.com wrote: Infact I think I have answered my own question. In context of my previous email regarding the scanning, this bug: https://issues.apache.org/struts/browse/WW-3234 The XWorks scans all classes on the CP first

Tomcat 5.0.28 and Struts 2.1.8

2009-10-21 Thread James Cook
Hi All, I have just had a fun evening with getting a S2 app to work on a shared Tomcat instance. What I discovered when I deployed was this error: Exception starting filter struts2 javax.xml.transform.TransformerFactoryConfigurationError

2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

2009-10-08 Thread James Cook
Hi All, I did ask this question before but never received an answer, I do understand that this is quite complex problem. However I thought I would ask again in case anyone else has come across this... When I use the Convention plugin with Spring and Glassfish, upon deploy of the resulting WAR

RE: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

2009-10-08 Thread James Cook
Users Mailing List Subject: Re: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2 Those exceptions are annoying, but they can be ignored. There are multiple settings for scanning, like not scanning jars, which you can play with. musachy On Thu, Oct 8, 2009 at 10:19 AM, James Cook james.c

RE: 2.1.6, Convention Plugin + Spring + Glassfish 2 ur2

2009-10-08 Thread James Cook
/browse/WW-3234 Thanks to Brian Ferris for it. musachy On Thu, Oct 8, 2009 at 11:10 AM, James Cook james.c...@wecomm.com wrote: Hi, thank you very much for your response... The exceptions don't really bother me, it is just we deployed an app onto a domain with 5 other apps and it just trawled

RE: How to connect a EJB3 project with struts2

2009-09-25 Thread James Cook
Hi Michael, Look at the jndi-lookup in the spring manual. http://static.springsource.org/spring/docs/2.5.6/reference/ejb.html I have done this in the past, so will try to find some example code later - if required. I did find I couldn't use SLSB tag as it required a home interface that no

RE: How to connect a EJB3 project with struts2

2009-09-25 Thread James Cook
James, ohh that would be good. I have tried some of the things they have documented on the side. But I didn't get it running. A practical example would be very helpful to get the clou. Kind regards, Michael James Cook schrieb: Hi Michael, Look at the jndi-lookup in the spring manual. http

cssClass with CheckboxList

2009-09-21 Thread James Cook
Hi All, I am trying to have my inputs generated from a checkbox list use a certain css class. However when I use cssClass the class attribute doesn't show up in the html. JSP: s:checkboxlist cssClass=myClass label=My Boxes key=boxIds list=boxList listKey=id listValue=name / HTML

2.1.6 with Convention + Spring plugins

2009-09-10 Thread James Cook
Hi All, I have set up my first Struts2 project. I have added the convention library and the spring library to the project. Now when I deploy (Glassfish 2 ur2) I receive various exception messages, all in the vein of java.lang.Exception: Could not load MultiColumnPrinter.class