On 4/20/07, Nathan Anderson <[EMAIL PROTECTED]> wrote:
Howdy folks,

I have a pretty simple AppFuse 2.0-M4 Struts 2 app that has an object
that has a ManyToOne relationship to User.  The idea is this object is
created by or owned by the user who added it [only an admin can edit the
user, yadda yadda]. So in my save method of my action I tried the
following and got a stack trace close to 1000 lines long...

            User user = (User)userManager.get(User.class, userId);

Is userId a Long? I believe this should work.


So my first question is, since UserManager extends UniversalManager
shouldn't this work?  I later found the UserManager.getUser(Strind id)
method and got it working on the first try.  But that brings me to my
second question...  Why does UserManager.getUser get a String argument
if the ID is Long?  Is it to make it easier to support some other web
framework [e.g. Struts 1]?

Yes, this was leftover from Struts 1.x support. At the time, I passed
in a String to make it easier to do
getUser(request.getParameter("id")). We could certainly change this to
a Long to clean things up.


I think I'm starting to get this stuff and I must say the other AppFuse
[1.8+] developer over here is drooling at how much easier and cleaner
things are with maven and Struts 2 compared to ant and Struts 1.

Nice!

Matt


Thanks,
Nathan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to