this is driving me nucking futs!

2009-03-11 Thread mitch gorman
okay, can anyone (musachy, david, martin, i'm looking in your
direction!) tell me how to do what i'm trying to do, here?

i've got a list of items i'm iterating over.  for each item, i want
to have one or more links to actions, with parameterization from the
item's data.  this means, using a unique value for each  tag's id
attribute.  the trouble comes in trying to reference the unique id value
in my  tag.

a trivial example will demonstrate my quandary more clearly:


   <%-- done to make actual code a
little cleaner to read; this
example
doesn't really need it --%>

<%-- the following correctly puts "link-1", "link-2", etc, into
the stack context --%>

<%-- purely for
the example --%>



Link #




how can i get the proper "#link-" into that href field
in my JSP, to be dereferenced by struts (in the resulting html sent to
the browser) into the actual URL assembled specifically for that item? 
i've tried dozens of syntactical constructions, none of which worked. 
the closest i ever got was to see URLs that looked like
"http://my.com/linkAction.do?link-2";... just couldn't get that "link-2"
string to be properly parsed by struts as an "argument" to the "#"... 
i've tried various combinations with  and , but
ultimately, i come down to needing something like "%{#( ...%{#...})}"
...and that definitely doesn't fly!

any thoughts on how to accomplish this?  i can't believe i'm the
first person to ever want to do something like this...
  

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



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
mitch gorman wrote:
> okay, can anyone (musachy, david, martin, i'm looking in your
> direction!) tell me how to do what i'm trying to do, here?
>
> i've got a list of items i'm iterating over.  for each item, i want
> to have one or more links to actions, with parameterization from the
> item's data.  this means, using a unique value for each  tag's id
> attribute.  the trouble comes in trying to reference the unique id value
> in my  tag.
>   

forgot to mention, v2.0.14.


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



Re: this is driving me nucking futs!

2009-03-11 Thread Wes Wannemacher
It seems like you are created a variable variable name... I am
assuming that there is a reason why you are using  and wanting
to refer to the constructed URL by id, rather than just doing the
following -


 
   ">blah

In an iterator, rather than constructing a name and trying to use OGNL
to unravel that name, I'd just construct the URL in a plain ol' 
tag.

-Wes


On Wed, Mar 11, 2009 at 4:21 PM, mitch gorman  wrote:
> mitch gorman wrote:
>>     okay, can anyone (musachy, david, martin, i'm looking in your
>> direction!) tell me how to do what i'm trying to do, here?
>>
>>     i've got a list of items i'm iterating over.  for each item, i want
>> to have one or more links to actions, with parameterization from the
>> item's data.  this means, using a unique value for each  tag's id
>> attribute.  the trouble comes in trying to reference the unique id value
>> in my  tag.
>>
>
>    forgot to mention, v2.0.14.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



Re: this is driving me nucking futs!

2009-03-11 Thread Musachy Barroso
Ok, first, you don't need to define variable for each url, you can just do



 

 
  somelink
 

musachy

On Wed, Mar 11, 2009 at 3:58 PM, mitch gorman  wrote:
>    okay, can anyone (musachy, david, martin, i'm looking in your
> direction!) tell me how to do what i'm trying to do, here?
>
>    i've got a list of items i'm iterating over.  for each item, i want
> to have one or more links to actions, with parameterization from the
> item's data.  this means, using a unique value for each  tag's id
> attribute.  the trouble comes in trying to reference the unique id value
> in my  tag.
>
>    a trivial example will demonstrate my quandary more clearly:
>
> 
>               <%-- done to make actual code a
>                                            little cleaner to read; this
> example
>                                            doesn't really need it --%>
>
>        <%-- the following correctly puts "link-1", "link-2", etc, into
> the stack context --%>
>        
>                <%-- purely for
> the example --%>
>        
>
>        
>            Link #
>        
>    
> 
>
>    how can i get the proper "#link-" into that href field
> in my JSP, to be dereferenced by struts (in the resulting html sent to
> the browser) into the actual URL assembled specifically for that item?
> i've tried dozens of syntactical constructions, none of which worked.
> the closest i ever got was to see URLs that looked like
> "http://my.com/linkAction.do?link-2";... just couldn't get that "link-2"
> string to be properly parsed by struts as an "argument" to the "#"...
> i've tried various combinations with  and , but
> ultimately, i come down to needing something like "%{#( ...%{#...})}"
> ...and that definitely doesn't fly!
>
>    any thoughts on how to accomplish this?  i can't believe i'm the
> first person to ever want to do something like this...
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



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

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



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Musachy Barroso wrote:
> Ok, first, you don't need to define variable for each url, you can just do
>
> 
this was the very first thing i attempted... it was the logical
first attempt.  unfortunately, what i ended up with when i did that was
a set of links to the last loop iteration's URL.  now, granted, i hadn't
been using struts very long at that point, so maybe i'd screwed
something else up.  i can certainly try this again...

> inside the iterator, that will make your life easier. Assuming the
> code was just an example, and you *really* need to create a bunch of
> URLs and then use them, you can do it like this:
>
>  
> 
>  
>
>  
>   somelink
>  

Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Wes Wannemacher wrote:
> It seems like you are created a variable variable name... I am
> assuming that there is a reason why you are using  and wanting
> to refer to the constructed URL by id, rather than just doing the
> following -
>
> 
>  
>">blah
>
> In an iterator, rather than constructing a name and trying to use OGNL
> to unravel that name, I'd just construct the URL in a plain ol' 
> tag.
>   

readability.  i think the above is tougher to maintain than using a
reference to a  tag, especially when you consider that that was a
trivial example... there may be multiple params, and some of the values
to be passed may, themselves, be somewhat convoluted.
would it work?  sure...  i was just hoping for something a little more
slick and concise.

as musachy pointed out, it may be that i'm overcomplicating, and i'm
going to test that out straight away... 


