Barbara,

Answers inline as best I can.

On 9/12/02 3:27 AM, "Barbara Rosi-Schwartz"
([EMAIL PROTECTED]) penned the words:

> Hello everyone.
> 
> I have been spending the weekend familiarizing myself with WebWork, which I
> find to be a very interesting and promising tool, a big thank you to all the
> contributors. I have been reading the documentation and studying many of the
> examples and I have the following questions, to which I was not able to find
> an answer in the docs:
> 1. What is the difference between the attributes "value" and "page" inthe
> <webwork:url> tag?

Value is used to url encode an individual value from the stack, whereas page
is used to encode a complete URL.

> 2. What is the rationale behind the decision to use an "id" attributewhen
> pushing something on the ValueStack? How do I decide whether I wantto retrieve
> a value from the stack using the object's id, using nothing orusing ".", "..",
> "/"? From my ignorant perspective, I would choose to alwaysuse an id attribute
> as it seems the safest procedure, which avoids my havingto "manage" the
> ValueStack by hand, but I am not sure if these various approachesare
> equivalent, if they imply different performance characteristics or if,indeed,
> they have profoundly different meanings and repercussions.

You should basically never need to use the id attribute.

It is _only_ used when you want to pull a value off the value stack and put
it into the page scope (to use with other tags for example). I have never
needed to use it.

> 3. When the default is called on an Action (xxx!default.action) does italways
> mean that the jsp corresponding to INPUT is invoked? It does not seemto be the
> case in the EventHandler example with the Login action, see index.jspand
> views.properties. How then, in that case, is login.jsp invoked?

I'm not sure about the example, but the input view will always be called
unless doDefault() returns something different.

> 4. 

Yes :)

> 5. When implementing an Action, how do we decide if we need to
> implementexecute(), doExecute() or both? Does it have to do with whether or
> not weneed to do validation?

It depends, if your action just IMPLEMENTS 'Action' then you need to
obviously implement execute().

If your action EXTENDS 'ActionSupport' then you usually need a combination
of doExecute(), doValidation() and doDefault(). 99% of the time you won't
need to override execute().

> 6. In the DateSelector example, why use the MonthSelector action withthe
> <webwork:action> tag  rather than a normal bean and the <webwork:bean>tag,
> seeing how the action in question only has getter/setter methods andno execute
> is invoked on it? Is it simply good refactoring practice, seeinghow the other
> action, MonthList, which has a meaningful doExecute() method,requires the same
> setters and getters or is there a more profound reasonfor it?

I have no idea about the examples, but it may have just been written to
illustrate how to use the tag, rather than as an example of best practices?

Cheers,
Mike



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to