Element:
<element id="AUTH" extends="rife/authenticated/mixed.xml">...</element>
<element id="ContestEntryAdd"
implementation="com.frnews.web.rife.element.contest.entry.ContestEntryAdd"
url="/contest/add/*" pathinfo="strict" inherits="AUTH">
<pathinfo mapping="$contestItemId"/>
....
</element>
When there's no logined user, this element shows login form.
Template:
<form name="credentials" action="[!V 'SUBMISSION:FORM:credentials'/]"
method="post">
...
</form>
The wrong behavior is next.
I come to URL:
http://localhost:8080/contest/add/1
And login form is shown:
<form name="credentials" action="/contest/add" method="post">
It has wrong action url "/contest/add" but it should be "/contest/add/1"
And after submit i see 404 because there're no elements by "/contest/add" url.
------
...
// only substitute the template value if it hasn't been specified yet
// this allows for user overriding
if (!template.isValueSet(submission_form_value_id))
{
template.setValue(submission_form_value_id, getSubmissionFormUrl(null).encoder(encoder));
set_values.add(submission_form_value_id);
}
...
-----
ElementContext.getSubmissionFormUrl(String pathinfo) needs the pathinfo in order to be able to tack it onto the submission. It is currently hard coded to null instead of passing something appropriate (something from ElementInfo?). There may be other problems, but this line of code is probably involved. :)
Possible solution: Can we use the raw request url? Perhaps we would still need to filter GET parameters...
Reference url for code (ElementContext.java rev=3738):
http://rifers.org:8088/fisheye/browse/~raw,r=3738/rifers/rife/trunk/src/framework/com/uwyn/rife/engine/ElementContext.java