thanks!

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



Re: this is driving me nucking futs!

2009-03-11 Thread Wes Wannemacher
On Wed, Mar 11, 2009 at 4:39 PM, mitch gorman  wrote:
> Musachy Barroso wrote:
>> Ok, first, you don't need to define variable for each url, you can just do
>>
>> > >
>    this was the very first thing i attempted... it was the logical
> first attempt.  unfortunately, what i ended up with when i did that was
> a set of links to the last loop iteration's URL.  now, granted, i hadn't
> been using struts very long at that point, so maybe i'd screwed
> something else up.  i can certainly try this again...

This would probably happen if you were outside of the closing iterator tag.



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



Re: this is driving me nucking futs!

2009-03-11 Thread Musachy Barroso
yeah, the for loop is just to illustrate the point. The #context
thingie will work in any version.

On Wed, Mar 11, 2009 at 4:39 PM, mitch gorman  wrote:
> Musachy Barroso wrote:
>> Ok, first, you don't need to define variable for each url, you can just do
>>
>> > >
>    this was the very first thing i attempted... it was the logical
> first attempt.  unfortunately, what i ended up with when i did that was
> a set of links to the last loop iteration's URL.  now, granted, i hadn't
> been using struts very long at that point, so maybe i'd screwed
> something else up.  i can certainly try this again...
>
>> inside the iterator, that will make your life easier. Assuming the
>> code was just an example, and you *really* need to create a bunch of
>> URLs and then use them, you can do it like this:
>>
>>  
>>         
>>  
>>
>>  
>>       somelink
>>      well, i can't do that exactly, since i'm using v2.0.14 (no "begin",
> "end" attributes).  however,
>
> "%{#context['link'+ #i]}"
>
>    is intriguing.  would such a construct work in v2.0.14?
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



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

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



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Wes Wannemacher wrote:
> On Wed, Mar 11, 2009 at 4:39 PM, mitch gorman  wrote:
>   
>> Musachy Barroso wrote:
>> 
>>> Ok, first, you don't need to define variable for each url, you can just do
>>>
>>> >> >>
>>>   
>>this was the very first thing i attempted... it was the logical
>> first attempt.  unfortunately, what i ended up with when i did that was
>> a set of links to the last loop iteration's URL.  now, granted, i hadn't
>> been using struts very long at that point, so maybe i'd screwed
>> something else up.  i can certainly try this again...
>> 
>
> This would probably happen if you were outside of the closing iterator tag.
>   

yup.  color me "embarrassed"... it just worked perfectly!  clearly,
i'd messed something else up when i tried it the first go-round.

*sigh*

thanks for your responses, wes!


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



Re: this is driving me nucking futs!

2009-03-11 Thread Wes Wannemacher
On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman  wrote:
>
>    thanks for your responses, wes!
>

No problem, next time, include me in your list of gurus and I'll be happy.

-Wes

-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Musachy Barroso wrote:
> yeah, the for loop is just to illustrate the point. The #context
> thingie will work in any version
   okay, well, as i just noted in my response to wes, i clearly
must've boneheaded something else when i tried it the first time,
because the simple, un-overthought approach,



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Wes Wannemacher wrote:
> On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman  wrote:
>   
>>thanks for your responses, wes!
>>
>> 
>
> No problem, next time, include me in your list of gurus and I'll be happy

lol!  you got it!

(i knew for sure i was probably inadvertently dissing at least a
couple people here... my apologies to any *other* deserving souls!)


Re: this is driving me nucking futs!

2009-03-11 Thread Chris Pratt
I guess one question I would ask is why  doesn't have an action
paramter and allow nested  elements?  That way there would be no
need to create any variables.
  (*Chris*)

On Wed, Mar 11, 2009 at 1:56 PM, mitch gorman  wrote:

> Wes Wannemacher wrote:
> > On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman 
> wrote:
> >
> >>thanks for your responses, wes!
> >>
> >>
> >
> > No problem, next time, include me in your list of gurus and I'll be happy
>
> lol!  you got it!
>
>(i knew for sure i was probably inadvertently dissing at least a
> couple people here... my apologies to any *other* deserving souls!)
>


Re: this is driving me nucking futs!

2009-03-11 Thread Musachy Barroso
That is something I have complained about for a long time, time to do
something about it I guess.

musachy

On Wed, Mar 11, 2009 at 5:08 PM, Chris Pratt  wrote:
> I guess one question I would ask is why  doesn't have an action
> paramter and allow nested  elements?  That way there would be no
> need to create any variables.
>  (*Chris*)
>
> On Wed, Mar 11, 2009 at 1:56 PM, mitch gorman  wrote:
>
>> Wes Wannemacher wrote:
>> > On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman 
>> wrote:
>> >
>> >>    thanks for your responses, wes!
>> >>
>> >>
>> >
>> > No problem, next time, include me in your list of gurus and I'll be happy
>>
>>     lol!  you got it!
>>
>>    (i knew for sure i was probably inadvertently dissing at least a
>> couple people here... my apologies to any *other* deserving souls!)
>>
>



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

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



Re: this is driving me nucking futs!

2009-03-11 Thread mitch gorman
Musachy Barroso wrote:
> That is something I have complained about for a long time, time to do
> something about it I guess.
>   

I AM AN INSTRUMENT OF CHANGE!!!

;)



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



Re: this is driving me nucking futs!

2009-03-11 Thread Jim Kiley
Musachy, I would refer to you as "a cool dude" if you did that.
jk

On Wed, Mar 11, 2009 at 5:10 PM, Musachy Barroso  wrote:

