You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pb...@apache.org> on 2010/01/03 08:28:41 UTC

Re: how do I use absolute url actions in html:form tag with struts 1.3.8

I don't think you can. Why would you want to?

On Tue, Dec 22, 2009 at 8:01 PM, Jason Novotny <ja...@gmail.com> wrote:
> Hi,
>
>    I'm a Struts newbie and am tasked with trying to change relative URLs on
> our site to be absolute. I have a form that looks like:
>
> <html:form action="/fcon/MyAction">
>
> and once it renders it displays:
>
> <form id="myForm" method="GET" action="/modules/mymodule/fcon/MyAction.do"
> onsubmit="return validateFilterForm(event, this);">
>
> What I'd like is to have it render an absolute URL:
>
> <form id="myForm" method="GET"
> action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"
> onsubmit="return validateFilterForm(event, this);">
>
> How can I do this?
>
>    Thanks a lot, Jason
>
> ---------------------------------------------------------------------
> 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


Re: how do I use absolute url actions in html:form tag with struts 1.3.8

Posted by Brian Thompson <el...@gmail.com>.
I'll echo the question of "why would you want to?", but it's easy to
accomplish if you're not insistent on using the <html:form> tag:

<form id="<html:property value="%{myForm}"/>" method="GET"
action="<html:property value="%{fullUrl}"/>">

...

</form>

-Brian

P.S. Is it just me, or is the documentation on the struts form tag a bit
lacking in examples?



On Sun, Jan 3, 2010 at 1:28 AM, Paul Benedict <pb...@apache.org> wrote:

> I don't think you can. Why would you want to?
>
> On Tue, Dec 22, 2009 at 8:01 PM, Jason Novotny <ja...@gmail.com>
> wrote:
> > Hi,
> >
> >    I'm a Struts newbie and am tasked with trying to change relative URLs
> on
> > our site to be absolute. I have a form that looks like:
> >
> > <html:form action="/fcon/MyAction">
> >
> > and once it renders it displays:
> >
> > <form id="myForm" method="GET"
> action="/modules/mymodule/fcon/MyAction.do"
> > onsubmit="return validateFilterForm(event, this);">
> >
> > What I'd like is to have it render an absolute URL:
> >
> > <form id="myForm" method="GET"
> > action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"
> > onsubmit="return validateFilterForm(event, this);">
> >
> > How can I do this?
> >
> >    Thanks a lot, Jason
> >
> > ---------------------------------------------------------------------
> > 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
>
>