RE: data injection attack

2012-07-04 Thread Marcus Bond
You could implement a class that delegates to your bean but only exposes setters and getters that are appropriate, so in the case of the id then you could let the user view it (getter) but not allow the setter. A perhaps even better approach would be to devise a proxying mechanism (perhaps conf

RE: fetching a static variable's value from within a JSP page

2012-06-20 Thread Marcus Bond
Is it possible that in your example code there are lines referencing property instanceCount where they should reference helloCount? -Original Message- From: Sam Cyrus [mailto:haminto...@yahoo.com] Sent: 20 June 2012 17:24 To: Struts send question Subject: fetching a static variable's valu

RE: Advice needed: Offline Struts App

2012-03-15 Thread Marcus Bond
Do you mean that they wish to have it running locally or that they want to see a native UI application rather than a browser application? If it is the first scenario then why not simply give them a zipped up tomcat server with the web-app already deployed and either a script to run it or ask the

RE: [OT] Searching for data access framework.

2011-12-05 Thread Marcus Bond
Perhaps Apache Shiro may be something you could utilise... you would implement an LDAP 'realm' or a SQL realm that knows how to lookup credentials and access privileges etc. In their lingo "A Realm is essentially a security-specific DAO " and out of the box they provide a JDBC realm with suggested

RE: To create new session without invalidating existing one

2011-09-29 Thread Marcus Bond
What is the reason for the new session? Doesn't sound a great plan. Anyway you're going to have a problem as this isn't how browsers expect to work, that said Chrome allows incognito browsing so that might work but it isn’t generally the expected behaviour. If the same application is being acces

Modularisation of project web artifacts

2011-09-06 Thread Marcus Bond
Has anyone here much experience of separating out actions and associated jsp's into their own projects (cvs , git whatever) and incorporating these as artifacts into a larger project (aka the app)? I want to be able to separate out my JSPs into a number of projects which could be packaged into

Persistence backed form validation

2011-09-02 Thread Marcus Bond
Hi, does anyone know of a validation method in struts that can use your JPA (or other usage agnostic) annotations to validate the values on form fields? For example, if I have specified a max length on an entity property and a mandatory option on another then when updating / creating that entity vi

RE: How to implement EJB 3.0, JPA, Hibernate and Struts 2 in one application?

2011-08-15 Thread Marcus Bond
Have never tried this out with ejb since it isn't isn't my thing but just the same as a spring / struts (or any other framework) app your service layer would be called from your struts actions such that struts isn't likely to know about or care about the fact that the service classes are ejb, spri

RE: how to make onchange in s:select to submit a form and call a specific method in one action class

2011-08-11 Thread Marcus Bond
You could always make your own tag as an extension to the standard struts select tag adding attributes onChangeAction and onChangeTarget and let your new tag render an appropriate bit of javascript to make an ajax call to the server and then populate the results into the target item.. such a set

RE: Where to put non action associated data

2011-08-01 Thread Marcus Bond
n't know either. It's the service > layer's job to understand the complexities and related activities that > go with the basic requests from the Action. > > My two cents. > >  - Aaron > > On Sun, Jul 31, 2011 at 12:50 PM, Marcus Bond wrote: >> Hi, >

Where to put non action associated data

2011-07-31 Thread Marcus Bond
Hi, Say I have a form where user can carry out a product search which hits an action and returns a list of results - easy.. however in response to the user changing their search criteria I want to also generate some search terms which would be passed through to Ebay, google ads etc.. but not wi

RE: Multi Devices and Multilanguage

2011-06-30 Thread Marcus Bond
I had a similar idea of using an interceptor to alter the result code a while ago and decided that it was a non-starter mainly because every action would need another mapping for each platform you determined was worthy of treating differently. I need to sort something out imminently and the current

Re: Dynamic text

2011-05-31 Thread Marcus Bond
land 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. -Original Message----- From: Marcus Bond [mailto:mar...@marcusbond.me.uk] Sent: Tuesday, May 31, 201

Re: Dynamic text

2011-05-31 Thread Marcus Bond
return "goodbye"; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: This works fine Nope Nope This returns nothing This returns nothing This returns nothing On 31/05/2011 15:38, Jason Pyeron wrote: -----Original Message- From: Mar

Dynamic text

2011-05-31 Thread Marcus Bond
Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Cheers, Marcus

Re: RedirectAction Help!

2011-05-13 Thread Marcus Bond
I was having similar issues recently using an older version of struts2 (can't remember which unfortunately) and I upgraded to 2.2.3 which seems to work fine.. fyi the first example I have is below where selectedUserId is set on the action I redirect to with the value from user.getId passed as

Re: RedirectAction Help!

2011-05-13 Thread Marcus Bond
I have a few examples of this working fine, will post this evening when I'm home M On 13/05/2011 13:57, tdmcgin...@gmail.com wrote: I didn't think I could send parameters with the chain? I am really trying to pass the an id from one action to another. I'll take any suggestions to get this wo

Re: Strange behaviour with Spring

2011-05-10 Thread Marcus Bond
implement java.lang.String, it's immutable and doesn't follow the bean spec. (*Chris*) On Sun, May 8, 2011 at 2:11 PM, Marcus Bond wrote: Hi, I'm using Struts 2.2.3 and have observed some bizarre behavior when using Spring to provide my actions.. In order to simplify this

Strange behaviour with Spring

2011-05-08 Thread Marcus Bond
Hi, I'm using Struts 2.2.3 and have observed some bizarre behavior when using Spring to provide my actions.. In order to simplify this and prove the problem I have created a project with a single static html file, and a single action in struts.xml which references a bean in my spring context

Re: Parameter manipulation

2010-12-17 Thread Marcus Bond
David, didn't your original post say that this is an action that loads an object to display it rather than to modify it? In which case I'm not sure why you even need to use Preparable (as I'm guessing it's during prepare that the instance is initialised which makes it available for struts to po

Re: Interceptor attempt

2010-11-11 Thread Marcus Bond
t versions of the frameworks. I've tried a couple with limited success. -David -Original Message- From: Marcus Bond [mailto:mar...@marcusbond.me.uk] Sent: Thursday, November 11, 2010 11:01 AM To: user@struts.apache.org Subject: Re: Interceptor attempt Sorry to jump the thread Dav

Re: Interceptor attempt

2010-11-11 Thread Marcus Bond
Sorry to jump the thread David.. Looks like the ThreadLocal (unique per thread) session using HibernateUtil or equivalent would be the better bet. I'd question why you need direct access to the session from within your actions anyway as you're likely to be calling methods on some service class

Modifying action mapping per device type

2010-01-30 Thread Marcus Bond
Hi, I am wanting to implement a site such that some actions may have a different mapping depending upon the device used (e.g. regular browser / mobile device etc.) but what I don't want to do is have to litter my actions with this type of logic. It could be at the result mapping level (i.e. i

Re: Modifying action mapping per device type

2010-01-30 Thread Marcus Bond
Hi Wes, thanks for the post. I like the idea of being able to decorate screens differently depending on device without changing much existing code and I can see a use to this for example for pages being given a different footer to provide device specific links or adding side menus for devices

Re: Modifying action mapping per device type

2010-01-29 Thread Marcus Bond
to it like the ServletDispatcherResult do. (I'm sure Convention plugin must have something like this already working.) 2010/1/29 Marcus Bond : Interesting, I hadn't thought of that. However a problem I see here with this approach is that it implies that there would be different versions o

Re: Modifying action mapping per device type

2010-01-29 Thread Marcus Bond
s I will have a getDevice() which will return a string (e.g. "iPhone" or "blackberry" etc.) based on the User-Agent or x-wap-profile. I will use an interceptor that reads the user-agent etc and determines the device type and injects that into my actions. On Fri, Jan 29, 2010 at 5:57

Re: Modifying action mapping per device type

2010-01-29 Thread Marcus Bond
Thanks for the info Andy, the interceptor seems an appropriate thing although it does mean there are multiple mappings in struts.xml. This seems at least a way that allows a site to grow in terms of new views without impacting upon the application code or exisiting views. Thinking about it thi

Re: Modifying action mapping per device type

2010-01-29 Thread Marcus Bond
2010/1/28 Marcus Bond : Hi, I am wanting to implement a site such that some actions may have a different mapping depending upon the device used (e.g. regular browser / mobile device etc.) but what I don't want to do is have to litter my actions with this type of logic. It could be at the resul

Modifying action mapping per device type

2010-01-28 Thread Marcus Bond
Hi, I am wanting to implement a site such that some actions may have a different mapping depending upon the device used (e.g. regular browser / mobile device etc.) but what I don't want to do is have to litter my actions with this type of logic. It could be at the result mapping level (i.e. i