> That is something I have complained about for a long time, time to do
> something about it I guess.
>
> musachy
>
> On Wed, Mar 11, 2009 at 5:08 PM, Chris Pratt 
> wrote:
> > I guess one question I would ask is why  doesn't have an action
> > paramter and allow nested  elements?  That way there would be no
> > need to create any variables.
> >  (*Chris*)
> >
> > On Wed, Mar 11, 2009 at 1:56 PM, mitch gorman 
> wrote:
> >
> >> Wes Wannemacher wrote:
> >> > On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman 
> >> wrote:
> >> >
> >> >>thanks for your responses, wes!
> >> >>
> >> >>
> >> >
> >> > No problem, next time, include me in your list of gurus and I'll be
> happy
> >>
> >> lol!  you got it!
> >>
> >>(i knew for sure i was probably inadvertently dissing at least a
> >> couple people here... my apologies to any *other* deserving souls!)
> >>
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


Re: this is driving me nucking futs!

2009-03-11 Thread Musachy Barroso
my list of annoyances:

1. iterator tag no having "begin" and "end"
2. "a" not able to build a url
3. "validateAnnotatedMethodOnly" in "validation" interceptor should be
"true" by default

first one is down, I gotta tackle the other 2.

musachy

On Wed, Mar 11, 2009 at 5:32 PM, Jim Kiley  wrote:
> Musachy, I would refer to you as "a cool dude" if you did that.
> jk
>
> On Wed, Mar 11, 2009 at 5:10 PM, Musachy Barroso  wrote:
>
>> That is something I have complained about for a long time, time to do
>> something about it I guess.
>>
>> musachy
>>
>> On Wed, Mar 11, 2009 at 5:08 PM, Chris Pratt 
>> wrote:
>> > I guess one question I would ask is why  doesn't have an action
>> > paramter and allow nested  elements?  That way there would be no
>> > need to create any variables.
>> >  (*Chris*)
>> >
>> > On Wed, Mar 11, 2009 at 1:56 PM, mitch gorman 
>> wrote:
>> >
>> >> Wes Wannemacher wrote:
>> >> > On Wed, Mar 11, 2009 at 4:47 PM, mitch gorman 
>> >> wrote:
>> >> >
>> >> >>    thanks for your responses, wes!
>> >> >>
>> >> >>
>> >> >
>> >> > No problem, next time, include me in your list of gurus and I'll be
>> happy
>> >>
>> >>     lol!  you got it!
>> >>
>> >>    (i knew for sure i was probably inadvertently dissing at least a
>> >> couple people here... my apologies to any *other* deserving souls!)
>> >>
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>



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

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



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

Mitch-

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


Numbers Game

var submitcount=0;
function submitForm()
{
  var url ='<a  rel="nofollow" href="http://localhost:8080/struts2-showcase-2.1.2/action">http://localhost:8080/struts2-showcase-2.1.2/action</a>' + 
escape(document.form.select.value);
  document.form.action=url;
  alert(url);
  document.form.submit();
}
  



Numbers Game


 

   






OGNL and JSTL use back end (Bean) objects to store and retrieve  
back end objects
your submit tag can call JavaScript which will construct a url variable as 
illustrated here
just be sure to assign document.form.action=url before submitting as seen in 
submitForm()

HTH
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Wed, 11 Mar 2009 17:17:13 -0400
> From: mgor...@shadowtv.biz
> To: user@struts.apache.org
> Subject: Re: this is driving me nucking futs!
> 
> Musachy Barroso wrote:
> > That is something I have complained about for a long time, time to do
> > something about it I guess.
> >   
> 
> I AM AN INSTRUMENT OF CHANGE!!!
> 
> ;)
> 
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme

Re: this is driving me nucking futs!

2009-03-12 Thread Dave Newton

mitch gorman wrote:

I AM AN INSTRUMENT OF CHANGE!!!


Hmm, when people say that about me they say I'm a tool.

I'm not *entirely* sure they're being complimentary ;)

Dave


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



Re: this is driving me nucking futs!

2009-03-12 Thread dusty

Adding the action, namespace and params url constructing pieces to s:a would
be cool, as long as we don't nerf the s:url function.  I rather like the
pattern of using a central "routes" page as an include where urls are
created and their ids referenced in links via JSTL in the main pages.

-D

newton.dave wrote:
> 
> mitch gorman wrote:
>> I AM AN INSTRUMENT OF CHANGE!!!
> 
> Hmm, when people say that about me they say I'm a tool.
> 
> I'm not *entirely* sure they're being complimentary ;)
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: this is driving me nucking futs!

2009-03-12 Thread Musachy Barroso
"a" will support all the attributes that "url" does, it is almost
done, working on the tests at the moment.

musachy

On Thu, Mar 12, 2009 at 12:24 PM, dusty  wrote:
>
> Adding the action, namespace and params url constructing pieces to s:a would
> be cool, as long as we don't nerf the s:url function.  I rather like the
> pattern of using a central "routes" page as an include where urls are
> created and their ids referenced in links via JSTL in the main pages.
>
> -D
>
> newton.dave wrote:
>>
>> mitch gorman wrote:
>>>     I AM AN INSTRUMENT OF CHANGE!!!
>>
>> Hmm, when people say that about me they say I'm a tool.
>>
>> I'm not *entirely* sure they're being complimentary ;)
>>
>> Dave
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



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

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



Re: this is driving me nucking futs!

2009-03-12 Thread Musachy Barroso
it is up in svn, ticket:

https://issues.apache.org/struts/browse/WW-3037

The "a" tag now supports all the attributes that "url" supports,
except "var", which it doesn't need. It also supports nested params.
One annoyance down, a few to go.

musachy

