struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Joseph Krogh <andr...@officenet.no>
Subject Scala and s:iterator
Date Sun, 24 May 2009 19:36:48 GMT
Hi all.
Normally this kind of post would be better posted to -users, but I'm looking for the developers
comments on this.

Anyone have any experience using Scala with Struts2? I'm especially thinking about s:iterate
and scala.List.

I've managed to use s:iterate with Scala's List like this:
<s:iterator value="%{getMyList().toArray().unbox(@java.lang.Object@class)}" status="status">
getMyList() returns a scala.List from my Scala-object, which I convert to an JAVA-array using
toArray().unbox().

This seems very hackish and it would be cool if one could make a "struts2-scala-plugin" which
registered some kind of Iterator which the IteratorComponent could use, refactoring out the
call to "MakeIterator.convert(findValue(value))" to a factory of some kind which checked some
kind of registry for providing a proper Iterator for the Scala-object returned by findValue(value).

Comments?

-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Rosenholmveien 25       | know how to do a thing and to watch         |
1414 TrollÄsen          | somebody else doing it wrong, without       |
NORWAY                  | comment.                                    |
                        |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message