VERSIONARY::BLOG






Recent Entries
firefox os x tricks
Let your Struts DispatchActions Fall through
thoughts on tapestry
#1
Netgear WGR614v2 stinks!
10 years? oh my
Riding through Chernobyl
Thoughts on Class Naming
One Tabbed Browser to Rule them All
The Fog of War


Monthly Entries
October 2004
August 2004
July 2004
June 2004
April 2004
March 2004
November 2003
October 2003
September 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003


Links n' Stuff

Wil Wheaton

JGuru
IntelliJ Tech Net
Oracle Tech Net
The Serverside
Javaranch Forums
JavaLobby

Coast to Coast
Terry Tate: My Hero



Categories
everything else
java
 


January 31, 2003

Looking for more Webwork insight

*oops* I Re-added my blog today, and it looks like every entry got put on todays list somehow...sorry

So, I just wanted to start out saying that the more I interact with Webwork the more I enjoy the ride and thanks to Epesh, Jason Carreira and Llucifer I have a much better understanding now, thanks you guys!

One of my questions, coming from struts ideas to webwork ideas, and looking through example code and such, is that it seems Actions have request data tied into them in other words there is no ActionForm/Javabean like seperation, and every data field has protected access instead of private,I'm used to having properties be private so I initially wrote them with that visibility, but that breaks the property stack? My terminology may be off, but I hope I'm getting my confusion across. Is this how its supposed to be? I kind of think the idea of the ActionForm and Action is good.

Actually what I really think would be great is if I didnt have to write any code to deal with request parameters at all or write beans for them,Let the framework take care of it. if I could just specify parameter names I'm expecting in views.properties, that would be cool! eg

login.action=LoginAction
login.sucess=index.jsp
login.failure=login.action
login.parameters=name,password

And then my action and view could just automagically pick up these values with getter/setters or property attribues provided by the framework.

Posted by Andre Mermegas at January 31, 2003 01:24 AM | TrackBack
Comments

Hi again Andre! I'm glad you're making progress with Webwork.


With Webwork you can choose to either have the properties right in the Actions (like merging the Action and ActionForm) or to populate a separate bean using BeanUtil.setProperties(ActionContext.getParameters(), new myFormBean)


Your properties don't have to be protected. Webwork uses reflection to find the get and set methods for your properties, so if you have (in your action):

public void setFoo(String foo)

and
public String getFoo()


then, if there is a parameter "foo" in your request (either in the URL or as a POST param), then Webwork will find the setFoo() method and call it to populate your action for you. So it's even easier than your example, because you don't have to tell Webwork what to look for!

Posted by: Jason Carrerira on January 31, 2003 11:20 AM

You could join the WW list: http://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

People there are friendly and helpful, except for that FreeMarker tool who dropped in the other day (he appears to be gone now).

Posted by: Steve Conover on January 31, 2003 02:32 PM

ohhh cool! =D

Posted by: Andre Mermegas on January 31, 2003 03:46 PM

Ok quickie question if you use the BeanUtil.setProperties(ActionContext.getParameters(), new myFormBean) way, how do you access the property in , which doesnt seem to be working.

Posted by: Andre Mermegas on January 31, 2003 08:18 PM
Post a comment



















October 2004
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31