On Thu, Mar 12, 2009 at 1:30 PM, Musachy Barroso  wrote:
> "a" will support all the attributes that "url" does, it is almost
> done, working on the tests at the moment.
>
> musachy
>
> On Thu, Mar 12, 2009 at 12:24 PM, dusty  wrote:
>>
>> Adding the action, namespace and params url constructing pieces to s:a would
>> be cool, as long as we don't nerf the s:url function.  I rather like the
>> pattern of using a central "routes" page as an include where urls are
>> created and their ids referenced in links via JSTL in the main pages.
>>
>> -D
>>
>> newton.dave wrote:
>>>
>>> mitch gorman wrote:
>>>>     I AM AN INSTRUMENT OF CHANGE!!!
>>>
>>> Hmm, when people say that about me they say I'm a tool.
>>>
>>> I'm not *entirely* sure they're being complimentary ;)
>>>
>>> Dave
>>>
>>>
>>> -----------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> "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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

can you explain this routes a bit more..what is this another attribute or a 
template?
i can see see action, params but namespace?

if you look at the code the base class changes from 
public class AnchorTag extends AbstractClosingTag 
TO
public class AnchorTag extends ContextBean
basing AnchorTag on a bean allows you to tack on infinitely more attributes
...
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Thu, 12 Mar 2009 09:24:54 -0700
> From: dustin_pea...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: this is driving me nucking futs!
> 
> 
> Adding the action, namespace and params url constructing pieces to s:a would
> be cool, as long as we don't nerf the s:url function.  I rather like the
> pattern of using a central "routes" page as an include where urls are
> created and their ids referenced in links via JSTL in the main pages.
> 
> -D
> 
> newton.dave wrote:
> > 
> > mitch gorman wrote:
> >> I AM AN INSTRUMENT OF CHANGE!!!
> > 
> > Hmm, when people say that about me they say I'm a tool.
> > 
> > I'm not *entirely* sure they're being complimentary ;)
> > 
> > Dave
> > 
> > 
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Groups: Create an online spot for your favorite groups to meet.
http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009

Re: this is driving me nucking futs!

2009-03-12 Thread Dave Newton

Martin Gainty wrote:

can you explain this routes a bit more..what is this another attribute or a 
template?
i can see see action, params but namespace?


Yeah, so if the action is in another namespace you can refer to it.

if you look at the code the base class changes from 
public class AnchorTag extends AbstractClosingTag 
TO

public class AnchorTag extends ContextBean
basing AnchorTag on a bean allows you to tack on infinitely more attributes


It's already been done, as Musachy said:

https://issues.apache.org/struts/browse/WW-3037

Dave


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



RE: this is driving me nucking futs!

2009-03-12 Thread dusty

Sorry Martin, did Dave answer your question?  Were you just wondering about
the namespace parameter on the url tag or about the routes pattern in
general?


mgainty wrote:
> 
> 
> can you explain this routes a bit more..what is this another attribute or
> a template?
> i can see see action, params but namespace?
> 
> if you look at the code the base class changes from 
> public class AnchorTag extends AbstractClosingTag 
> TO
> public class AnchorTag extends ContextBean
> basing AnchorTag on a bean allows you to tack on infinitely more
> attributes
> ...
> Martin 
> __ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission. 
> 
> 
> 
> 
>> Date: Thu, 12 Mar 2009 09:24:54 -0700
>> From: dustin_pea...@yahoo.com
>> To: user@struts.apache.org
>> Subject: Re: this is driving me nucking futs!
>> 
>> 
>> Adding the action, namespace and params url constructing pieces to s:a
>> would
>> be cool, as long as we don't nerf the s:url function.  I rather like the
>> pattern of using a central "routes" page as an include where urls are
>> created and their ids referenced in links via JSTL in the main pages.
>> 
>> -D
>> 
>> newton.dave wrote:
>> > 
>> > mitch gorman wrote:
>> >> I AM AN INSTRUMENT OF CHANGE!!!
>> > 
>> > Hmm, when people say that about me they say I'm a tool.
>> > 
>> > I'm not *entirely* sure they're being complimentary ;)
>> > 
>> > Dave
>> > 
>> > 
>> > -----
>> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> > For additional commands, e-mail: user-h...@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
> 
> _
> Windows Live™ Groups: Create an online spot for your favorite groups to
> meet.
> http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009
> 

-- 
View this message in context: 
http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22489517.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: this is driving me nucking futs!

2009-03-12 Thread Martin Gainty

dave answered about namespace

curious about 'routes pattern'

thanks,
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Thu, 12 Mar 2009 20:23:57 -0700
> From: dustin_pea...@yahoo.com
> To: user@struts.apache.org
> Subject: RE: this is driving me nucking futs!
> 
> 
> Sorry Martin, did Dave answer your question?  Were you just wondering about
> the namespace parameter on the url tag or about the routes pattern in
> general?
> 
> 
> mgainty wrote:
> > 
> > 
> > can you explain this routes a bit more..what is this another attribute or
> > a template?
> > i can see see action, params but namespace?
> > 
> > if you look at the code the base class changes from 
> > public class AnchorTag extends AbstractClosingTag 
> > TO
> > public class AnchorTag extends ContextBean
> > basing AnchorTag on a bean allows you to tack on infinitely more
> > attributes
> > ...
> > Martin 
> > __ 
> > Disclaimer and confidentiality note 
> > Everything in this e-mail and any attachments relates to the official
> > business of Sender. This transmission is of a confidential nature and
> > Sender does not endorse distribution to any party other than intended
> > recipient. Sender does not necessarily endorse content contained within
> > this transmission. 
> > 
> > 
> > 
> > 
> >> Date: Thu, 12 Mar 2009 09:24:54 -0700
> >> From: dustin_pea...@yahoo.com
> >> To: user@struts.apache.org
> >> Subject: Re: this is driving me nucking futs!
> >> 
> >> 
> >> Adding the action, namespace and params url constructing pieces to s:a
> >> would
> >> be cool, as long as we don't nerf the s:url function.  I rather like the
> >> pattern of using a central "routes" page as an include where urls are
> >> created and their ids referenced in links via JSTL in the main pages.
> >> 
> >> -D
> >> 
> >> newton.dave wrote:
> >> > 
> >> > mitch gorman wrote:
> >> >> I AM AN INSTRUMENT OF CHANGE!!!
> >> > 
> >> > Hmm, when people say that about me they say I'm a tool.
> >> > 
> >> > I'm not *entirely* sure they're being complimentary ;)
> >> > 
> >> > Dave
> >> > 
> >> > 
> >> > -
> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> > For additional commands, e-mail: user-h...@struts.apache.org
> >> > 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22479288.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >> 
> >> 
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >> 
> > 
> > _
> > Windows Live™ Groups: Create an online spot for your favorite groups to
> > meet.
> > http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/this-is-driving-me-nucking-futs%21-tp22463203p22489517.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ Contacts: Organize your contact list. 
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009

