Hi list,
I'm extending the StrutsTypeConverter and writing my own type converter. Is
there any way to have the type converter reference multiple fields in order to
construct a complex type?
I notice the method signature for convertFromString has three parameters - one
of them is a String array
You could write your own type converter - see type conversion in the S2 docs
for a good overview. It handles the conversion of any Java object in your model
class to a String for use in the view, and converts any String field into a
Java object in forms/GET parameters.
That way you have total c
Hi all,
How can I use parameters passed in to a jsp file with in a
Struts2 tag within that JSP?
So for example, I want to include a big chunk of boilerplate HTML and
pass in an image name, then use that passed-in name in an tag
to reference it.
Include:
prettything.jpg
The
Out of interest (and sorry for slight thread hijacking) - what's so
bad about the Dojo tags?
Now the Dojo stuff is deprecated, is there a roadmap to replacing them
with something else?
On 17 Apr 2009, at 20:30, Musachy Barroso wrote:
I am not sure it is related, but make sure "showLoading
DWR is bloody ace - don't know how that slipped under my radar. Cheers
for the heads-up.
Andy.
On 17 Apr 2009, at 21:24, Musachy Barroso wrote:
I am not sure what the status of the DWR plugin is, but I don't think
it has changed much. The DWR plugin just hooks DWR with Struts 2,
nothing more
Abstract the HashMap behind another class that has a getTotal(Item
key) method, and do the math in there (return item.prize * quantity).
Doing any math in the JSP feels dirty.
On 22 Apr 2009, at 13:16, Stefano Tranquillini wrote:
Because the items are stored in hashmap item
contains the
p
Have a look at the external sorting and pagination page[1] on the
DisplayTag site. Also, take a look at the PaginatedList interface[2].
It takes a little bit to get your head around it.
If you get stuck, the displaytag lists are pretty good at helping with
the common issues.
Andy.
[1] ht
I found I had to use the tag to set the object in the request
scope before displaytag could "see" it, since displaytag doesn't know
about the Value Stack (maybe it should?). Confusingly, displaytag
gives you that message if it can't see the variable you're
referencing, as well as if the va
Hi all,
Is there a way to prevent OGNL from analysing GET parameters as
expressions?
Reason for asking:
DisplayTag generates URLs like this: action?d-49653-p=2
I'm getting tons of errors in the log, where it looks like OGNL is
trying to evaluate this as: (d minus 49653 minus p). Naturally
f
the regex, will be ignored. We should make a FAQ out of this question.
musachy
On Thu, Apr 30, 2009 at 3:47 PM, Andy Sykes wrote:
Hi all,
Is there a way to prevent OGNL from analysing GET parameters as
expressions?
Reason for asking:
DisplayTag generates URLs like this: action?d-49653-p=2
I wrote my own method based on having three select dropdown boxes for
the date - day, month and year.
Rather than do it as a type converter, I did it as an interceptor,
with three getters/setters in the action (getStartTime_Day,
getStartTime_Month, getStartTime_Year). The interceptor uses
I can't see anywhere in the documentation (I've only had a quick skim
of it) that says not mapping the Struts dispatcher to /* can be
dangerous.. the only example I can see is if you're using Struts
interceptors/actions for webapp security - in which case hitting a
servlet directly might me
1. It's created when the Struts dispatcher filter receives a request
that matches an element in the XML configuration file. Xwork
handles the creation, I believe (Struts internal DI framework). You're
running with Spring as the container, which mean Spring does the
action creation based on
Put the mapping for the admin filter above the struts2 filter. Filters
are invoked in the order in web.xml, first to last.
The struts filter is catching the request first and dispatching it
before it ever reaches the admin filter.
On 20 May 2009, at 09:37, Stefano Tranquillini wrote:
Hi a
urce (/WAP-Shop-war/denied.action) is
not available.
but is available!
ideas?
On Wed, May 20, 2009 at 13:35, Andy Sykes wrote:
Put the mapping for the admin filter above the struts2 filter.
Filters are
invoked in the order in web.xml, first to last.
The struts filter is catching the request
Read the section on the config file elements in struts.xml on the
Struts2 docs site. Also read the Interceptors guide[1].
You have to specify the interceptor stack on the action. You can use
the element to specify what stack to use by
default.
And what you've defined is not an intercepto
Hi all,
Is anyone else using NB 6.7 RC3 and editing pages with S2 tags in them?
The tags seem to really screw up the editor's error parsing mechanism,
leaving red lines under everything after an S2 tag (like
), and giving an error of "missing ; before statement"
which looks like a Javascri
Faraz,
When using validation, the input result tells Struts where to dispatch/
redirect to if there's a validation error. When you submit the form,
Struts checks the fields against the validation XML - if there's an
error, it adds FieldError objects to the FieldErrors object on the
value s
Wed, Dec 10, 2008 at 6:19 PM, Andy Sykes <[EMAIL PROTECTED]> wrote:
Faraz,
When using validation, the input result tells Struts where to
dispatch/redirect to if there's a validation error. When you submit
the
form, Struts checks the fields against the validation XML - if
there
I could be wrong, but I thought you could only pass the FieldErrors
back to a JSP using a dispatcher result, not a redirect-action.
Andy.
On 12 Dec 2008, at 12:34, Seshagiri V wrote:
Hi All,
Mapping with redirection type and name is "input" and value is null
but I am
not able to valida
pproaching the rich forms generation the wrong
way, and there's a better way?
Thanks for any advice, since I'm banging my head against the wall on
this - I must be missing something obvious.
Cheers,
Andy.
--
Andy Sykes
IT Support Officer
UCL Museums & Collections /
Media Res
.
Andy.
On 13 Dec 2008, at 16:26, Andy Sykes wrote:
Hi all,
I've got an action called "edit" that prepares some objects for use
in a form (Lists for select tags, etc), then dispatches to the JSP
form. It's dependent on having a parameter passed to it via a GET
url (e.g
Hi,
No idea why it doesn't work - I found the XHTML theme to be a bit
cumbersome for anything other than a stack of fields, one on top of
the other.
Use the simple theme - it'll give you more flexibility. You can write
your own themes as well.
For getting the validation errors in the si
Hi,
My simple solution to the same problem was to check if any validation
errors had occurred at the end of the validation method [with
hasFieldErrors()], then call my prepareXXX method from there.
On 16 Dec 2008, at 05:39, srinivasa_v . wrote:
Hi All,
I have sistutation where I need to
If you're running with log4j in your app, set the logging priority on
the root logger to debug. It spews a lot of messages, and the type
converter messages are there - I was using this facility the other day
when trying to upgrade an existing app from 2.0.x to 2.1.2.
Andy.
On 9 Jan 2009, a
Hi all,
My forms all submit to a different action than that which renders the
pages.
Is there a recommended way to prevent/mitigate the effect of users
directly calling the actions (via their URL) that forms are submitted
to? In this case, the actions' fields are null, which is somewhat
herwise!
Andy.
On 24 Jan 2009, at 02:52, Dave Newton wrote:
Andy Sykes wrote:
My forms all submit to a different action than that which renders
the pages.
Is there a recommended way to prevent/mitigate the effect of users
directly calling the actions (via their URL) that forms are
submit
Hi,
We've migrated an app from 2.0.11 to 2.1.2 (and then to 2.1.6 when it
became GA - this was a trivial upgrade).
I found this article on the Apache wiki very useful:
http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html
I had no major issues - and the
action's own result code will override the interceptor-set
result.
Andy.
On 24 Jan 2009, at 17:56, Dave Newton wrote:
Andy Sykes wrote:
Cheers for the suggestions - I guess I was just looking for a
sanity check from the list.
It seems reasonable to me--the functionality *could* be
Doh. I was being very stupid - I looked in the XWork source and
realised it's really straightforward.
I'm blaming this one of lack of sleep :)
Cheers,
Andy.
On 25 Jan 2009, at 01:25, Wes Wannemacher wrote:
On Saturday 24 January 2009 20:17:49 Andy Sykes wrote:
Actually,
Hi all,
I've written an interceptor with a PreResultListener that gets the
action with ActionInvocation.getAction(), then casts it to an
interface ("Parseable", in this case). This lets me call a particular
method on the action just prior to the result being rendered.
The action implement
at 00:55, Wes Wannemacher wrote:
On Thursday 29 January 2009 19:49:39 Andy Sykes wrote:
Hi all,
I've written an interceptor with a PreResultListener that gets the
action with ActionInvocation.getAction(), then casts it to an
interface ("Parseable", in this case). This lets me call
rchy? That could explain certain
"should never happen" incidents...
Nils-H
On Fri, Jan 30, 2009 at 12:39 PM, Andy Sykes
wrote:
Hi Wes,
No, I'm not using Spring at all.
The Action never passes the test of being an instanceof Parseable.
If I make
the action only impleme
...snip...
if (action instanceof SessionAware) {
((SessionAware)
action).setSession(context.getSession());
}
}
}
On 30 Jan 2009, at 12:22, Andy Sykes wrote:
No, I don't 'need' the ca
ng this.
Cheers for the help,
Andy.
On 30 Jan 2009, at 15:03, Dave Newton wrote:
If you have a small project you could host somewhere that might
help, or just zip up all the source. Clearly this can't happen
(ignoring for the moment that it is), but the framework obviously
relies on t
Hi list,
After bodging my way through some pagination for a project I'm working
on with a combination of OGNL expressions, s:subset and s:iterator, I
was wondering if anyone had given any serious thought to the
practicality of implementing displaytag-style pagination in S2 tags?
Display t
36 matches
Mail list logo