*/
public String getViewPath(String className, String methodName, String viewName) {
if (StringUtils.isNotEmpty(viewName)) {
if (viewName.charAt(0) == Constants.separator) { return viewName; }
}
Profile profile = profileServie.getProfile(className);
if (null == profile) { throw new RuntimeException("no convention profile for " + className); }
StringBuilder buf = new StringBuilder();
if (profile.getViewPathStyle().equals(Constants.FULL_VIEWPATH)) {
buf.append(Constants.separator);
buf.append(profile.getSimpleName(className));
} else if (profile.getViewPathStyle().equals(Constants.SIMPLE_VIEWPATH)) {
buf.append(profile.getViewPath());
// 添加中缀路径
buf.append(profile.getInfix(className));
} else if (profile.getViewPathStyle().equals(Constants.SEO_VIEWPATH)) {
buf.append(profile.getViewPath());
buf.append(StrUtils.unCamel(profile.getInfix(className)));
} else {
throw new RuntimeException(profile.getViewPathStyle() + " was not supported");
}
// add method mapping path
buf.append(Constants.separator);
if (StringUtils.isEmpty(viewName) || viewName.equals("success")) {
viewName = methodName;