RE: this is driving me nucking futs!

2009-03-13 Thread dusty

Sorry it took me a while.  Damn flu season...

Anyways, its not really complicated but I have found it to be useful.  It
was inspired from some RoR projects I worked on and is a poor mans routing
table.

You create a JSP that you will include at the top of all your JSP views.  In
this JSP you add url tags like:





Customers Index</a>

Since you are globally including this you don't parameterize urls like
"customer_path" in the routes page, but just write out the query string like
you would on a normal link.

<a href="${customer_path}?id=${customer.id}">Customers Index</a>

(You could use  tags but for the links I find the less verbose
JSTL expressions to be prettier.)

The other type of urls you can put in there are things like home, images,
styles, scripts, etc.  So you can serve these static resources from
wherever.





Then in the JSP its

${images}/add.png 



So you could have something called dev-routes.jsp where the static resources
are served relatively through your J2EE container and in prod-routes you
could change it to serve from a separate Apache server to make things
fasterish:

http://mystatic1.site.com/images/"/>

I have been using this pattern on the last 3 or 4 projects and it has really
stuck without much changes.  I suppose we could add some maven profiles and
maven variables in there to switch values based on the selected maven build
profile.


mgainty wrote:
> 
> 
> dave answered about namespace
> 
> curious about 'routes pattern'
> 
> thanks,
> Martin 
> __ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission. 
> 
> 
> 
> 
>> Date: Thu, 12 Mar 2009 20:23:57 -0700
>> From: dustin_pea...@yahoo.com
>> To: user@struts.apache.org
>> Subject: RE: this is driving me nucking futs!
>> 
>> 
>> Sorry Martin, did Dave answer your question?  Were you just wondering
>> about
>> the namespace parameter on the url tag or about the routes pattern in
>> general?
>> 
>> 
>> mgainty wrote:
>> > 
>> > 
>> > can you explain this routes a bit more..what is this another attribute
>> or
>> > a template?
>> > i can see see action, params but namespace?
>> > 
>> > if you look at the code the base class changes from 
>> > public class AnchorTag extends AbstractClosingTag 
>> > TO
>> > public class AnchorTag extends ContextBean
>> > basing AnchorTag on a bean allows you to tack on infinitely more
>> > attributes
>> > ...
>> > Martin 
>> > __ 
>> > Disclaimer and confidentiality note 
>> > Everything in this e-mail and any attachments relates to the official
>> > business of Sender. This transmission is of a confidential nature and
>> > Sender does not endorse distribution to any party other than intended
>> > recipient. Sender does not necessarily endorse content contained within
>> > this transmission. 
>> > 
>> > 
>> > 
>> > 
>> >> Date: Thu, 12 Mar 2009 09:24:54 -0700
>> >> From: dustin_pea...@yahoo.com
>> >> To: user@struts.apache.org
>> >> Subject: Re: this is driving me nucking futs!
>> >> 
>> >> 
>> >> Adding the action, namespace and params url constructing pieces to s:a
>> >> would
>> >> be cool, as long as we don't nerf the s:url function.  I rather like
>> the
>> >> pattern of using a central "routes" page as an include where urls are
>> >> created and their ids referenced in links via JSTL in the main pages.
>> >> 
>> >> -D
>> >> 
>> >> newton.dave wrote:
>> >> > 
>> >> > mitch gorman wrote:
>> >> >> I AM AN INSTRUMENT OF CHANGE!!!
>> >> > 
>> >> > Hmm, when people say that about me they say I'm a tool.
>> >> > 
>> >> > I'm not *entirely* sure they're being complimentary ;)
>> >> > 
>> >> > Dave
>> >> > 
>> >> > 
>> >> >
>> -
>> >> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> >> > F

Re: this is driving me nucking futs!

2009-03-13 Thread Chris Pratt
Seems to me that there's a lot of variable creation at the beginning of each
page that is never going to be used.  I know it gets compiled into Java, but
it still takes time.  I'd be afraid that if there were more than about 20
links you could be seriously slowing things down for a bit of syntactic
sugar at development time.
  (*Chris*)

On Fri, Mar 13, 2009 at 9:40 PM, dusty  wrote:

