[ https://issues.apache.org/jira/browse/WW-3832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13804174#comment-13804174 ]
Hudson commented on WW-3832: ---------------------------- SUCCESS: Integrated in Struts2-JDK6 #826 (See [https://builds.apache.org/job/Struts2-JDK6/826/]) WW-3832 Solves problem when not using flat layout with Convention plugin (lukaszlenart: rev 1535364) * /struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultResultMapBuilder.java * /struts/struts2/trunk/plugins/convention/src/test/java/org/apache/struts2/convention/DefaultResultMapBuilderTest.java > Convention cannot work when "struts.convention.result.flatLayout" set to FALSE > ------------------------------------------------------------------------------ > > Key: WW-3832 > URL: https://issues.apache.org/jira/browse/WW-3832 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Convention > Affects Versions: 2.3.4 > Environment: vista, tomcat6, maven, struts-convention-plugin, > struts-REST-plugin > Reporter: jun fang > Assignee: Lukasz Lenart > Labels: convention, flatLayout, plugins, rest > Fix For: 2.3.16 > > > The convention cannot work, when i set struts.convention.result.flatLayout" > to FALSE > steps: > 1. create a struts2 webapp, with struts2-convention-plugin-2.3.4 and > struts2-rest-plugin-2.3.4. > 2. in struts.xml, i wrote: > {code:xml} > <struts> > <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="example"/> > <constant name="struts.i18n.reload" value="true"/> > <constant name="struts.devMode" value="true"/> > <constant name="struts.convention.result.flatLayout" value="false"/> > <constant name="struts.convention.classes.reload" value="true" /> > <constant name="struts.convention.action.includeJars" value="false" /> > <constant name="struts.convention.exclude.packages" > value="org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*"/> > </struts> > {code} > 3. I entered https://localhost:8080/CONTEXT/users/1, and expected the server > return the JSP file located in "..\webapp\WEB-INF\content\users\show.jsp", > BUT it cannot found the file. > 4. I tried to review the SOURCE, and found that there MIGHTBE something wrong > in L363 in DefaultResultMapBuilder.java file. > {code:java} > <pre> > /* > * $Id: DefaultResultMapBuilder.java 1099705 2011-05-05 07:17:33Z jogep $ > */ > //... > public class DefaultResultMapBuilder implements ResultMapBuilder { > //... > protected void makeResults(Class<?> actionClass, String path, String > resultPrefix, > Map<String, ResultConfig> results, PackageConfig packageConfig, > Map<String, ResultTypeConfig> resultsByExtension) { > if (path.startsWith(resultPrefix)) { > int indexOfDot = path.indexOf('.', resultPrefix.length()); > // This case is when the path doesn't contain a result code > > /*L363*/ if (indexOfDot == resultPrefix.length() || !flatResultLayout) { > if (LOG.isTraceEnabled()) { > LOG.trace("The result file [#0] has no result code and > therefore" + > " will be associated with success, input and error by > default. This might" + > " be overridden by another result file or an > annotation.", path); > } > </pre> > {code} > 5. I wonder that the "||" should be "&&"? -- This message was sent by Atlassian JIRA (v6.1#6144)