I've yet to try this but how do I tie this into conventions.

My issue is that I am following conventions, there are JSPs located as
views for the action (that is, located where conventions would expect to
find view). My idea is to create a tiles plugin that keeps struts
conventions as near as possible to the way they are. That is the body
content is always assumed to be at
/WEB-INF/content/{package}/{conventions-action-name}.{viewType}

So conventions will still have a valid result, so the UnknownHandler isn't
ideal because conventions will think there is a valid result, unless there
is some way to update the configuration even if it is to intentionally
break it...

Is it possible to do something like that with a custom ActionProxy?

Maybe there is a way to create a preresult listener for all conventions,
that somehow does the job of a result handler and then aborts the real
result handler?


On Mon, Nov 26, 2012 at 1:20 PM, Lukasz Lenart <lukaszlen...@apache.org>wrote:

> Hi,
>
> There is no easy way right now, you can try to implement
> UnknownHandler or at least extend ConventionUnknownHandler and
> override handleUnknownResult() method
>
>
> Regards
> --
> Ɓukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
>
> 2012/11/24 Ken McWilliams <ken.mcwilli...@gmail.com>:
> > Using struts2-convention-plugin-2.3.1.2 currently.
> >
> > I want conventions to still automatically find my actions, that is
> > determine  struts2 packages from java package structure and Identify
> action
> > names from Java Action classes, but I want it to stop there I want it to
> > universally use my custom result type for all actions.
> >
> > So far I have tried the following:
> >
> > 1) Explicitly setting the conventions parent package
> > <constant name="struts.convention.default.parent.package"
> > value="tiles-package"/>
> >
> > 2) Configuring that package with my result as the default
> >
> >     <package  name="tiles-package" extends="convention-default">
> >         <result-types>
> >             <result-type default="true" name="tiles"
> > class="com.kenmcwilliams.tiles.result.TilesResult"/>
> >         </result-types>
> >     </package>
> >
> > So far I can only get my result to take effect if I override conventions
> > with annotations.
> >
> > So far the following works:
> >
> > package com.kenmcwilliams.employmentsystem.action.test;
> >
> > import com.opensymphony.xwork2.ActionSupport;
> > import org.apache.struts2.convention.annotation.Result;
> >
> > @Result(type="tiles")
> > public class TilesAction extends ActionSupport{
> >
> > }
> >
> > The tiles result checks the location parameter which if not specified in
> > the result annotation it will look up the namespace and action name, then
> > using tiles regexp convention can be carried on through tiles.
> >
> > My current issue is dropping the need for '
> > @Result(type="tiles")' on every class. Any advice?
> >
> > Further I've created my own ConventionsServiceImpl if that helps, all it
> > currently does is print incoming parameters and return values to logs. I
> > haven't really been able to figure out what I can use it for.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to