>
> Sorry it took me a while.  Damn flu season...
>
> Anyways, its not really complicated but I have found it to be useful.  It
> was inspired from some RoR projects I worked on and is a poor mans routing
> table.
>
> You create a JSP that you will include at the top of all your JSP views.
>  In
> this JSP you add url tags like:
>
>   namespace = "/customers"
>  action = "index"/>
>
>   namespace = "/customers"
>  action = "show"/>
>
> 
> The naming convention and use of singular and plurals for certain names I
> lifted from Rails conventions.
>
> Then in your view JSPs where the above is included, you use a JSTL
> expresssion like:
>
> Customers Index
>
> Since you are globally including this you don't parameterize urls like
> "customer_path" in the routes page, but just write out the query string
> like
> you would on a normal link.
>
> Customers Index
>
> (You could use  tags but for the links I find the less verbose
> JSTL expressions to be prettier.)
>
> The other type of urls you can put in there are things like home, images,
> styles, scripts, etc.  So you can serve these static resources from
> wherever.
>
>   value = "/"/>
>
>   value = "/images"/>
>
> Then in the JSP its
>
> ${images}/add.png
> 
> 
>
> So you could have something called dev-routes.jsp where the static
> resources
> are served relatively through your J2EE container and in prod-routes you
> could change it to serve from a separate Apache server to make things
> fasterish:
>
>   value="http://mystatic1.site.com/images/"/>
>
> I have been using this pattern on the last 3 or 4 projects and it has
> really
> stuck without much changes.  I suppose we could add some maven profiles and
> maven variables in there to switch values based on the selected maven build
> profile.
>
>
> mgainty wrote:
> >
> >
> > dave answered about namespace
> >
> > curious about 'routes pattern'
> >
> > thanks,
> > Martin
> > __
> > Disclaimer and confidentiality note
> > Everything in this e-mail and any attachments relates to the official
> > business of Sender. This transmission is of a confidential nature and
> > Sender does not endorse distribution to any party other than intended
> > recipient. Sender does not necessarily endorse content contained within
> > this transmission.
> >
> >
> >
> >
> >> Date: Thu, 12 Mar 2009 20:23:57 -0700
> >> From: dustin_pea...@yahoo.com
> >> To: user@struts.apache.org
> >> Subject: RE: this is driving me nucking futs!
> >>
> >>
> >> Sorry Martin, did Dave answer your question?  Were you just wondering
> >> about
> >> the namespace parameter on the url tag or about the routes pattern in
> >> general?
> >>
> >>
> >> mgainty wrote:
> >> >
> >> >
> >> > can you explain this routes a bit more..what is this another attribute
> >> or
> >> > a template?
> >> > i can see see action, params but namespace?
> >> >
> >> > if you look at the code the base class changes from
> >> > public class AnchorTag extends AbstractClosingTag
> >> > TO
> >> > public class AnchorTag extends ContextBean
> >> > basing AnchorTag on a bean allows you to tack on infinitely more
> >> > attributes
> >> > ...
> >> > Martin
> >> > __
> >> > Disclaimer and confidentiality note
> >> > Everything in this e-mail and any attachments relates to the official
> >> > business of Sender. This transmission is of a confidential nature and
> >> > Sender does not endorse distribution to any party other than intended
> >> > recipient. Sender does not necessarily endorse content contained
> within
> >> > this transmission.
> >> >
> >> >
> >> >

RE: this is driving me nucking futs!

2009-03-14 Thread Martin Gainty

MG>comments?
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 

> 
> 
> Sorry it took me a while.  Damn flu season...
MG>we're ALL waiting for nationalised health insurance!
> 
> Anyways, its not really complicated but I have found it to be useful.  It
> was inspired from some RoR projects I worked on and is a poor mans routing
> table.
MG>i compiled a RoR one time ..havent been able to get the module-ror compiled 
since
MG>i think the project was abandoned as I have'nt been able to get ahold of 
maven scripts
MG>to create the module properly..

> 
> You create a JSP that you will include at the top of all your JSP views.  In
> this JSP you add url tags like:
> 
>namespace = "/customers"
>   action = "index"/>
> 
>namespace = "/customers"
>   action = "show"/>
MG> i assuming change url2  namespace from customers to customer?

>  
> The naming convention and use of singular and plurals for certain names I
> lifted from Rails conventions.
> 
> Then in your view JSPs where the above is included, you use a JSTL
> expresssion like:
> 
> <a href="${customers_path}">Customers Index</a>
MG>anchor href uses prebuilt urls is already implemented in showcase.jsp 
(v2.1.6)
MG>includeParams="none" />">Action Chaining

> 
> Since you are globally including this you don't parameterize urls like
> "customer_path" in the routes page, but just write out the query string like
> you would on a normal link.
> 
> <a href="${customer_path}?id=${customer.id}">Customers Index</a>
MG>then in the the case where 
<-- Example 2 -->







the value 22 will be assigned over any customer.id as the includeParams="get" 
takes precedence

http://struts.apache.org/2.x/docs/url.html
How would you handle the scenario of assignment precedence for includeParams?
MG>
> (You could use  tags but for the links I find the less verbose
> JSTL expressions to be prettier.)
> 
> The other type of urls you can put in there are things like home, images,
> styles, scripts, etc.  So you can serve these static resources from
> wherever.
> 
>value = "/"/>
> 
>value = "/images"/>
> 
> Then in the JSP its
> 
> ${images}/add.png 
> 
> 
> 
> So you could have something called dev-routes.jsp where the static resources
> are served relatively through your J2EE container 
MG>J2EE container serving faster than Apache?

>and in prod-routes you
> could change it to serve from a separate Apache server
MG>Apache http-server serves static resources faster than any J2EE compliant 
container

> to make things
> fasterish:
> 
>value="http://mystatic1.site.com/images/"/>
> 
> I have been using this pattern on the last 3 or 4 projects and it has really
> stuck without much changes.  I suppose we could add some maven profiles and
> maven variables in there to switch values based on the selected maven build
> profile.
MG>are you voluntering to create a maven archetype  for this?
MG>anyone else?
MG>thanks for the info..this has been helpful
MG>
> 
> mgainty wrote:
> > 
> > 
> > dave answered about namespace
> > 
> > curious about 'routes pattern'
> > 
> > thanks,
> > Martin 
> > __ 
> > Disclaimer and confidentiality note 
> > Everything in this e-mail and any attachments relates to the official
> > business of Sender. This transmission is of a confidential nature and
> > Sender does not endorse distribution to any party other than intended
> > recipient. Sender does not necessarily endorse content contained within
> > this transmission. 
> > 
> > 
> > 
> > 
> >> Date: Thu, 12 Mar 2009 20:23:57 -0700
> >> From: dustin_pea...@yahoo.com
> >> To: user@struts.apache.org
> >> Subject: RE: this is driving me nucking futs!
> >> 
> >> 
> >> Sorry Martin, did Dave answer your question?  Were you just wondering
> >> about
> >> the namespace parameter on the url tag or about the routes pattern in
> >> general?
> >> 
> >> 
> >> mgainty wrote:
> >> > 
> >> &g

