struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: Override form action URL
Date Wed, 09 Jun 2004 11:21:00 GMT
Assuming you could do this, how then does struts know when you submit to
"/test/a/" what action to run and for what reason "would like to avoid
exposing the action URL"?

Niall

----- Original Message ----- 
From: "Eric Jain" <Eric.Jain@isb-sib.ch>
To: <user@struts.apache.org>
Sent: Thursday, June 03, 2004 11:25 AM
Subject: Override form action URL


> I have:
>
> <html:form action="/search" method="get">
>    <html:text property="query"/>
>    <html:hidden property="dataset" value="a"/>
> <html:form>
>
> which generates:
>
> <form name="form" action="/test/search" method="get">
>    <input type="text" name="query">
>    <input type="hidden" name="dataset" value="a">
> </form>
>
> This works, but I would like to avoid exposing the action URL and return
> this instead:
>
> <form name="form" action="/test/a/" method="get">
>    <input type="text" name="query">
> </form>
>
> There is a servlet filter that will internally forward '/test/a/' to
> '/test/search?dataset=a'.
>
> An obvious solution would be:
>
> <form action="/test/a/" method="get">
>    <html:text property="query"/>
> <form>
>
> Unfortunately this does not work as the html:text tag looks for a scoped
> attribute that is set by the html:form tag.
>
> Is there an alternative to html:form, that sets the same attributes,
> but does not print anything?
>
> <html:action action="/search">
>    <form action="/test/a/" method="get">
>      <html:text property="query"/>
>    <form>
> </html:action>
>
> Or could the generated action URL be overridden somehow?
>
> <html:form action="/search" url="/test/a/" method="get">
>    <html:text property="query"/>
> <html:form>
>
> There must be a way...
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message