You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Beal <jb...@webmedx.com> on 2004/12/09 22:42:16 UTC

Re: Struts or straight HTML button for action w/ no assoc. form?

john.chesher@convergys.com wrote:

>     <FORM METHOD="LINK" ACTION="BuildPostMessageViewAction.do">
>         <INPUT TYPE="submit" VALUE="Post message for this classmate">
>     </FORM>
> 
> This works fine, but I have to ask, is this how a purely struts application
> should be written, or is there a truly struts-based solution to what I was
> trying to do?
> Thanks!

I, for one, don't have any problems with this approach from a Struts 
standpoint.  This does what you want to do without creating any 
unnecessary overhead.  I can't think of anything more struts-like than 
that.  I think that too many people on this list forget that the Struts 
custom tags are really an offshoot of Struts, not the central thing. 
They make it easier for a JSP page to work with the framework, but they 
are not necessary.  The fact that you are linking to an Action instead 
of a JSP page tells me that this is a "struts-based" solution.

That said, my strict HTML standards compliance antennae are all 
a-quiver.  It looks like what you want here is a basic link that "looks 
like" a button; you don't need to have an HTML form at all.  You can do 
that with CSS:

<style type='text/css'>
  a.fakeButton {
    background-color: gray;
    border-style: outset;
  }
  a.fakeButton:active {
    border-style: inset;
  }
</style>

<a href="BuildPostMessageViewAction.do" class="fakeButton">Post message 
for this classmate</a>

(Haven't tested that; may not work perfectly; should come pretty close.)

-- Jeff


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


Re: Struts or straight HTML button for action w/ no assoc. form?

Posted by Derek Broughton <de...@pointerstop.ca>.
On Thursday 09 December 2004 18:28, Frank W. Zammetti wrote:
> I always tend to chime in on topics like this because I sense a real
> over-reliance on taglibs in general, certainly the Struts taglibs more
> specifically.
...
> My point is simply that, as with most good technology, use custom tahs
> with care.  Don't simply assume that they are the solution to every
> problem.  I frankly go to the extreme of NOT using them unless I have a
> problem tha is ideally solved by them, which tends to not be the case
> too often.  I'm not saying go to that extreme, just venture forth with a
> little caution is all.

Very good point.  I tend to use whatever is simplest _for me_, which is not 
necessarily the best or the most efficient solution in action.  Frank's 
method requires a _very_ good understanding of the taglibs, which can only be 
a "Good Thing" :-)
-- 
derek

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


Re: Struts or straight HTML button for action w/ no assoc. form?

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I always tend to chime in on topics like this because I sense a real 
over-reliance on taglibs in general, certainly the Struts taglibs more 
specifically.

As Jeff said, people seem to forget that the taglibs are really in a 
sense an extension of Struts.  Struts works just fine without them (I 
know because I've done some pretty complex work without them).  They are 
nice, as are taglibs in general, no argument here, but I see a lot of 
people stumbling with taglibs because they don't understand what's going 
on without them, so they wind up being less help than they otherwise 
should be.

My point is simply that, as with most good technology, use custom tahs 
with care.  Don't simply assume that they are the solution to every 
problem.  I frankly go to the extreme of NOT using them unless I have a 
problem tha is ideally solved by them, which tends to not be the case 
too often.  I'm not saying go to that extreme, just venture forth with a 
little caution is all.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

Jeff Beal wrote:
> john.chesher@convergys.com wrote:
> 
>>     <FORM METHOD="LINK" ACTION="BuildPostMessageViewAction.do">
>>         <INPUT TYPE="submit" VALUE="Post message for this classmate">
>>     </FORM>
>>
>> This works fine, but I have to ask, is this how a purely struts 
>> application
>> should be written, or is there a truly struts-based solution to what I 
>> was
>> trying to do?
>> Thanks!
> 
> 
> I, for one, don't have any problems with this approach from a Struts 
> standpoint.  This does what you want to do without creating any 
> unnecessary overhead.  I can't think of anything more struts-like than 
> that.  I think that too many people on this list forget that the Struts 
> custom tags are really an offshoot of Struts, not the central thing. 
> They make it easier for a JSP page to work with the framework, but they 
> are not necessary.  The fact that you are linking to an Action instead 
> of a JSP page tells me that this is a "struts-based" solution.
> 
> That said, my strict HTML standards compliance antennae are all 
> a-quiver.  It looks like what you want here is a basic link that "looks 
> like" a button; you don't need to have an HTML form at all.  You can do 
> that with CSS:
> 
> <style type='text/css'>
>  a.fakeButton {
>    background-color: gray;
>    border-style: outset;
>  }
>  a.fakeButton:active {
>    border-style: inset;
>  }
> </style>
> 
> <a href="BuildPostMessageViewAction.do" class="fakeButton">Post message 
> for this classmate</a>
> 
> (Haven't tested that; may not work perfectly; should come pretty close.)
> 
> -- Jeff
> 
> 
> ---------------------------------------------------------------------
> 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