You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lucas Garcia <lu...@gmail.com> on 2007/06/01 11:06:04 UTC

Creating actions without context

Hi,

I'm using s:url and s:form tags to build url's and form's. In a case, I want
to use s:form and I don't want that taglib put the application context in
the finally action.

E.g.:

<s:form action="Sitemap"> is traduce as <form action="/myapp/Sitemap">, but
I want <form action="/Sitemap">

How can I do this?

Greetings

Re: Creating actions without context

Posted by Lucas Garcia <lu...@gmail.com>.
Hey Musachy,

Thanks a lot for the replying :) Finally I've found a solution through
Apache + Tomcat way (rewrite rules).

Cheers!


On 6/1/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> The url has an 'includeContext' param:
>
> http://struts.apache.org/2.x/docs/url.html
>
> As for the form, if it finds the action, it will append the context.
> I'm not sure how you could avoid that one. You can always overwrite
> the form template. Or use the form  on the simple theme(not good as
> you would lose layout, validation, etc)
>
> regards
> musachy
>
> On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
> > Hi Musachy,
> >
> > Yes, the url must be a "wrong" URL. I have an Apache web server and a
> tomcat
> > colaborating together. My application context is /myapp/, but I don't
> want
> > that the users can see the context (and I don't want to deploy the
> > application in / because I'll create more web applications).
> >
> > I have create an apache rule (RewriteRule ^(.*) /myapp$1 [PT]) to accept
> /
> > petitions and add the /myapp/ context "automatically". Nevertheless,
> s:url
> > and s:form are creating url's with the context, whereas the apache web
> > server is waiting for url's without context.
> >
> > Is it possible to create url's without context? (maybe my solution to
> hide
> > the application context is wrong, but I believe if struts can create
> url's
> > without context, the solution can works fine).
> >
> > Greetings
> >
> >
> > On 6/1/07, Musachy Barroso <mu...@gmail.com> wrote:
> > >
> > > In that case the form would be submitted the wrong URL right? Can you
> give
> > > some more details on why you need this?
> > >
> > > regards
> > > musachy
> > >
> > > On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'm using s:url and s:form tags to build url's and form's. In a
> case, I
> > > > want
> > > > to use s:form and I don't want that taglib put the application
> context
> > > in
> > > > the finally action.
> > > >
> > > > E.g.:
> > > >
> > > > <s:form action="Sitemap"> is traduce as <form
> action="/myapp/Sitemap">,
> > > > but
> > > > I want <form action="/Sitemap">
> > > >
> > > > How can I do this?
> > > >
> > > > Greetings
> > > >
> > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the stone?" Pink Floyd
> > >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Creating actions without context

Posted by Musachy Barroso <mu...@gmail.com>.
The url has an 'includeContext' param:

http://struts.apache.org/2.x/docs/url.html

As for the form, if it finds the action, it will append the context.
I'm not sure how you could avoid that one. You can always overwrite
the form template. Or use the form  on the simple theme(not good as
you would lose layout, validation, etc)

regards
musachy

On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
> Hi Musachy,
>
> Yes, the url must be a "wrong" URL. I have an Apache web server and a tomcat
> colaborating together. My application context is /myapp/, but I don't want
> that the users can see the context (and I don't want to deploy the
> application in / because I'll create more web applications).
>
> I have create an apache rule (RewriteRule ^(.*) /myapp$1 [PT]) to accept /
> petitions and add the /myapp/ context "automatically". Nevertheless, s:url
> and s:form are creating url's with the context, whereas the apache web
> server is waiting for url's without context.
>
> Is it possible to create url's without context? (maybe my solution to hide
> the application context is wrong, but I believe if struts can create url's
> without context, the solution can works fine).
>
> Greetings
>
>
> On 6/1/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > In that case the form would be submitted the wrong URL right? Can you give
> > some more details on why you need this?
> >
> > regards
> > musachy
> >
> > On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I'm using s:url and s:form tags to build url's and form's. In a case, I
> > > want
> > > to use s:form and I don't want that taglib put the application context
> > in
> > > the finally action.
> > >
> > > E.g.:
> > >
> > > <s:form action="Sitemap"> is traduce as <form action="/myapp/Sitemap">,
> > > but
> > > I want <form action="/Sitemap">
> > >
> > > How can I do this?
> > >
> > > Greetings
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Creating actions without context

Posted by Lucas Garcia <lu...@gmail.com>.
Hi Musachy,

Yes, the url must be a "wrong" URL. I have an Apache web server and a tomcat
colaborating together. My application context is /myapp/, but I don't want
that the users can see the context (and I don't want to deploy the
application in / because I'll create more web applications).

I have create an apache rule (RewriteRule ^(.*) /myapp$1 [PT]) to accept /
petitions and add the /myapp/ context "automatically". Nevertheless, s:url
and s:form are creating url's with the context, whereas the apache web
server is waiting for url's without context.

Is it possible to create url's without context? (maybe my solution to hide
the application context is wrong, but I believe if struts can create url's
without context, the solution can works fine).

Greetings


On 6/1/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> In that case the form would be submitted the wrong URL right? Can you give
> some more details on why you need this?
>
> regards
> musachy
>
> On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
> >
> > Hi,
> >
> > I'm using s:url and s:form tags to build url's and form's. In a case, I
> > want
> > to use s:form and I don't want that taglib put the application context
> in
> > the finally action.
> >
> > E.g.:
> >
> > <s:form action="Sitemap"> is traduce as <form action="/myapp/Sitemap">,
> > but
> > I want <form action="/Sitemap">
> >
> > How can I do this?
> >
> > Greetings
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>

Re: Creating actions without context

Posted by Musachy Barroso <mu...@gmail.com>.
In that case the form would be submitted the wrong URL right? Can you give
some more details on why you need this?

regards
musachy

On 6/1/07, Lucas Garcia <lu...@gmail.com> wrote:
>
> Hi,
>
> I'm using s:url and s:form tags to build url's and form's. In a case, I
> want
> to use s:form and I don't want that taglib put the application context in
> the finally action.
>
> E.g.:
>
> <s:form action="Sitemap"> is traduce as <form action="/myapp/Sitemap">,
> but
> I want <form action="/Sitemap">
>
> How can I do this?
>
> Greetings
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd