Typically you use DWR to integrate with your business layer (Managers)
and not the web controllers. It looks like DWR can't call your action
because the action is called outside of the Struts context.
DWR is more about marshalling direct from your business layer to
client JavaScript, hence the name. So if you can't call your business
class or don't have one, then perhaps you really want to make an AJAX
http request to struts instead. I have had success with Jquery
calling Struts actions that output JSON results using the JSON plugin.
On Jul 4, 2009, at 8:35 PM, foward <fow...@gmail.com> wrote:
Hello,
I have several questions related how integrate DWR and appfuse with
Struts2
framework. I try to do some integration but I have an error :
PWC1231: Servlet.service() para el servlet dwr-invoker desencadenó u
na
excepción
java.lang.NoClassDefFoundError:
com/opensymphony/xwork/config/ConfigurationException .....
I google a lot to find how integrate dwr but I cannot find the
solution...(
Only I look that I have to put the DWRAction.java in my source code
but I
dont know if this is correct : http://kkbear.javaeye.com/blog/
125130 ...)
Here the configurations files:
------ view.JSP -----
...
<script type="text/javascript" src="<c:url
value="/dwr/interface/DWRAction.js"/>"></script>
<script type="text/javascript" src="<c:url
value="/scripts/DWRActionUtil.js"/>"></script>
<script type='text/javascript' src="<c:url
value="/dwr/engine.js"/>"></script>
<script type='text/javascript' src="<c:url
value="/dwr/util.js"/>"></script>
</head>
<script language="JavaScript" type="text/javascript">
var cbf = function done(data)
{
alert('came here');
}
function doValidate() {
DWRActionUtil.execute({
namespace:'default',
action:'crearEncuesta',
method:'list',
executeResult:'true'
}, {}, cbf);
alert('OH YEAH BABE');
}
</script>
------ dwr.xml ----
<dwr>
<allow>
<create creator="none" javascript="DWRAction">
<include method="execute"/>
</create>
<convert converter="bean"
match="org.directwebremoting.webwork.ActionDefinition">
</convert>
<convert converter="bean"
match="org.directwebremoting.webwork.AjaxResult"/>
</allow>
</dwr>
---- struts.xml ----
<action name="crearEncuesta" class="formAction">
<result>/WEB-INF/pages/encuestas/createForm.jsp</result>
<result
name="error">/WEB-INF/pages/encuestas/formList.jsp</result>
</action>
----- web.xml -----
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-
class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>xfire</servlet-name>
<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
Kind Regards
Pancho
--
View this message in context:
http://www.nabble.com/DWR-appfuse-struts2-integration-fail-tp24339860s2369p24339860.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net