You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by mraible <ma...@raibledesigns.com> on 2007/03/01 03:45:04 UTC

Re: [s2] Enhancement to Zero Config: Default Success Result

Yes, this is what I'm looking for, and I was able to use it successfully.
Strangely enough, I couldn't get the @Result annotation to work with zero
config.  Is there anything special I need to do for that?

One change I'd like to see to the codebehind plugin is the ability to
specify the default location of pages. For example WEB-INF/pages.  Or is
that what the "struts.codebehind.defaultPackage" constant is for? 

I think it makes sense to combine Zero Config and Code Behind as they both
seem to be doing the same thing.  Zero config means no config, and if
there's still an @Result required - that's configuration, no? ;-)

Thanks,

Matt


Tom Schneider-4 wrote:
> 
> See http://struts.apache.org/2.x/docs/codebehind-plugin.html
> 
> The very first line from the docs are:
> *
> Default results* - The purpose of most Actions is to execute code to 
> prepare the data for a specific page. The name of this page is often the 
> same as the Action itself.
> 
> Is this not what your looking for, or is there more to it?  I've seen 
> the Spring MVC support for this and this looks like exactly the same 
> functionality to me.  In fact the struts version is more flexible 
> because it looks for /NAMESPACE/ACTION-RESULT.jsp as well as 
> /NAMESPACE/ACTION.jsp.
> Tom
> 
> mraible wrote:
>> Is there a default success result when using Zero configuration?  I'd
>> like to
>> see this feature added.  Spring MVC has something similar, as does
>> Tapestry.
>> It's quite nice to simple create a controller, as well as a view without
>> having to configure anything.
>>
>> http://www.springframework.org/docs/reference/mvc.html#mvc-coc-r2vnt
>>
>> Implementation ideas: specify the default directory on the filter, then
>> name
>> the JSP the same as the URL.
>>
>> For example, TestAction would expect a test.jsp page.
>>
>> Specify the default result type should be possible in struts.xml.  Maybe
>> this setting should go there as well.  
>>
>> Does the actionPackages configuration belong in struts.xml instead of
>> web.xml?
>>
>> Thanks,
>>
>> Matt
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Enhancement-to-Zero-Config%3A-Default-Success-Result-tf3324150.html#a9242858
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: [s2] Enhancement to Zero Config: Default Success Result

Posted by Tom Schneider <sc...@gmail.com>.
Guys,
I think the codebehind plugin already supports all this.  (The 
codebehind plugin consists of 1 whole java file!!)  The property for 
default location of jsp's is:

struts.codebehind.pathPrefix

The docs just need to be updated.  Looking at the code, it looks like it 
also supports all result types, not just success or input.

Cheers to Don for covering all the bases. :-)
Tom

David H. DeWolf wrote:
>
>
> mraible wrote:
>> Yes, this is what I'm looking for, and I was able to use it 
>> successfully.
>> Strangely enough, I couldn't get the @Result annotation to work with 
>> zero
>> config.  Is there anything special I need to do for that?
>
> I use it and don't recall anything special.  Do you have errors that 
> are occurring? What happens when you try to use it?
>
>>
>> One change I'd like to see to the codebehind plugin is the ability to
>> specify the default location of pages. For example WEB-INF/pages.  Or is
>> that what the "struts.codebehind.defaultPackage" constant is for? 
>
> I'd also like to expand support so that all result values can be used 
> as post fixes.  Instead of supporting just page-success.jsp and 
> page-input.jsp, why not support page-whatevertheresultis.jsp.  Thoughts?
>
>>
>> I think it makes sense to combine Zero Config and Code Behind as they 
>> both
>> seem to be doing the same thing.  Zero config means no config, and if
>> there's still an @Result required - that's configuration, no? ;-)
>
> I have a hard time envisioning someone using them separately as well. . .
>
> -D
>>
>> Thanks,
>>
>> Matt
>>
>>


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


Re: [s2] Enhancement to Zero Config: Default Success Result

Posted by Dave Newton <ne...@yahoo.com>.
--- "David H. DeWolf" <dd...@apache.org> wrote:
> I'd also like to expand support so that all result
> values can be used as post fixes.  Instead of 
> supporting just page-success.jsp and 
> page-input.jsp, why not support
> page-whatevertheresultis.jsp.  Thoughts?