RE: this is driving me nucking futs!

2009-03-14 Thread dusty
>Action Chaining 
> 
>> 
>> Since you are globally including this you don't parameterize urls like
>> "customer_path" in the routes page, but just write out the query string
>> like
>> you would on a normal link.
>> 
>> <a href="${customer_path}?id=${customer.id}">Customers Index</a>
> MG>then in the the case where 
> <-- Example 2 -->
> 
>   />
> 
> 
> 
> 
> 
> the value 22 will be assigned over any customer.id as the
> includeParams="get" takes precedence
> 
> http://struts.apache.org/2.x/docs/url.html
> How would you handle the scenario of assignment precedence for
> includeParams?
> MG>
>> (You could use  tags but for the links I find the less
>> verbose
>> JSTL expressions to be prettier.)
>> 
>> The other type of urls you can put in there are things like home, images,
>> styles, scripts, etc.  So you can serve these static resources from
>> wherever.
>> 
>> >   value = "/"/>
>> 
>> >   value = "/images"/>
>> 
>> Then in the JSP its
>> 
>> ${images}/add.png 
>> 
>> 
>> 
>> So you could have something called dev-routes.jsp where the static
>> resources
>> are served relatively through your J2EE container 
> MG>J2EE container serving faster than Apache?
> 
>>and in prod-routes you
>> could change it to serve from a separate Apache server
> MG>Apache http-server serves static resources faster than any J2EE
> compliant container
> 
>> to make things
>> fasterish:
>> 
>> >   value="http://mystatic1.site.com/images/"/>
>> 
>> I have been using this pattern on the last 3 or 4 projects and it has
>> really
>> stuck without much changes.  I suppose we could add some maven profiles
>> and
>> maven variables in there to switch values based on the selected maven
>> build
>> profile.
> MG>are you voluntering to create a maven archetype  for this?
> MG>anyone else?
> MG>thanks for the info..this has been helpful
> MG>
>> 
>> mgainty wrote:
>> > 
>> > 
>> > dave answered about namespace
>> > 
>> > curious about 'routes pattern'
>> > 
>> > thanks,
>> > Martin 
>> > __ 
>> > Disclaimer and confidentiality note 
>> > Everything in this e-mail and any attachments relates to the official
>> > business of Sender. This transmission is of a confidential nature and
>> > Sender does not endorse distribution to any party other than intended
>> > recipient. Sender does not necessarily endorse content contained within
>> > this transmission. 
>> > 
>> > 
>> > 
>> > 
>> >> Date: Thu, 12 Mar 2009 20:23:57 -0700
>> >> From: dustin_pea...@yahoo.com
>> >> To: user@struts.apache.org
>> >> Subject: RE: this is driving me nucking futs!
>> >> 
>> >> 
>> >> Sorry Martin, did Dave answer your question?  Were you just wondering
>> >> about
>> >> the namespace parameter on the url tag or about the routes pattern in
>> >> general?
>> >> 
>> >> 
>> >> mgainty wrote:
>> >> > 
>> >> > 
>> >> > can you explain this routes a bit more..what is this another
>> attribute
>> >> or
>> >> > a template?
>> >> > i can see see action, params but namespace?
>> >> > 
>> >> > if you look at the code the base class changes from 
>> >> > public class AnchorTag extends AbstractClosingTag 
>> >> > TO
>> >> > public class AnchorTag extends ContextBean
>> >> > basing AnchorTag on a bean allows you to tack on infinitely more
>> >> > attributes
>> >> > ...
>> >> > Martin 
>> >> > __ 
>> >> > Disclaimer and confidentiality note 
>> >> > Everything in this e-mail and any attachments relates to the
>> official
>> >> > business of Sender. This transmission is of a confidential nature
>> and
>> >> > Sender does not endorse distribution to any party other than
>> intended
>> >> > recipient. Sender does not necessarily endorse content contained
>> within
>> >> > this transmission. 
>> >>

RE: this is driving me nucking futs!

2009-03-15 Thread Martin Gainty

//we're interested in RESTActionMapper's mapping .. the code reads as follows

/ *   This mapper supports the following parameters:
struts.mapper.idParameterName - If set, this value will be the name
 *   of the parameter under which the id is stored.  The id will then be 
removed
 *   from the action name.  Whether or not the method is specified, the 
mapper will 
 *   try to truncate the identifier from the url and store it as a 
parameter.
*/

struts.mapper.indexMethodName - The method name to call for a 
GET request with no id parameter. Defaults to 'index'.
struts.mapper.getMethodName - The method name to call for a GET 
request with an id parameter. Defaults to 'show'.
struts.mapper.postMethodName - The method name to call for a POST  
request with no id parameter. Defaults to 'create'.
struts.mapper.putMethodName - The method name to call for a PUT
 *   request with an id parameter. Defaults to 'update'.
struts.mapper.deleteMethodName - The method name to call for a 
DELETE request with an id parameter. Defaults to 'destroy'.
struts.mapper.editMethodName - The method name to call for a GET
 *   request with an id parameter and the 'edit' view specified. Defaults 
to 'edit'.
struts.mapper.newMethodName - The method name to call for a GET
 *   request with no id parameter and the 'new' view specified. Defaults to 
'editNew'.

//to circumvent REST mapping you can simply assign  "name!method" convention.
String name = mapping.getName();
int exclamation = name.lastIndexOf("!");
if (exclamation != -1) {
mapping.setName(name.substring(0, exclamation)); //name=name
mapping.setMethod(name.substring(exclamation + 1)); //method=method
}

//HERE are your ROR Rest-style mappings:

