struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Conventions Plugin Changes Since 2.2.1?
Date Thu, 11 Jul 2013 07:16:56 GMT
Hi Bruce,

Have you imported that code into Struts repository? I would like to
help you and solve the problem.

The problem is with package name - org.apache.struts - is on the
default excludePackages list which means all actions in that package
will be omitted during classpath scanning. Thus is related to
https://issues.apache.org/jira/browse/WW-3418

The solution is to define the below constant in struts.xml

<constant name="struts.convention.exclude.packages"
              value="org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*"/>

Thus will allow to have actions in org.apache.struts.* but the
namespace will be resolved as /struts2annotations/actions as struts
(from org.apache.struts) is a locator for actions. To solve that
another constant is needed:

<constant name="struts.convention.action.packages"
             value="org.apache.struts.struts2annotations.actions"/>

Please remember, that this setup is specific to that app (and usage of
org.apache.struts as a package name), any other application should
work out-of-the-box (with different package name).

So maybe it'd be a good idea to use different names of packages in
demo apps? ie. com.gostruts (I already own it) ? or I can register any
other.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/7/3 bphillips@ku.edu <bphillips@ku.edu>:
> I'm updating the example applications located here
> http://code.google.com/p/struts2-examples/downloads/list   and moving them
> to our Subversion repository.  These example applications are referenced in
> our Getting Started Tutorials:
> http://struts.apache.org/release/2.3.x/docs/getting-started.html
>
>
> I'm currently working on updating the Struts 2 convention and annotations
> example application from 2.2.1 to 2.3.15.
>
> This example application:
> http://code.google.com/p/struts2-examples/downloads/detail?name=Struts2_Annotations_Mvn_2_2_1.zip
> uses the Struts 2 convention plugin and version 2.2.1 of Struts.  It works
> fine.
>
> After updating the version of Struts to 2.3.15 and removing the javassist
> dependency (no longer needed to be a separate dependency in Struts 2.3.15)
> the Actions are no longer found by the convention plugin.
>
> I checked the Convention plugin documentation at
> http://struts.apache.org/release/2.3.x/docs/convention-plugin.html and I
> cannot find any reasons why this code should no longer work.
>
> If someone could review the application
> (http://code.google.com/p/struts2-examples/downloads/detail?name=Struts2_Annotations_Mvn_2_2_1.zip)
> and its associated tutorial
> (http://struts.apache.org/release/2.3.x/docs/struts-2-annotations.html) and
> help me figure out why the example application no longer works under 2.3.15
> and what I need to change to get it to work for 2.3.15 that would be great.
>
> Then I can update the tutorial and example application.
>
> Bruce
>
>
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Conventions-Plugin-Changes-Since-2-2-1-tp5713039.html
> 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
>

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


Mime
View raw message