You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pb...@apache.org> on 2008/07/20 03:52:24 UTC
S2: Multiple unknown handlers?
Using Struts 2.0.x, is it possible to have multiple unknown handlers? I am
using the Codebehind plugin and want to extend it. (Anyway to use the
library without having it load as a plugin?) I want to chain if the
Codebehind plugin cannot find a resource.
Paul
RE: S2: Multiple unknown handlers?
Posted by Brad A Cupit <br...@lsu.edu>.
On Sat, Jul 19, 2008 at 9:52 PM, Paul Benedict <pb...@apache.org>
wrote:
> Using Struts 2.0.x, is it possible to have multiple unknown handlers?
I am
> using the Codebehind plugin and want to extend it.
On Sat, Jul 19, 2008 at 11:41 PM, Musachy Barroso <mu...@gmail.com>
wrote:
> You will need this patch: http://jira.opensymphony.com/browse/XW-640
I wanted to do a similar thing, but Paul brings up a good point. To
extend the Codebehind plugin, it would need to be on the classpath, but
if it's on the classpath, Struts 2 will pick it up as a plugin.
Unfortunately, defining a new unknown handler in struts.xml won't
override what's set by the plugin. The new patch (presumably due in
Struts 2.2?) seems like a nice long term fix though.
A temporary (and very hacky) solution that I can think of is to remove
the struts-plugin.xml file from struts2-codebehind-plugin.jar
This is pretty nasty, but it's probably better than running with a
patched xwork.
Brad Cupit
Louisiana State University - UIS
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2: Multiple unknown handlers?
Posted by Musachy Barroso <mu...@gmail.com>.
You will need this patch: http://jira.opensymphony.com/browse/XW-640
for the unknown handlers. It still needs some review, but it works. We
are planning to get it in after the 2.1 release, so we can finally
move the convention plugin out of the sandbox.
musachy
On Sat, Jul 19, 2008 at 9:52 PM, Paul Benedict <pb...@apache.org> wrote:
> Using Struts 2.0.x, is it possible to have multiple unknown handlers? I am
> using the Codebehind plugin and want to extend it. (Anyway to use the
> library without having it load as a plugin?) I want to chain if the
> Codebehind plugin cannot find a resource.
>
> Paul
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
S2: struts.xml includes not actually loaded in order?
Posted by Be...@mhn.com.
Hi everyone,
Our struts.xml file is getting beastly, so I attempted to break it down
into multiple files.
I read this page:
http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html
Specifically:
"You can use <include> elements in your struts.xml interchangeably with
<package> elements. The configuration objects will be loaded in the order
of appearance. The framework reads the configuration from top to bottom and
adds objects as they are referenced."
Given that note above, I added the included file *after* my base package
(where some interceptor stacks are defined).
For example (struts.xml):
<struts>
<package name="baseEAP" extends="struts-default" abstract="true">
<interceptors>
<interceptor name="DataPrep" class=
"xxx.web.interceptor.DataPreparation" />
<interceptor-stack name="dataPrepStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="DataPrep"/>
</interceptor-stack>
</interceptors>
</package>
<include file="struts-ajax.xml" />
....
</struts>
Further down in struts.xml other packages extend baseEAP and have some
actions reference the dataPrepStack interceptor stack --- works great.
In struts-ajax.xml, the package also extends baseEAP and one action
references dataPrepStack:
<struts>
<package name="ajax" extends="baseEAP,gwt-default">
<!-- supports ajax calls in the menu management section of support
portal -->
<action name="ajaxManageMenus" class=
"xxx.web.action.MenuManagementServiceImpl">
<interceptor-ref name="dataPrepStack" />
<interceptor-ref name="gwt"/>
</action>
</package>
</struts>
I had hoped this would work like a charm too... but alas no:
<Jul 31, 2008 9:55:49 AM PDT> <Error> <HTTP> <BEA-101165> <Could not load
user defined filter in web.xml:
org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - interceptor-ref -
file:/C:/workspace_bea10/mhnEAP/exploded/mhnEAP.ear/mhnEAP.war/WEB-INF/classes/struts-ajax.xml:10:53
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
at
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
Truncated. see log file for complete stacktrace
Unable to find interceptor class referenced by ref-name dataPrepStack -
interceptor-ref -
file:/C:/workspace_bea10/mhnEAP/exploded/mhnEAP.ear/mhnEAP.war/WEB-INF/classes/struts-ajax.xml:10:53
at
com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:46)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1081)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildInterceptorList(XmlConfigurationProvider.java:536)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:374)
at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:465)
Truncated. see log file for complete stacktrace
Thoughts?
Thanks,
-B
---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org