All,
Apologies if this would be better asked in a Spring forum. If so, I would
appreciate guidance as to which one/where.
I have a Struts2 application with around 30 actions. Most inherit from a
common base class. We have configured the system to start to use Spring to
inject certain things into
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 filter/Inteceptor and
James Cook-13 wrote:
>
> In the past I have done this for accessing beans in a servlet.
>
> class="org.springframework.web.context.support.ServletContextAttributeEx
> porter">
>
>
> value-ref="myOrganisationServiceBeanRef"/>
>
>
>
>
Martin,
mgainty wrote:
>
>
> jsp:useBean for quite some time
> class="enterprise.criteriaQuery.ejb.StatelessSessionBean" />
>
> in your jsp if you have a method called getCriteria the jsp could call the
> bean method directly via
>
> <%=query.getCriteria()%>
>
>
OK. This looks like it
dcabasson wrote:
>
> That's actually possible. We are doing that type of things by using the
> @Autowired annotation, which means that spring needs to find a suitable
> bean to inject there. If you put that annotation on your base class, the
> instance will get injected in all sub-classes. B
Wes Wannemacher wrote:
>
> On Wed, May 12, 2010 at 10:42 AM, Dale Newfield wrote:
>>
>> That all sounds reasonable, except the part about putting it in the
>> session
>> instead of the request. If there's no compelling reason to store
>> something
>> in the session, I think that it should be
I'm pretty sure that ActionContext used to be an Interface (in Struts1?). I
know that it isn't in Struts2 because I've just tripped over that when
trying to create mocks for a set of Unit tests for an Interceptor.
Is there a reason why it changed?
Later,
Andy
--
View this message in context:
Following on from my previous question
(http://old.nabble.com/Some-Spring-Struts-questions-td28533505.html) about
injecting objects orthogonal to actions into the environment where jsps can
"see" them, I now have an interceptor that does what I want it do (Yay! -
thanks guys).
However, I'm seeing
RogerV wrote:
>
>
>
> Andy Law wrote:
>>
>> The pertinent code in the interceptor is reproduced below. It does what I
>> expect it to do insofar as it sticks my "Stuff" object in a place that
>> the JSP can retrieve it using the MAGIC_KEY str
Cheers Chris,
Chris Pratt wrote:
>
> You may want to think about using:
>
> invocation.getStack().getContext().put(MAGIC_KEY,getStuff());
>
> instead of:
>
> invocation.getStack().set(MAGIC_KEY,getStuff());
>
> For the sake of argument, I'm going to assume that MAGIC_KEY is set to the
> Str
DNewfield wrote:
>
> Anyway, glad you've solved your issue. Too bad we didn't all learn
> something from it :-)
>
Apologies for being late to the party, but this smells like a browser/proxy
cache issue to me?
Later,
Andy
--
View this message in context:
http://old.nabble.com/Bizarre-sp
I wrote:
>
> Apologies for being late to the party, but this smells like a
> browser/proxy
> cache issue to me?
>
and then
mgainty wrote:
>
>
> i agree with andy
>
> do a view source and tracert on all urls
>
> i it is possible you'll see there is a man-in-the middle proxy altering
> th
Heading off at a slight tangent, is it possible to use the constant values in
action configurations within the struts XML?
I have long thought it a code smell that I have magic strings in my XML
configuration that get repeated in my code. If I could handle those by
reference to a single point in
I'm trying to specify a CSS style to be applied to a table header row that
includes a reference to a background image (specifically as part of a table
that uses JQuery/tablesorter). It is causing me pain.
To clarify what may be a bit of a garbled question, my (final, effective)
html needs to look
Haroon Rafique wrote:
>
> On Today at 9:38am, AL=>Andy Law wrote:
>
> If your file structure is somewhat like:
>
> styles/base.css
> images/image.gif
>
> then you can simply change your background-image directive to say:
> background-image: url('../imag
Wes Wannemacher wrote:
>
> One thing I've done in the past is to treat CSS files as JSPs and use
> s:url tags or EL expressions (${contextRoot}/images/image.gif)...
>
>
Oh. That feels s dirty!!!
There has to be a cleaner way to do it.
Later,
Andy
--
View this message in context:
Haroon Rafique wrote:
>
> If your file structure is somewhat like:
>
> styles/base.css
> images/image.gif
>
> then you can simply change your background-image directive to say:
> background-image: url('../images/image.gif');
>
>
and
Musachy Barroso wrote:
>
> assuming your dir structur
I have actions that sit underneath a set of namespaces. The namespace conveys
a piece of information to the action like a poor-man's REST.
i.e.
/Cow/ShowDetails.action
/Pig/ShowDetails.action
etc.
I need to construct some links from within the JSP that is hit by the
individual actions and have
Lee Clemens-4 wrote:
>
> Doesn't seem to work, but maybe my description was unclear.
>
> I'm trying to get this:
> () OptA () OptB () OptC
>
> to look like this:
> () OptA
> () OptB
> () OptC
>
> theme="simple" prints them all in order
> theme="xhtml" prints them inside the same td tag (same
Shekher wrote:
>
> I am planing to use interceptor for this but not sure how to plan this
>
> as using interceptor can not gurantee a robust authenticate mechanism
> what i planned is as below
>
> if user provide the valid information store the user object in the session
> scoped map and for a
Shekher wrote:
>
> Hi All,
>
> We are developing an application based on Struts2 framework. We are on way
> to develop application based security so that the unauthorized user can
> not
> access the secure area,it needs the request to be from the authorized
> person.We can have the Below mentio
This may be trivial, in which case I apologise in advance.
I have an application that has several action classes (20 or so), each of
which belongs conceptually to a *group* of actions. I would like to be able
to extract lists of Actions by group from within a JSP/Action in order to
present them t
Is it deliberate that no reference to/configuration for the cookies
interceptor is provided in struts-default.xml in the 2.1 releases?
Obviously I can work around it by configuring in my struts.xml file but it
seems bizarre that the code exists and is included in the jar, but the
configuration is
Andy Law wrote:
>
> 've hit a painful problem as I try to migrate to 2.1.6 (from 2.0.14).
>
> I have a class that extends ActionSupport and which calls getText() from
> within a routine. I want to test the routine to ensure that it is working
> properly. My test runs f
All,
I've hit a painful problem as I try to migrate to 2.1.6 (from 2.0.14).
I have a class that extends ActionSupport and which calls getText() from
within a routine. I want to test the routine to ensure that it is working
properly. My test runs fine when I compile with 2.0.14 but disappears int
Musachy Barroso wrote:
>
> It is a bug. This interceptor was added in 2.0.7, and it was never
> added to struts-default.xml in the 2.1 branch. Just add this to your
> struts.xml:
>
> class="org.apache.struts2.interceptor.CookieInterceptor"/>
>
> for reference:
>
> https://issues.apache.org/s
27; and /bar/Action1.action
runs the same action passing in 'bar'.
How should I code/configure/build this kind of thing.
Thanks in advance for any guidance that anyone can give me.
Later,
Andy Law
-
--
View this message in context:
http://www.nabble.com/S2%3A-possi
Jeromy Evans - Blue Sky Minds wrote:
>
> Andy Law wrote:
>>
>> e.g.
>> /foo/Action1.action runs action1 passing in 'foo' and /bar/Action1.action
>> runs the same action passing in 'bar'.
>>
>> How should I code/configure/build this
Jeromy Evans - Blue Sky Minds wrote:
>
>
>> A short follow-up. Can you point me towards a description of where/when
>> the
>> Action object gets created and where Interceptors fit into the process.
>>
>
> The architect's guide is a good place to start.
>
> http://struts.apache.org/2.0.11.2/d
Jeromy Evans - Blue Sky Minds wrote:
>
>
> True. The Struts 2 in Action book goes into the next level detail:
>
> http://www.manning.com/dbrown/excerpt_contents.html
>
> but still doesn't cover exactly what you're trying to do. I know others
> works are in progress but not the details or sc
Is there any design reason why staticParams is not called before prepare in
the paramsPrepareParams stack?
Also, in a potential RFE sort of vein, would there be any support for a
request for a way of making staticParams non-overwritable? (i.e. the params
defined in the action configuration XML an
mgainty wrote:
>
>
> Andy-
> the short answer is you don't want
> user-set parameters to override your static parameters.
>
>
Well yes - but I need the parameters for doing some prepare() work. I can
see that staticParams fires after params in the default stack. I can also
see that params i
Gawain Hammond wrote:
>
> Thanks very much for your reply.
>
> The problem with this type of work around is that it completely messes up
> my fiendish master plan. If it wasn't for those pesky objects with null
> values! :-P
>
> You see, I've probably been a bit too clever for my own good, an
o keep all the tools
involved comfortable.
Thanks in advance for your suggestions and help.
Later,
Andy
-
Dr. Andy Law
Head of Bioinformatics - Roslin Institute
Unfortunately, legal niceties require me to add the following to this message...
The information conta
uot;name"/>">
>property="accession"/>"> property="accession"/>
>
>
>
>
> kind regards,
>
> frank
>
> > -Ursprüngliche Nachricht-
> > Von: andy law (RI) [mailto:[EMAIL PROTECTED]
> > Gesendet: Freitag
the latest jsp spec (tomcat5) you could try to use:
>
>
> alt="${element.name}">
> href="/module/action-path/${element.accession}">${element.acce
> ssion}
>
>
> It's certainly a little tidier!
>
> Regards,
>
> Gareth
&g
36 matches
Mail list logo