No, its not a runtime expression.
If you look at the code in FormTag you'll see that its not
results.append("\" action=\"");
results.append(response.encodeURL(RequestUtils.getActionMappingURL(action,
pageContext)));
results.append("\"");
It simply pulls the action mapping from the config.
I changed my code to
results.append("\" action=\"");
// check if we have a bean thats exposing a formaction property, if so, use that
property, otherwise use our assigned action value in the jsp page
try {
Object value = RequestUtils.lookup(pageContext, beanName,"formaction", null);
if (value != null && !value.toString().equals(""))
{
this.action=ResponseUtils.filter(value.toString());
System.out.println(value.toString());
}
} catch (Exception e)
{
e.printStackTrace();
}
results.append(response.encodeURL(RequestUtils.getActionMappingURL(action,
pageContext)));
*********** REPLY SEPARATOR ***********
On 03/14/2003 at 9:50 AM Jose Gonzalez Gomez wrote:
>Mark,
>
> Please, correct me if I'm wrong, but I think the action attribute in
>the <html:form> tag is a run time expression, so there's no need to
>extend the FormTag class in order to use a dynamic form action.
>
> Regards
> Jose
>
>Mark wrote:
>
>>I just wanted to pass on a tidbit that might help one or two people out there.
>>
>>I have a search page that displays the results with checkboxes. There are two or
>>three different places that i use this same search page, so rather than writing or
>>copying the search results jsp page to several copies (to allow me to post the form
>>thats on the results page to a different forward definition) i made a modifiecation
>>to struts.
>>
>>In the FormTag.java I added some code to peek in the formbean for a property called
>>"formaction". If it finds one, it uses this new action instead of the hard coded
>>one in the jsp page.
>>
>>Thus, in my action class i do this:
>>
>>MyBean myBean=(MyBean)actionForm;
>>
>>myBean.setFormaction("/Some/other/url");
>>return mapping.findforward("default");
>>
>>now i have a jsp page which i can reuse its functionality in several places in my
>>code.
>>
>>I had thought about using a hidden field, but the problem really stems from the
>>statically coded form action="/Url" part. Since struts doesnt allow us much
>>flexibility here by default, I decided to add my own and it works great!
>>
>>Regards,
>>Mark
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]