Hi Wes, thanks for the post.
I like the idea of being able to decorate screens differently depending
on device without changing much existing code and I can see a use to
this for example for pages being given a different footer to provide
device specific links or adding side menus for devices with enough
screen space. (The main focus of my web pages are application GUI rather
than content). I do intend to look into sitemesh but I know nothing
about it as yet. However, what sitemesh (I don't think anyway) cannot do
is for example, for an old blackberry that does not support html tables
very well, allow me to render a list of results in a business card style
layout instead of a four column table - if it can then I'd be glad to
know how and investigate it's use further as it would solve some of the
problems I encounter.
Wes Wannemacher wrote:
> I admit that I haven't read the whole thread, so flame me if you
> covered the answer already, but...
>
> Have you looked at Sitemesh? I would suggest look at creating
> different decorators for each of the devices you want to support, then
> code your undecorated JSPs so that they can be decorated based on the
> device accessing it. Sitemesh has a ton of different ways you can pick
> the decorator, so I would imagine you'd be able to find a way to
> abstract the decorator picking logic outside of your business logic.
> Then, the advantage of the decorator pattern is that you can code your
> UI screens and business logic once and just have the screens decorated
> differently based on the abstracted decorator picking logic. (As a
> bonus, you can add new decorators for new devices without changing
> much)
>
> -Wes
>
>
On Fri, Jan 29, 2010 at 19:09, Miguel <miguelrvs@(protected):
> Hi,
> Thanks for answering!!
> I'll post my relevant configurations. I'm using spring 2.5.6 and struts 2.1.8.1.
> I have the spring plugin in the struts.conf, and my actions are
> correctly autowired by name.
> I also have an include in struts.conf where the relevant action is called.
> The thing here is I have two beans of the same type but configured to
> access different hibernate entity-names (a DAO), and in the part that
> misbehaves, i need to access the second one that has a different name,
> but is of the same type.
> When I make spring instanciate the action, the prepare() method in the
> action is called correctly, and it uses the autowired DAO, it gets the
> desired data but the details() method is not called and the result is
> automatically redirected to INPUT result.
> When I make struts (using the spring factory( instanciate the action,
> the prepare() method in the action is called correctly, and it uses
> the autowired DAO, it gets the desired data, the details() method is
> called and the result is shown correctlly.
> Curiosly the browse method is correctly called en each config.
> The thing here is I have replicated some part of the system, and I
> have identical class names in different packages (the code in the
> classes is not the same), and those classes are called from different
> urls in struts.conf. The action has no validators but it's twin class
> in a different package does.
>
> struts.conf:
> <constant name="struts.devMode" value="true" />
> <constant name="struts.objectFactory"
> value="
org.apache.struts2.spring.StrutsSpringObjectFactory" />
> <constant name="struts.freemarker.templatesCache" value="true" />
>
> <package name="proyectox" extends="json-default" ><!-- struts-default -->
> <!-- Si no le pones este stack, pues no funciona...-->
> <interceptors>
> <interceptor name="strutsSpring"
> class="com.proyectox.ui.interceptor.HibernateOpenSessionInViewInterceptor"/>
> <interceptor-stack name="strutsSpringPPPStack">
> <interceptor-ref name="strutsSpring"/>
> <interceptor-ref name="paramsPrepareParamsStack"/>
> </interceptor-stack>
> </interceptors>
> <include file="com/fcm/sectorPrimario2009/sectorPrimario.struts.xml"/>
> ....
>
>
> com/fcm/sectorPrimario2009/sectorPrimario.struts.xml:
> <package name="receptorsectorprimario" extends="proyectox"
> namespace="/sectorprimario/receptor">
>
> <action name="lista" method="browse"
> class="com.fcm.sectorPrimario2009.ui.ReceptorAction">
> <result>listaReceptor.jsp</result>
> <result name="error">listaReceptor.jsp</result>
> <interceptor-ref name="scope">
> <param name="session">contribuyente</param>
> <param name="autoCreateSession">true</param>
> <param name="key">contribuyenteActual</param>
> </interceptor-ref>
> <interceptor-ref name="strutsSpringPPPStack"/>
> </action>
>
> <action name="receptor_*" method="{1}"
> class="com.fcm.sectorPrimario2009.ui.ReceptorAction">
> <result>receptorDetail.jsp</result>
> <result name="detail">receptorDetail.jsp</result>
> <result name="input">receptorNuevo.jsp</result>
> <result name="modificar">receptorNuevo.jsp</result>
> <result name="borrar" type="redirectAction">
> <param name="actionName">lista</param>
> </result>
> <result name="error">/error.jsp</result>
> <interceptor-ref name="scope">
> <param name="session">contribuyente</param>
> <param name="autoCreateSession">true</param>
> <param name="key">contribuyenteActual</param>
> </interceptor-ref>
> <interceptor-ref name="scope">
> <param name="session">receptor</param>
> <param name="autoCreateSession">true</param>
> <param name="key">receptorActualSP</param>
> </interceptor-ref>
> <interceptor-ref name="strutsSpringPPPStack"/>
> </action>
> ...
>
>
> sectorPrimario.spring.xml:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jee="http://www.springframework.org/schema/jee"
> xmlns:sec="http://www.springframework.org/schema/security"
> xmlns:tx="http://www.springframework.org/schema/tx"
> xmlns:aop="http://www.springframework.org/schema/aop"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> http://www.springframework.org/schema/jee
> http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
> http://www.springframework.org/schema/security
> http://www.springframework.org/schema/security/spring-security-2.0.xsd
> http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> "
> default-autowire="autodetect">
>
> <bean id="receptorDAOSectorPrimario"
> class="com.fcm.sectorPrimario2009.dao.ReceptorDAOImpl">
> <property name="sessionFactory" ref="sessionFactory" />
> <property name="entityName" value="SP_Receptor"/>
> </bean>
>
>
> <bean id="cfdDAOSectorPrimario" class="com.proyectox.DAO.CfdDAOImpl">
> <property name="sessionFactory" ref="sessionFactory" />
> <property name="relName" value="SP_FACTURA"/>
> <property name="toXML" ref="toXML" />
> <property name="contribuyenteDAO" ref="contribuyenteDAO" />
> <property name="impuestosDAO" ref="impuestosDAO" />
> <property name="repository">
> <bean class="com.fcm.repository.Nom151RepositoryAdaptor">
> <property name="repository" ref="nom151Repository"/>
> </bean>
> </property>
> </bean>
>
> <bean id="receptorSPAction"
> class="com.fcm.sectorPrimario2009.ui.ReceptorAction"
> scope="prototype">
> <property name="receptorDAO"><ref
> local="receptorDAOSectorPrimario"/></property>
> </bean>
>
>
> ReceptorAction.java
>
> public class ReceptorAction extends ActionSupport implements Preparable {
> private static final long serialVersionUID = 4361713845701104303L;
> ...
> public void prepare() throws Exception {
> // msg = pais+" Pais: "+pais.getNombre()+" idobt: "+id;
> if ((receptor == null && id != null) || (receptor != null && id !=
> null && receptor.getId() != id)){
>
> receptor = (ReceptorPrimario)receptorDAO.find(id);
> }
> else if (receptor == null && id == null){
> receptor = new ReceptorPrimario();
> }
>
> @(protected)
> public String browse(){
> // receptores = receptorDAO.findAll();
> receptores = receptorDAO.findByContribuyente(contribuyente);
> if (receptores == null ){
> msg ="Algo funciono mal";
> return ERROR;
> }
> if(receptores.size() ==0){
> msg="No hay receptores";
> return SUCCESS;
> }
> return SUCCESS;
> }
>
> @(protected)
> public String detail(){
> if (receptor == null)
> return ERROR;
> // msg = id.toString();
> // msg = "detail de persona fisica "+receptor;
> return "detail";
> }
> ...
> }
>
>
> web.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
> version="2.5">
>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> <welcome-file>index.htm</welcome-file>
> <welcome-file>index.jsp</welcome-file>
> <welcome-file>default.html</welcome-file>
> <welcome-file>default.htm</welcome-file>
> <welcome-file>default.jsp</welcome-file>
> </welcome-file-list>
>
> <display-name>ProyectoX app</display-name>
> <resource-ref>
> <res-ref-name>jdbc/DB</res-ref-name>
> <res-type>
javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> <resource-ref>
> <description>
> Resource reference to a factory for
javax.mail.Session> instances that may be used for sending electronic mail
> messages, preconfigured to connect to the appropriate SMTP
> server.
> </description>
> <res-ref-name>mail/Session</res-ref-name>
> <res-type>
javax.mail.Session</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>
> classpath:spring.cfg.xml
> </param-value>
> </context-param>
> <context-param>
> <param-name>log4jConfigLocation</param-name>
> <param-value>/WEB-INF/classes/log4j.xml</param-value>
> </context-param>
>
> <filter>
> <filter-name>springSecurityFilterChain</filter-name>
> <filter-class>
org.springframework.web.filter.DelegatingFilterProxy</filter-class>
> </filter>
>
> <filter-mapping>
> <filter-name>springSecurityFilterChain</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <listener>
> <listener-class>
org.springframework.web.context.ContextLoaderListener</listener-class>
> </listener>
> <listener>
> <listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
> </listener>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>
org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
> </filter>
>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> </web-app>
>
> In past projects I have made the same trick of making spring
> instanciate actions, and this is the first time I have this behavior.
> In the other project, I use the same spring version, but struts 2.1.6,
> and the struts.conf has not includes. I'll test it without includes to
> see if the error appears or not.
>
> Thanks for your help.
>
>
> Si quieres ser más positivo, pierde un electrón
> Miguel Ruiz Velasco Sobrino
>
>
>
> On Fri, Jan 29, 2010 at 14:27, Wes Wannemacher <wesw@(protected):
>> What you are doing should work the way you expect... I use the Spring
>> integration all the time :)
>>
>> A few simple questions, do you have the spring-plugin installed? Do
>> you have the Spring ContextLoaderListener setup in the web.xml? Do you
>> have any non-default configuration settings in any of web.xml,
>> applicationContext.xml or struts.xml? Are you using any plugins other
>> than the Spring plugin? What version of Spring and Struts are you
>> using?
>>
>> -Wes
>>
>> On Fri, Jan 29, 2010 at 1:19 AM, Miguel <miguelrvs@(protected):
>>> Hello all,
>>> I have a problem when using spring and the spring aplication context.
>>> If I configure the action class directly from struts.conf, my action
>>> does just the correct behavior. (1)
>>> But if I configure the action in a spring file and in struts.conf put
>>> only the spring bean name everything gets piped to the input result
>>> (the prepare method is executed, but not the action method).(2)
>>> I would benefit if the second scenario worked, because in the spring
>>> configuration is quite complex and have more than one bean of the same
>>> type
>>>
>>> (1) <action name="receptor_*" method="{1}"
>>> class="com.fcm.sectorPrimario2009.ui.ReceptorAction"> (struts.conf)
>>>
>>> (2) <action name="receptor_*" method="{1}" class="receptorSPAction">
>>> (struts.conf)
>>>
>>> <bean id="receptorSPAction"
>>> class="com.fcm.sectorPrimario2009.ui.ReceptorAction"
>>> scope="prototype"> (spring.xml)
>>> <property name="receptorDAO"><ref
>>> local="receptorDAOSectorPrimario"/></property>
>>> </bean>
>>>
>>> I hope someone can help me
>>>
>>>
>>>
>>>
>>> Si quieres ser más positivo, pierde un electrón
>>> Miguel Ruiz Velasco Sobrino
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>>
>> --
>> Wes Wannemacher
Hello,
I have done further testing and the problem appears related to the
combination of spring-defined beans and struts wildcards.
The actions that don't have wildcards behave identically if they are
created and wired by the struts-spring factory or by spring itself,
but the actions that have wildcards fail, as if there is some
validation that redirects them allways to INPUT.
Both beans receptorDAO and receptorDAOSectorPrimario conform to the
same interface ReceptorDAO, so the only way to autowire the actions is
to declare them in the applicationContext in spring.
spring.xml:
<bean id="receptorDAO" class="com.proyectox.DAO.ReceptorDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
...
<bean id="receptorDAOSectorPrimario"
class="com.fcm.sectorPrimario2009.dao.ReceptorDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
<property name="entityName" value="SP_Receptor"/>
...
<bean id="receptorSPAction"
class="com.fcm.sectorPrimario2009.ui.ReceptorAction"
scope="prototype">
<property name="receptorDAO"><ref
local="receptorDAOSectorPrimario"/></property>
struts.xml:
<struts>
<!--<constant name="struts.serve.static" value="false" /> para que
no sirva el css ni el js -->
<constant name="struts.devMode" value="true" />
<constant name="struts.objectFactory"
value="
org.apache.struts2.spring.StrutsSpringObjectFactory" />
<constant name="struts.freemarker.templatesCache" value="true" />
<package name="proyectox" extends="json-default" ><!-- struts-default -->
<!-- Si no le pones este stack, pues no funciona...-->
<interceptors>
<interceptor name="strutsSpring"
class="com.proyectox.ui.interceptor.HibernateOpenSessionInViewInterceptor"/>
<interceptor-stack name="strutsSpringPPPStack">
<interceptor-ref name="strutsSpring"/>
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
</interceptors>
...
<package name="receptorsectorprimario" extends="proyectox"
namespace="/sectorprimario/receptor">
<action name="receptor_*" method="{1}" class="receptorSPAction">
<result>receptorDetail.jsp</result>
<result name="detail">receptorDetail.jsp</result>
<result name="input">receptorNuevo.jsp</result>
<result name="modificar">receptorNuevo.jsp</result>
<result name="borrar" type="redirectAction">
<param name="actionName">lista</param>
</result>
<result name="error">/error.jsp</result>
<interceptor-ref name="scope">
<param name="session">contribuyente</param>
<param name="autoCreateSession">true</param>
<param name="key">contribuyenteActual</param>
</interceptor-ref>
<interceptor-ref name="scope">
<param name="session">receptor</param>
<param name="autoCreateSession">true</param>
<param name="key">receptorActualSP</param>
</interceptor-ref>
<interceptor-ref name="strutsSpringPPPStack"/>
</action>
Currently I have changed the name of the property in the actions so it
matches the name in the application context, the struts autowire by
name work, but I someone has any pointer of what should I do to test
this condition, I'll gladly do it.
Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco Sobrino
http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages
----- Original Message ----
> From: Jake Vang <vangjake@(protected)>
> To: user@(protected)
> Sent: Sat, January 30, 2010 4:10:31 PM
> Subject: interceptor is not being called for all action
>
> i have written an interceptor implementation, however, it seems i cannot get
> it to work. i have followed the instructions at
> http://struts.apache.org/2.x/docs/interceptors.html. i have also followed
> the instructions at
> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto
> use the interceptor with every action.
>
> however, when any of my actions run, i never see the pre and post processing
> logging messages (logging messages inside the intercept method). i do see
> the logging messages from the init and destroy methods. this is not a
> problem with logging (as for sanity checking, i also use System.out.println,
> and have Tomcat running in console mode). i also have placed some break
> points in the intercept(ActionInvocation) method, but these break points are
> never reached.
>
> this is my struts.xml.
>
>
>
>
>
> class="mypackage.DummyInterceptor"/>
>
>
>
>
>
>
>
>
>
> this is my DummyInterceptor class.
>
> public class DummyInterceptor implements Interceptor {
> private static final Log _log =
> LogFactory.getLog(DummyInterceptor.class);
> public void destroy() {
> _log.debug("dummy interceptor destroyed called");
> System.out.println("dummy interceptor destroyed
> called".toUpperCase());
> }
> public void init() {
> _log.debug("dummy interceptor init called");
> System.out.println("dummy interceptor init called".toUpperCase());
> }
> public String intercept(ActionInvocation actionInvocation) throws
> Exception {
> _log.debug("dummy interceptor intercept pre processing");
> System.out.println("dummy interceptor intercept pre
> processing".toUpperCase());
>
> String result = actionInvocation.invoke();
>
> _log.debug("dummy interceptor intercept post processing");
> System.out.println("dummy interceptor intercept post
> processing".toUpperCase());
> return result;
> }
> }
>
> i am using annotations for my Action classes, so i do not define any
> elements in struts.xml (using the Struts2 Convention jar).
>
> one very interesting thing i did was to get struts-default.xml out of the
> struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding: 1) a
> definition of my interceptor and 2) my interceptor onto the defaultStack.
> when i did this, my interceptor does work as expected (i see logging output
> from the intercept method, i can hit break points set inside this method)
> for all my actions.
>
> i wonder if there is some gotcha that i am missing here. is there something
> extra that i have to do when mixing annotations with interceptors?
>
> thanks.
what does that have to do with my problem? please enlighten.
On Sat, Jan 30, 2010 at 4:37 PM, Dave Newton <newton.dave@(protected):
>
> http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages
>
>
> ----- Original Message ----
> > From: Jake Vang <vangjake@(protected)>
> > To: user@(protected)
> > Sent: Sat, January 30, 2010 4:10:31 PM
> > Subject: interceptor is not being called for all action
> >
> > i have written an interceptor implementation, however, it seems i cannot
> get
> > it to work. i have followed the instructions at
> > http://struts.apache.org/2.x/docs/interceptors.html. i have also
> followed
> > the instructions at
> >
> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto
> > use the interceptor with every action.
> >
> > however, when any of my actions run, i never see the pre and post
> processing
> > logging messages (logging messages inside the intercept method). i do see
> > the logging messages from the init and destroy methods. this is not a
> > problem with logging (as for sanity checking, i also use
> System.out.println,
> > and have Tomcat running in console mode). i also have placed some break
> > points in the intercept(ActionInvocation) method, but these break points
> are
> > never reached.
> >
> > this is my struts.xml.
> >
> >
> >
> >
> >
> > class="mypackage.DummyInterceptor"/>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > this is my DummyInterceptor class.
> >
> > public class DummyInterceptor implements Interceptor {
> > private static final Log _log =
> > LogFactory.getLog(DummyInterceptor.class);
> > public void destroy() {
> > _log.debug("dummy interceptor destroyed called");
> > System.out.println("dummy interceptor destroyed
> > called".toUpperCase());
> > }
> > public void init() {
> > _log.debug("dummy interceptor init called");
> > System.out.println("dummy interceptor init
> called".toUpperCase());
> > }
> > public String intercept(ActionInvocation actionInvocation) throws
> > Exception {
> > _log.debug("dummy interceptor intercept pre processing");
> > System.out.println("dummy interceptor intercept pre
> > processing".toUpperCase());
> >
> > String result = actionInvocation.invoke();
> >
> > _log.debug("dummy interceptor intercept post processing");
> > System.out.println("dummy interceptor intercept post
> > processing".toUpperCase());
> > return result;
> > }
> > }
> >
> > i am using annotations for my Action classes, so i do not define any
> > elements in struts.xml (using the Struts2 Convention jar).
> >
> > one very interesting thing i did was to get struts-default.xml out of the
> > struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding:
> 1) a
> > definition of my interceptor and 2) my interceptor onto the defaultStack.
> > when i did this, my interceptor does work as expected (i see logging
> output
> > from the intercept method, i can hit break points set inside this method)
> > for all my actions.
> >
> > i wonder if there is some gotcha that i am missing here. is there
> something
> > extra that i have to do when mixing annotations with interceptors?
> >
> > thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
i read that section on that page 10 times and i don't know how that relates
to my problem. there's simply not enough information. i guess it's pointing
me to something about namespaces, but, how do we get around this?
on the other hand, the rest of that page was informative on annotations and
the convention plugin. when i added
interceptorRefs={@(protected)
method, the web application won't start up.
ERROR
com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error (
CommonsLogger.java:27)
- Dispatcher initialization failed
...
Caused by: Unable to find interceptor class referenced by ref-name
dummyStack - [unknown location]
how hard can it be to get this to work? interestingly, if i do this,
interceptorRefs={@(protected)
(but then, my Interceptor is not called).
On Sat, Jan 30, 2010 at 4:37 PM, Dave Newton <newton.dave@(protected):
>
> http://struts.apache.org/2.x/docs/convention-plugin.html#ConventionPlugin-XWorkpackages
>
>
> ----- Original Message ----
> > From: Jake Vang <vangjake@(protected)>
> > To: user@(protected)
> > Sent: Sat, January 30, 2010 4:10:31 PM
> > Subject: interceptor is not being called for all action
> >
> > i have written an interceptor implementation, however, it seems i cannot
> get
> > it to work. i have followed the instructions at
> > http://struts.apache.org/2.x/docs/interceptors.html. i have also
> followed
> > the instructions at
> >
> http://struts.apache.org/2.x/docs/how-do-we-configure-an-interceptor-to-be-used-with-every-action.htmlto
> > use the interceptor with every action.
> >
> > however, when any of my actions run, i never see the pre and post
> processing
> > logging messages (logging messages inside the intercept method). i do see
> > the logging messages from the init and destroy methods. this is not a
> > problem with logging (as for sanity checking, i also use
> System.out.println,
> > and have Tomcat running in console mode). i also have placed some break
> > points in the intercept(ActionInvocation) method, but these break points
> are
> > never reached.
> >
> > this is my struts.xml.
> >
> >
> >
> >
> >
> > class="mypackage.DummyInterceptor"/>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > this is my DummyInterceptor class.
> >
> > public class DummyInterceptor implements Interceptor {
> > private static final Log _log =
> > LogFactory.getLog(DummyInterceptor.class);
> > public void destroy() {
> > _log.debug("dummy interceptor destroyed called");
> > System.out.println("dummy interceptor destroyed
> > called".toUpperCase());
> > }
> > public void init() {
> > _log.debug("dummy interceptor init called");
> > System.out.println("dummy interceptor init
> called".toUpperCase());
> > }
> > public String intercept(ActionInvocation actionInvocation) throws
> > Exception {
> > _log.debug("dummy interceptor intercept pre processing");
> > System.out.println("dummy interceptor intercept pre
> > processing".toUpperCase());
> >
> > String result = actionInvocation.invoke();
> >
> > _log.debug("dummy interceptor intercept post processing");
> > System.out.println("dummy interceptor intercept post
> > processing".toUpperCase());
> > return result;
> > }
> > }
> >
> > i am using annotations for my Action classes, so i do not define any
> > elements in struts.xml (using the Struts2 Convention jar).
> >
> > one very interesting thing i did was to get struts-default.xml out of the
> > struts2-core-2.1.8.1.jar. i then modified struts-default.xml by adding:
> 1) a
> > definition of my interceptor and 2) my interceptor onto the defaultStack.
> > when i did this, my interceptor does work as expected (i see logging
> output
> > from the intercept method, i can hit break points set inside this method)
> > for all my actions.
> >
> > i wonder if there is some gotcha that i am missing here. is there
> something
> > extra that i have to do when mixing annotations with interceptors?
> >
> > thanks.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>