You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Jasnowski <mj...@bea.com> on 2003/09/16 16:28:48 UTC

RE: Reuse of JSP's and relative links

You might be able to do this with an onsubmit handler

ie.. <html:form onsubmit="this.location.href='/Show.do'">

-----Original Message-----
From: Daniel Wang [mailto:ddwang@anomaly.net]
Sent: Wednesday, September 17, 2003 10:29 AM
To: Struts Users Mailing List
Subject: Re: Reuse of JSP's and relative links


You can't.  :(

----- Original Message -----
From: "Anders" <an...@f12.no>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, September 17, 2003 7:24 AM
Subject: Re: Reuse of JSP's and relative links


> Ah, great! :)
>
> How can i do the same thing in the <html:form> tag? Anyone knows?
>
> Thanks,
> Anders,
>
> On Wed, 17 Sep 2003, Daniel Wang wrote:
>
> > use href as opposed to page
> >
> > i.e. <html:link href="Show.do">
> >
> > ----- Original Message -----
> > From: "Anders" <an...@f12.no>
> > To: <st...@jakarta.apache.org>
> > Sent: Wednesday, September 17, 2003 7:07 AM
> > Subject: Reuse of JSP's and relative links
> >
> >
> > > Hi,
> > >
> > > How can i get html:link to use relative links?
> > >
> > > I'm trying to reuse actions and JSP several places under different
paths.
> > > My problem is:
> > >
> > > The user enters through /secure/articles/Show.do and it displays the
page
> > > with articles. The links on the page lets you go to the next page and
read
> > > the full article.
> > >
> > > I then use the same action class for /secure/news/Show.do, and want to
use
> > > the same JSP's. It all works fine until the user clicks a link which
> > > directs him to /secure/articles/Show.do?page=2 .
> > >
> > > How can i make html:link use relative paths? I would like to specify
> > > html:link action="Show.do?page=2" and that would lead to
> > > /secure/news/Show.do because the originating url said so.
> > >
> > > Thanks,
> > > Anders,
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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



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


RE: Reuse of JSP's and relative links

Posted by Mike Jasnowski <mj...@bea.com>.
Actually now that I think about it I'm not sure you'd be able to change the
"action" attribute of the form tag during onsubmit. It might be too late at
that point.

-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Tuesday, September 16, 2003 10:46 AM
To: Struts Users Mailing List
Subject: RE: Reuse of JSP's and relative links


Ahh good point, I was thinking I guess in terms if it was launched from a
button.

-----Original Message-----
From: Daniel Wang [mailto:ddwang@anomaly.net]
Sent: Wednesday, September 17, 2003 10:39 AM
To: Struts Users Mailing List
Subject: Re: Reuse of JSP's and relative links


Actually you probably don't want to do the extra "this.submit()" from within
a submit handler -- it'll create an endless loop

onSubmit should submit the form unless a FALSE is returned

----- Original Message -----
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 7:31 AM
Subject: RE: Reuse of JSP's and relative links


> Or
>
> <html:form onsubmit="this.action='/Show.do';this.submit();">
>
> -----Original Message-----
> From: Mike Jasnowski [mailto:mjasnows@bea.com]
> Sent: Tuesday, September 16, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: RE: Reuse of JSP's and relative links
>
>
> You might be able to do this with an onsubmit handler
>
> ie.. <html:form onsubmit="this.location.href='/Show.do'">
>
> -----Original Message-----
> From: Daniel Wang [mailto:ddwang@anomaly.net]
> Sent: Wednesday, September 17, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: Re: Reuse of JSP's and relative links
>
>
> You can't.  :(
>
> ----- Original Message -----
> From: "Anders" <an...@f12.no>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, September 17, 2003 7:24 AM
> Subject: Re: Reuse of JSP's and relative links
>
>
> > Ah, great! :)
> >
> > How can i do the same thing in the <html:form> tag? Anyone knows?
> >
> > Thanks,
> > Anders,
> >
> > On Wed, 17 Sep 2003, Daniel Wang wrote:
> >
> > > use href as opposed to page
> > >
> > > i.e. <html:link href="Show.do">
> > >
> > > ----- Original Message -----
> > > From: "Anders" <an...@f12.no>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Wednesday, September 17, 2003 7:07 AM
> > > Subject: Reuse of JSP's and relative links
> > >
> > >
> > > > Hi,
> > > >
> > > > How can i get html:link to use relative links?
> > > >
> > > > I'm trying to reuse actions and JSP several places under different
> paths.
> > > > My problem is:
> > > >
> > > > The user enters through /secure/articles/Show.do and it displays the
> page
> > > > with articles. The links on the page lets you go to the next page
and
> read
> > > > the full article.
> > > >
> > > > I then use the same action class for /secure/news/Show.do, and want
to
> use
> > > > the same JSP's. It all works fine until the user clicks a link which
> > > > directs him to /secure/articles/Show.do?page=2 .
> > > >
> > > > How can i make html:link use relative paths? I would like to specify
> > > > html:link action="Show.do?page=2" and that would lead to
> > > > /secure/news/Show.do because the originating url said so.
> > > >
> > > > Thanks,
> > > > Anders,
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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



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



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