//GET customers_path becomes /customers_path method=index 
//reason: GET request with no id default method name is 'index'

//GET customer_path/1 becomes /customers_path method="show" id=1 
//reason: GET request with id defaults to method show with id assigned 1

//GET /customers/new becomes /customers method='editNew'
//reason: The method name to call for a GET request with no id parameter and 
the //'new' view specified. Defaults to 'editNew'.

//POST /customers becomes /customers method='create'
//reason: POST with no id method defaults to method create

//GET /customers/1;edit becomes /customers method='edit' id=1
//reason: GET request with edit view specified ..defaults to edit method

//PUT /customers/1 = customers method="update" id="Thrillers"

//reason: PUT with an id (1) method defaults to update method


//DELETE /customers/1 = customers method="destroy" id="1"
//reason PUT with an id method defaults to destroy

mr don writes in the notes:
/* This Restful action mapper enforces Ruby-On-Rails Rest-style mappings.  If 
the method 
 * is not specified (via '!' or 'method:' prefix), the method is "guessed" at 
using 
 * ReST-style conventions that examine the URL and the HTTP method.  Special 
care has
 * been given to ensure this mapper works correctly with the codebehind plugin 
so that
 * XML configuration is unnecessary.
*/

Does this conform to your understanding of ROR REST-style mappings?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Sat, 14 Mar 2009 21:43:54 -0700
> From: dustin_pea...@yahoo.com
> To: user@struts.apache.org
> Subject: RE: this is driving me nucking futs!
> 
> 
> @Chris - Those are definitely good points.  I think that our first priorities
> for the applications we build for the Health System are maintainability &
> readability.  We don't have the performance needs of a major public internet
> site.  Our sites are pretty zippy. ;-)  Usually we have more large dataset
> related issues than throughput.I suppose in a major system you could
> subdivide your routes into different includes for different modules.  I
> think if I was having performance issues, I would look a few other places
> first before I look before reducing the number of variables.
> 
> @MG - maven scripts for Ruby on Rails?  Am I missing something?  JRuby
> perhaps?  but its a struts forum, so we can move on... ;-)
> 
> In the example there is one namespace with all the RESTful actions
> associated with a Customer (index, show, new, create, edit, update,
> destroy)

RE: this is driving me nucking futs!

2009-03-15 Thread dusty
 */
> 
> Does this conform to your understanding of ROR REST-style mappings?
> Martin 
> __________ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission. 
> 
> 
> 
> 
>> Date: Sat, 14 Mar 2009 21:43:54 -0700
>> From: dustin_pea...@yahoo.com
>> To: user@struts.apache.org
>> Subject: RE: this is driving me nucking futs!
>> 
>> 
>> @Chris - Those are definitely good points.  I think that our first
>> priorities
>> for the applications we build for the Health System are maintainability &
>> readability.  We don't have the performance needs of a major public
>> internet
>> site.  Our sites are pretty zippy. ;-)  Usually we have more large
>> dataset
>> related issues than throughput.I suppose in a major system you could
>> subdivide your routes into different includes for different modules.  I
>> think if I was having performance issues, I would look a few other places
>> first before I look before reducing the number of variables.
>> 
>> @MG - maven scripts for Ruby on Rails?  Am I missing something?  JRuby
>> perhaps?  but its a struts forum, so we can move on... ;-)
>> 
>> In the example there is one namespace with all the RESTful actions
>> associated with a Customer (index, show, new, create, edit, update,
>> destroy).  When creating the links, the ids change plurality based on
>> conventions I have seen:
>> 
>> //GET /customers/index = customers_path
>> //GET /customers/show?id=1 = customer_path
>> //GET /customers/new = customers_new_path
>> //POST /customers/create = customers_create_path
>> //GET /customers/edit?id=1 = customer_edit_path
>> //POST /customers/update = customer_update_path
>> //POST /customers/destroy?id=1 = customer_destroy_path
>> 
>> You can place your  inline for the anchor's href attribute.  I
>> think
>> my intent was to abstract the view page from the action's implementation
>> which allows me to update the namespace or action without a big search
>> and
>> replace.   With refactor tools these types of updates are pretty trivial. 
>> IMO, the url "reads" better with the JSTL variable reference.
> @MG yes JSTL is easier to read than OGNL 
> 
>> On precedence, the short answer is I don't.  I set includeParams default
>> globally to false and just deal with query strings, "the old way".   Its
>> just my preference, but I like to see the querystring params on each link
>> rather than just the unique additions on top of the existing GET params. 
>> I
>> think my general habits keep the querystrings fairly light, but in a
>> situation where you need a big complex querystring that you are chaining
>> you
>> can always put in an "exception" and do it however you want for that
>> case.
>> 
>> I have not built anything that needed a performance boost from offloading
>> static resource loading from another server.  I have read that this is a
>> common technique used to gain some perceived performance gain on the
>> browser
>> side.  
>> 
>> On the maven archetype, I wish I wasn't so lazy.  I still need to create
>> an
>> archetype for the template we are using for our apps.  We stripped
>> Appfuse
>> and retooled it with some better unit test classes and integrated it with
>> SSO (Crowd) and we just need to get it all wrapped up.  I really need to
>> create a template folder for Musachy's StrutsOn so I can use Groovy to
>> generate all the Dao/Managers/Controllers/Views for basic CRUD based on
>> models.Maybe one night I can put down Left4Dead and get some work
>> done
>> instead
>> 
>> 
>> mgainty wrote:
>> > 
>> > 
>> > MG>comments?
>> > __ 
>> > Disclaimer and confidentiality note 
>> > Everything in this e-mail and any attachments relates to the official
>> > business of Sender. This transmission is of a confidential nature and
>> > Sender does not endorse distribution to any party other than intended
>> > recipient. Sender does not necessarily endorse content contained within
>> > this transmission. 
>> > 
>> >> 
>> >> 
>> >> Sorry it took