I've been trying to understand how parameterized results should work under the
SmartURLs plugin for Struts 2.  In my specific case, I'm trying to redirect on
success to a new URL that includes a paramter.  I've tried modelling it after
the standard XML=based example in the WebWork in Action book on page 191:

  <result name="success"
type="redirect">order-confirmation.jsp?confirmationNumber=${confirmationNumber}</result>

So I tried
@Results({
  @Result(name="success",location="/competitions/admin?id=${getCompId}",
type="redirect")})

However nothing gets injected into the variable.  I've tried several different
formulations of the variable: getCompId, getCompId(), compId, etc.   Currently
I have a simple method on the action:
  public String getCompId() {return (comp!=null ? comp.getId().toString() :
"0";}

(In reality "0" should never be returned, but I wanted an explicit value to be
able to tell if I've hooked up the paramter correctly, versus having access to
the Id in the first place.)

When I try to follow along directly with the XML based approach the
action/results from struts.xml seem to interact poorly with the other
annotation based configurations and I can't seem to chase down what would make
a valid hybrid configuration.

Cna anyone give me some pointers on how to either make paramterized locations
work with SmartURLs or, how to configure these results in struts.xml wtthout
interfereing too much with the other convention/annotations based approaches?

Thank you.

Eric

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

Reply via email to