You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Field-Elliot <br...@netmeme.org> on 2001/03/08 17:43:48 UTC

ActionForm question (repost)

Question reposted (never got any responses) -- please respond, someone :)

Question about creating ActionForm beans --

What kinds of data types are supported? I could not find a reference to 
this in the docs. For example, I want to have an input box on my forms, 
where the user can enter a number. Or, they can leave it blank. I want 
"blank" to show up as null, not zero. Should I implement my ActionForm 
bean as follows?

Integer qty;

Integer getQty() { return qty; }
void setQty(Integer) { this.qty = qty; }

I've chosen Integer because it can hold a value, OR it can be null 
(which is the behavior I'm looking for).

Will this work, or must I restrict my data types to Strings and do 
conversion somewhere else?

Thanks,
Bryan


Re: a "_blank" target

Posted by Elod Horvath <el...@itfais.com>.
Maya Muchnik wrote:
> 
> Hi,
> I think <html:link> struts tag has a target attribute, right? Netscape uses
> a "_blank" target in <a href=...> anchor. And it "hide" a HREF itself from a
> user. But in IE it does not work (I can see HREF). Is this Netscape
> specific? How I can do similar in IE? (Sorry, Craig T., I do not know, how
> implement what you have suggested).
> 

the target attribute indicates to the browser which _named_ window
or frame to place the results of a request into.  it has nothing to
do with whether the URL is shown in the status bar.  there are certain
special target values recognized by browsers:

_top
	replace the top window/frameset with the results of the request
_blank
	place request results into a new window
_self
	replace the contents of the window/frame in which the link resides
	with the results of the request
_parent
	places the result of the request in the parent of the one 
	displaying the current document.


all other values of the TARGET attribute indicate a window/frame name.
if no window or frame of that particular name exists, the the results
are place in a _new_ window (given the specified name).

the target attribute is now part of the HTML 4 spec.  (i
don't  have the spec handy, but the attribute has been around and in use 
since the dawn of time (or at least netscape :))




hope this answers your question (at least partially)

e
-- 
_______________________________________________________________________
Elod Horvath ('e')       /      ITFAIS Records (http://www.itfais.com/)

a "_blank" target

Posted by Maya Muchnik <mm...@pumatech.com>.
Hi,
I think <html:link> struts tag has a target attribute, right? Netscape uses
a "_blank" target in <a href=...> anchor. And it "hide" a HREF itself from a
user. But in IE it does not work (I can see HREF). Is this Netscape
specific? How I can do similar in IE? (Sorry, Craig T., I do not know, how
implement what you have suggested).

THANKS in advance.

Maya


Re: ActionForm question (repost)

Posted by Maya Muchnik <mm...@pumatech.com>.
Brian,
I think, the best way to have a bean with String properties, and
corresponding form. When you perform data checking convert there to a number
if this field has to be a number. If validation is OK, put to database
converted data.
Maya

Bryan Field-Elliot wrote:

> Question reposted (never got any responses) -- please respond, someone :)
>
> Question about creating ActionForm beans --
>
> What kinds of data types are supported? I could not find a reference to
> this in the docs. For example, I want to have an input box on my forms,
> where the user can enter a number. Or, they can leave it blank. I want
> "blank" to show up as null, not zero. Should I implement my ActionForm
> bean as follows?
>
> Integer qty;
>
> Integer getQty() { return qty; }
> void setQty(Integer) { this.qty = qty; }
>
> I've chosen Integer because it can hold a value, OR it can be null
> (which is the behavior I'm looking for).
>
> Will this work, or must I restrict my data types to Strings and do
> conversion somewhere else?
>
> Thanks,
> Bryan


Re: Gratitude

Posted by Maya Muchnik <mm...@pumatech.com>.
Welcome a "board", John. We are all gratefully happy that we have Struts and
its developers / contributors.
Maya

John Wright wrote:

> Struts developers and other contributors,
>
> I have been working several months on a project and was really getting
> nowhere.  I had implemented my own MVC framework based on some usely
> assorted ideas mostly from JavaWorld articles.  Then I found Struts
> yesterday.  It blew me away.  I intuitively knew right away that it was the
> right architecture and would save me tons of time by allowing me to avoid
> that tedious JSP programming that was bogging me down.  I know letters like
> this don't help anyone to learn more about Struts but I felt like I have to
> say thanks.  This is one of the best and most well documented frameworks I
> have ever seen.  I dreamt about Struts last night. :)  Maybee now I can get
> back to 8 hour days and time to take a walk in the woods and watch the
> beautiful spring come in (I am not exaggerating).
>
> I will try to repay what I get from Struts by contributing to this list.  I
> am a really fast learner of frameworks.  That is at least one of my skills.
>
> John Wright
> Kansas City, MO
>
> P.S.  I am already about 75% to where I had been in several months with just
> one day of Struts.  What does that say for Struts!


Gratitude

Posted by John Wright <jw...@fyidocs.com>.
Struts developers and other contributors,

I have been working several months on a project and was really getting
nowhere.  I had implemented my own MVC framework based on some usely
assorted ideas mostly from JavaWorld articles.  Then I found Struts
yesterday.  It blew me away.  I intuitively knew right away that it was the
right architecture and would save me tons of time by allowing me to avoid
that tedious JSP programming that was bogging me down.  I know letters like
this don't help anyone to learn more about Struts but I felt like I have to
say thanks.  This is one of the best and most well documented frameworks I
have ever seen.  I dreamt about Struts last night. :)  Maybee now I can get
back to 8 hour days and time to take a walk in the woods and watch the
beautiful spring come in (I am not exaggerating).