+1 (I actually thought that was what it did, I just
never used any other results yet! :)

d.



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


Re: [s2] Enhancement to Zero Config: Default Success Result

Posted by "David H. DeWolf" <dd...@apache.org>.

mraible wrote:
> Yes, this is what I'm looking for, and I was able to use it successfully.
> Strangely enough, I couldn't get the @Result annotation to work with zero
> config.  Is there anything special I need to do for that?

I use it and don't recall anything special.  Do you have errors that are 
occurring? What happens when you try to use it?

> 
> One change I'd like to see to the codebehind plugin is the ability to
> specify the default location of pages. For example WEB-INF/pages.  Or is
> that what the "struts.codebehind.defaultPackage" constant is for? 

I'd also like to expand support so that all result values can be used as 
post fixes.  Instead of supporting just page-success.jsp and 
page-input.jsp, why not support page-whatevertheresultis.jsp.  Thoughts?

> 
> I think it makes sense to combine Zero Config and Code Behind as they both
> seem to be doing the same thing.  Zero config means no config, and if
> there's still an @Result required - that's configuration, no? ;-)

I have a hard time envisioning someone using them separately as well. . .

-D
> 
> Thanks,
> 
> Matt
> 
> 
> Tom Schneider-4 wrote:
>> See http://struts.apache.org/2.x/docs/codebehind-plugin.html
>>
>> The very first line from the docs are:
>> *
>> Default results* - The purpose of most Actions is to execute code to 
>> prepare the data for a specific page. The name of this page is often the 
>> same as the Action itself.
>>
>> Is this not what your looking for, or is there more to it?  I've seen 
>> the Spring MVC support for this and this looks like exactly the same 
>> functionality to me.  In fact the struts version is more flexible 
>> because it looks for /NAMESPACE/ACTION-RESULT.jsp as well as 
>> /NAMESPACE/ACTION.jsp.
>> Tom
>>
>> mraible wrote:
>>> Is there a default success result when using Zero configuration?  I'd
>>> like to
>>> see this feature added.  Spring MVC has something similar, as does
>>> Tapestry.
>>> It's quite nice to simple create a controller, as well as a view without
>>> having to configure anything.
>>>
>>> http://www.springframework.org/docs/reference/mvc.html#mvc-coc-r2vnt
>>>
>>> Implementation ideas: specify the default directory on the filter, then
>>> name
>>> the JSP the same as the URL.
>>>
>>> For example, TestAction would expect a test.jsp page.
>>>
>>> Specify the default result type should be possible in struts.xml.  Maybe
>>> this setting should go there as well.  
>>>
>>> Does the actionPackages configuration belong in struts.xml instead of
>>> web.xml?
>>>
>>> Thanks,
>>>
>>> Matt
>>>   
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>>
> 

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


Re: [s2] Enhancement to Zero Config: Default Success Result

Posted by mraible <ma...@raibledesigns.com>.
I'd like to suggest that whatever you decide, the codebehind plugin uses this
same constant for its setting.  I think it makes sense to combine
code-behind and zero-config, no?

Spring MVC uses a prefix/suffix for its ViewResolvers - works very nice IMO.

Matt


husted wrote:
> 
> On 2/28/07, mraible <ma...@raibledesigns.com> wrote:
>> One change I'd like to see to the codebehind plugin is the ability to
>> specify the default location of pages. For example WEB-INF/pages.  Or is
>> that what the "struts.codebehind.defaultPackage" constant is for?
> 
> I'd like to see that for all results. We often regurgitate the same
> path-prefix over and over and  over, making the configuration harder
> to read. Perhaps "location-prefix" could be a global setting.
> 
> -Ted.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Enhancement-to-Zero-Config%3A-Default-Success-Result-tf3324150.html#a9279662
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: [s2] Enhancement to Zero Config: Default Success Result

Posted by Ted Husted <hu...@apache.org>.
On 2/28/07, mraible <ma...@raibledesigns.com> wrote:
> One change I'd like to see to the codebehind plugin is the ability to
> specify the default location of pages. For example WEB-INF/pages.  Or is
> that what the "struts.codebehind.defaultPackage" constant is for?

I'd like to see that for all results. We often regurgitate the same
path-prefix over and over and  over, making the configuration harder
to read. Perhaps "location-prefix" could be a global setting.

-Ted.

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