You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gregor Rayman <gr...@gmx.net> on 2001/07/24 18:50:07 UTC

& scripting variable

Hi,

why does <html:form> generate no scripting variable? Would be nice, if 
it did.

--
gR


Re: & scripting variable

Posted by Ted Husted <hu...@apache.org>.
The best thing would be to submit a patch to Bugzilla as an enhancement
request and a use-case to DEV to convince someone to commit the patch
;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


Erik Hatcher wrote:
> 
> No arguments here.   It certainly could.... and it would be a fairly easy
> modification for it to do so.
> 
> Perhaps you could post a use-case for why you need it.   If you convinced me
> enough I'd make the changes and submit them as a patch for consideration by
> the struts-dev group.  Or you could make the changes yourself.
> 
>     Erik

Re: & scripting variable

Posted by Gregor Rayman <gr...@gmx.net>.
"Erik Hatcher" <er...@earthlink.net> wrote:

> > But I still can access the form bean in scriplet, only the scriplet is
> > more complicated and error prone. And when so many other structs tags
> > define scriplet varibales, why should not <html:form> do it too?
>
> No arguments here.   It certainly could.... and it would be a fairly easy
> modification for it to do so.
>
> Perhaps you could post a use-case for why you need it.   If you convinced
me
> enough I'd make the changes and submit them as a patch for consideration
by
> the struts-dev group.  Or you could make the changes yourself.
>
>     Erik

OK. I will do it tomorrow. But I am quite new to struts, and have no
experience
with sumbitting code to open source projects, I just will send the modified
code to you, if you agree.

And if I don't convice you, I'll be happy to learn more strutsy way to do
the
thing :-)

--
gR


Re: & scripting variable

Posted by Erik Hatcher <er...@earthlink.net>.
> > > Now I have to either covert the attribute to local variable or
> > > use <bean:define>. Why not just create the variable like <bean:define>
> > > does?
> >
> > But one of the main purposes of Struts is to get away from using
> scriptlets.
>
> I agree. There are tasks where no scriplets are necessary so they should
> not be used. Sometime however avoiding a scriplet is not easy, and writing
> custom tags with the sole purpose to avoid one scriplet in one jsp sounds
> like overkill.
>
> But I still can access the form bean in scriplet, only the scriplet is
> more complicated and error prone. And when so many other structs tags
define
> scriplet varibales, why should not <html:form> do it too?

No arguments here.   It certainly could.... and it would be a fairly easy
modification for it to do so.

Perhaps you could post a use-case for why you need it.   If you convinced me
enough I'd make the changes and submit them as a patch for consideration by
the struts-dev group.  Or you could make the changes yourself.

    Erik



Re: & scripting variable

Posted by Gregor Rayman <gr...@gmx.net>.
"Erik Hatcher" <er...@earthlink.net> wrote:


> > Perhaps. But sometimes I just want to use the form in a scriplet.
>
> Perhaps?   Well, it DOES create a page scoped attribute - no perhaps about
> it! :)   I checked the source, FormTag.java.

OK, ok :-)


> > Now I have to either covert the attribute to local variable or
> > use <bean:define>. Why not just create the variable like <bean:define>
> > does?
>
> But one of the main purposes of Struts is to get away from using
scriptlets.

I agree. There are tasks where no scriplets are necessary so they should
not be used. Sometime however avoiding a scriplet is not easy, and writing
custom tags with the sole purpose to avoid one scriplet in one jsp sounds
like overkill.

But I still can access the form bean in scriplet, only the scriplet is
more complicated and error prone. And when so many other structs tags define
scriplet varibales, why should not <html:form> do it too?

--
gR


Re: & scripting variable

Posted by Erik Hatcher <er...@earthlink.net>.
> Perhaps. But sometimes I just want to use the form in a scriplet.

Perhaps?   Well, it DOES create a page scoped attribute - no perhaps about
it! :)   I checked the source, FormTag.java.

> Now I have to either covert the attribute to local variable or
> use <bean:define>. Why not just create the variable like <bean:define>
> does?

But one of the main purposes of Struts is to get away from using scriptlets.


----- Original Message -----
From: "Erik Hatcher" <er...@earthlink.net>
To: <st...@jakarta.apache.org>
Sent: Tuesday, July 24, 2001 7:25 PM
Subject: Re: <html:form> & scripting variable


> It does set a page scoped attribute (keyed by the form name from the
> mapping) that contains the form object.
>
>     Erik
>
>
> ----- Original Message -----
> From: "Gregor Rayman" <gr...@gmx.net>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, July 24, 2001 9:50 AM
> Subject: <html:form> & scripting variable
>
>
> > Hi,
> >
> > why does <html:form> generate no scripting variable? Would be nice, if
> > it did.
> >
> > --
> > gR
> >
>



Re: & scripting variable

Posted by Gregor Rayman <gr...@gmx.net>.
Perhaps. But sometimes I just want to use the form in a scriplet.

Now I have to either covert the attribute to local variable or
use <bean:define>. Why not just create the variable like <bean:define>
does?

--
gR


----- Original Message ----- 
From: "Erik Hatcher" <er...@earthlink.net>
To: <st...@jakarta.apache.org>
Sent: Tuesday, July 24, 2001 7:25 PM
Subject: Re: <html:form> & scripting variable


> It does set a page scoped attribute (keyed by the form name from the
> mapping) that contains the form object.
> 
>     Erik
> 
> 
> ----- Original Message -----
> From: "Gregor Rayman" <gr...@gmx.net>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, July 24, 2001 9:50 AM
> Subject: <html:form> & scripting variable
> 
> 
> > Hi,
> >
> > why does <html:form> generate no scripting variable? Would be nice, if
> > it did.
> >
> > --
> > gR
> >
> 


Re: & scripting variable

Posted by Erik Hatcher <er...@earthlink.net>.
It does set a page scoped attribute (keyed by the form name from the
mapping) that contains the form object.

    Erik


----- Original Message -----
From: "Gregor Rayman" <gr...@gmx.net>
To: <st...@jakarta.apache.org>
Sent: Tuesday, July 24, 2001 9:50 AM
Subject: <html:form> & scripting variable


> Hi,
>
> why does <html:form> generate no scripting variable? Would be nice, if
> it did.
>
> --
> gR
>