I will try to repay what I get from Struts by contributing to this list.  I
am a really fast learner of frameworks.  That is at least one of my skills.

John Wright
Kansas City, MO

P.S.  I am already about 75% to where I had been in several months with just
one day of Struts.  What does that say for Struts!


Re: ActionForm question (repost)

Posted by Anand Raman <an...@mymailbag.com>.
Hi Bryan
I have used both primitive data types like int, float, boolean and
String objects in the ActionForm class.. 
It has been working fine.. Meaning that a text filed which is filled
with a numeric value populates the primitive setter method
appropriatly.. The same happens in the case of a String too..

However a blank field will be set as a "" and not a null..
U will have expicitly perform this check (if u need so) in the setter or
the Action class.

Hope this helps
Anand

On Thu, Mar 08, 2001 at 09:43:48AM -0700, Bryan Field-Elliot wrote:
>Question reposted (never got any responses) -- please respond, someone :)
>
>Question about creating ActionForm beans --
>
>What kinds of data types are supported? I could not find a reference to 
>this in the docs. For example, I want to have an input box on my forms, 
>where the user can enter a number. Or, they can leave it blank. I want 
>"blank" to show up as null, not zero. Should I implement my ActionForm 
>bean as follows?
>
>Integer qty;
>
>Integer getQty() { return qty; }
>void setQty(Integer) { this.qty = qty; }
>
>I've chosen Integer because it can hold a value, OR it can be null 
>(which is the behavior I'm looking for).
>
>Will this work, or must I restrict my data types to Strings and do 
>conversion somewhere else?
>
>Thanks,
>Bryan

Re: ActionForm question (repost)

Posted by John Raley <jo...@moonlight.com>.
Use Strings.  However, I think an empty textfield will set its String
property to "" (empty string), not null.
Bryan Field-Elliot wrote:

> Question reposted (never got any responses) -- please respond, someone :)
>
> Question about creating ActionForm beans --
>
> What kinds of data types are supported? I could not find a reference to
> this in the docs. For example, I want to have an input box on my forms,
> where the user can enter a number. Or, they can leave it blank. I want
> "blank" to show up as null, not zero. Should I implement my ActionForm
> bean as follows?
>
> Integer qty;
>
> Integer getQty() { return qty; }
> void setQty(Integer) { this.qty = qty; }
>
> I've chosen Integer because it can hold a value, OR it can be null
> (which is the behavior I'm looking for).
>
> Will this work, or must I restrict my data types to Strings and do
> conversion somewhere else?
>
> Thanks,
> Bryan