RE: Reuse of JSP's and relative links

Posted by Mike Jasnowski <mj...@bea.com>.
Ahh good point, I was thinking I guess in terms if it was launched from a
button.

-----Original Message-----
From: Daniel Wang [mailto:ddwang@anomaly.net]
Sent: Wednesday, September 17, 2003 10:39 AM
To: Struts Users Mailing List
Subject: Re: Reuse of JSP's and relative links


Actually you probably don't want to do the extra "this.submit()" from within
a submit handler -- it'll create an endless loop

onSubmit should submit the form unless a FALSE is returned

----- Original Message -----
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 7:31 AM
Subject: RE: Reuse of JSP's and relative links


> Or
>
> <html:form onsubmit="this.action='/Show.do';this.submit();">
>
> -----Original Message-----
> From: Mike Jasnowski [mailto:mjasnows@bea.com]
> Sent: Tuesday, September 16, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: RE: Reuse of JSP's and relative links
>
>
> You might be able to do this with an onsubmit handler
>
> ie.. <html:form onsubmit="this.location.href='/Show.do'">
>
> -----Original Message-----
> From: Daniel Wang [mailto:ddwang@anomaly.net]
> Sent: Wednesday, September 17, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: Re: Reuse of JSP's and relative links
>
>
> You can't.  :(
>
> ----- Original Message -----
> From: "Anders" <an...@f12.no>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, September 17, 2003 7:24 AM
> Subject: Re: Reuse of JSP's and relative links
>
>
> > Ah, great! :)
> >
> > How can i do the same thing in the <html:form> tag? Anyone knows?
> >
> > Thanks,
> > Anders,
> >
> > On Wed, 17 Sep 2003, Daniel Wang wrote:
> >
> > > use href as opposed to page
> > >
> > > i.e. <html:link href="Show.do">
> > >
> > > ----- Original Message -----
> > > From: "Anders" <an...@f12.no>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Wednesday, September 17, 2003 7:07 AM
> > > Subject: Reuse of JSP's and relative links
> > >
> > >
> > > > Hi,
> > > >
> > > > How can i get html:link to use relative links?
> > > >
> > > > I'm trying to reuse actions and JSP several places under different
> paths.
> > > > My problem is:
> > > >
> > > > The user enters through /secure/articles/Show.do and it displays the
> page
> > > > with articles. The links on the page lets you go to the next page
and
> read
> > > > the full article.
> > > >
> > > > I then use the same action class for /secure/news/Show.do, and want
to
> use
> > > > the same JSP's. It all works fine until the user clicks a link which
> > > > directs him to /secure/articles/Show.do?page=2 .
> > > >
> > > > How can i make html:link use relative paths? I would like to specify
> > > > html:link action="Show.do?page=2" and that would lead to
> > > > /secure/news/Show.do because the originating url said so.
> > > >
> > > > Thanks,
> > > > Anders,
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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



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


Re: Reuse of JSP's and relative links

Posted by Daniel Wang <dd...@anomaly.net>.
Actually you probably don't want to do the extra "this.submit()" from within
a submit handler -- it'll create an endless loop

onSubmit should submit the form unless a FALSE is returned

----- Original Message ----- 
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 16, 2003 7:31 AM
Subject: RE: Reuse of JSP's and relative links


