Hello Lukasz, thank you for your answer, *1.* I have severals problems when include the configuration for the rest-plugin in struts.xml (attachment the file):
- Get HTTP for http://ipserver:port/weapp/index.action (for example) return HTTP 404 code error. Before include the rest plugin configuration the application worked fine. - The generated code for <s:a title="Link Index Action" action="index.action"> now is <a href="/webapp/index.action.xhtml" title="Link Index Action" />. Before include the rest plugin configuration the generated code was <a href="/webapp/index.action" title="Link Index Action" />. Why is added the suffix '.xhtml' to the URL of the actions? This result in the next Exception: *java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.index()* *2.* For the rest's methods (index, show, create, update, destry, edit and new) Do the REST Actions must extend from some class or implement some interface of the Struts2 API? I hope you can help me understand and use the rest plugin since my application is based on struts2 and the ideal, in my case, would be that the rest requirements are implemented within the same application and because I not found much information about rest plugin. Thanks and regards, 2012/2/10 Łukasz Lenart <lukasz.len...@googlemail.com> > 2012/2/9 developer researcher <java.developer.researc...@gmail.com>: > > 1. both normal action and restful action in the same web application. > > Define struts.rest.namespace as mentioned in the docs > > > 2. The URL structure for resources must be: > > - /list/ ==> show a list of resoruces in json format > > - /list/{id} ==> show the resource identified by id > > /list/ => implement ListAction.index > /list/{id} => implement ListAction.show > > > Regards > -- > Łukasz > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.devMode" value="true" /> <constant name="struts.ObjectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" /> <!--Configuracion REST Plugin--> <constant name="struts.convention.action.suffix" value="Controller"/> <constant name="struts.convention.action.mapAllMatches" value="true"/> <constant name="struts.convention.default.parent.package" value="rest-default"/> <constant name="struts.convention.package.locators" value="com.mycompany.rest.example"/> <!--<constant name="struts.rest.defaultExtension" value="json"/>--> <constant name="struts.rest.namespace" value="/rest"/> <!--Others Actions--> </struts>
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org