users@woodstock.java.net

How to overwrite html:form[_at_action] in webuijsf:form?

From: Hui Ming Teo <teohuiming_at_gmail.com>
Date: Thu, 17 Jan 2008 14:39:28 +0800

Hi all, I have a question:

is it possible to configure <webuijsf:form> so that the rendered HTML
form has an empty action attribute? i.e. <html:form action="">, so
that the form's action URL always points to the current page [1].

In my project, I have a submission form. The form is displayed when
user follows a hyperlink with query string (e.g.
/faces/editForm.jsp?item=123). It is important to retain the query
parameter in the URL when user submit the form.

However, using <webuijsf:form>, HTML form is rendered with an action
attribute pointing to the JSP page (e.g. <form
action="/faces/editForm.jsp">), instead of the *current* page (e.g.
<form action="/faces/editForm.jsp?item=123"> or <form action="">). Is
there a possible workaround to resolve this issue?

[1] http://tools.ietf.org/html/rfc2396#section-4.2 - URI Syntax: 4.2
Same-document References


Thanks,
-- 
Teo Hui Ming