> Or
>
> <html:form onsubmit="this.action='/Show.do';this.submit();">
>
> -----Original Message-----
> From: Mike Jasnowski [mailto:mjasnows@bea.com]
> Sent: Tuesday, September 16, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: RE: Reuse of JSP's and relative links
>
>
> You might be able to do this with an onsubmit handler
>
> ie.. <html:form onsubmit="this.location.href='/Show.do'">
>
> -----Original Message-----
> From: Daniel Wang [mailto:ddwang@anomaly.net]
> Sent: Wednesday, September 17, 2003 10:29 AM
> To: Struts Users Mailing List
> Subject: Re: Reuse of JSP's and relative links
>
>
> You can't.  :(
>
> ----- Original Message -----
> From: "Anders" <an...@f12.no>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, September 17, 2003 7:24 AM
> Subject: Re: Reuse of JSP's and relative links
>
>
> > Ah, great! :)
> >
> > How can i do the same thing in the <html:form> tag? Anyone knows?
> >
> > Thanks,
> > Anders,
> >
> > On Wed, 17 Sep 2003, Daniel Wang wrote:
> >
> > > use href as opposed to page
> > >
> > > i.e. <html:link href="Show.do">
> > >
> > > ----- Original Message -----
> > > From: "Anders" <an...@f12.no>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Wednesday, September 17, 2003 7:07 AM
> > > Subject: Reuse of JSP's and relative links
> > >
> > >
> > > > Hi,
> > > >
> > > > How can i get html:link to use relative links?
> > > >
> > > > I'm trying to reuse actions and JSP several places under different
> paths.
> > > > My problem is:
> > > >
> > > > The user enters through /secure/articles/Show.do and it displays the
> page
> > > > with articles. The links on the page lets you go to the next page
and
> read
> > > > the full article.
> > > >
> > > > I then use the same action class for /secure/news/Show.do, and want
to
> use
> > > > the same JSP's. It all works fine until the user clicks a link which
> > > > directs him to /secure/articles/Show.do?page=2 .
> > > >
> > > > How can i make html:link use relative paths? I would like to specify
> > > > html:link action="Show.do?page=2" and that would lead to
> > > > /secure/news/Show.do because the originating url said so.
> > > >
> > > > Thanks,
> > > > Anders,
> > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


RE: Reuse of JSP's and relative links

Posted by Mike Jasnowski <mj...@bea.com>.
Or

<html:form onsubmit="this.action='/Show.do';this.submit();">

-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Tuesday, September 16, 2003 10:29 AM
To: Struts Users Mailing List
Subject: RE: Reuse of JSP's and relative links


You might be able to do this with an onsubmit handler

ie.. <html:form onsubmit="this.location.href='/Show.do'">

-----Original Message-----
From: Daniel Wang [mailto:ddwang@anomaly.net]
Sent: Wednesday, September 17, 2003 10:29 AM
To: Struts Users Mailing List
Subject: Re: Reuse of JSP's and relative links


You can't.  :(

----- Original Message -----
From: "Anders" <an...@f12.no>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, September 17, 2003 7:24 AM
Subject: Re: Reuse of JSP's and relative links


> Ah, great! :)
>
> How can i do the same thing in the <html:form> tag? Anyone knows?
>
> Thanks,
> Anders,
>
> On Wed, 17 Sep 2003, Daniel Wang wrote:
>
> > use href as opposed to page
> >
> > i.e. <html:link href="Show.do">
> >
> > ----- Original Message -----
> > From: "Anders" <an...@f12.no>
> > To: <st...@jakarta.apache.org>
> > Sent: Wednesday, September 17, 2003 7:07 AM
> > Subject: Reuse of JSP's and relative links
> >
> >
> > > Hi,
> > >
> > > How can i get html:link to use relative links?
> > >
> > > I'm trying to reuse actions and JSP several places under different
paths.
> > > My problem is:
> > >
> > > The user enters through /secure/articles/Show.do and it displays the
page
> > > with articles. The links on the page lets you go to the next page and
read
> > > the full article.
> > >
> > > I then use the same action class for /secure/news/Show.do, and want to
use
> > > the same JSP's. It all works fine until the user clicks a link which
> > > directs him to /secure/articles/Show.do?page=2 .
> > >
> > > How can i make html:link use relative paths? I would like to specify
> > > html:link action="Show.do?page=2" and that would lead to
> > > /secure/news/Show.do because the originating url said so.
> > >
> > > Thanks,
> > > Anders,
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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



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



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