Buggy code:
@ Controller @ RequestMapping ( "cms//design" ) public class CmsDesignController extends BaseController { @ Autowired private CmsModulePrototypeService cmsModulePrototypeService ; @ Autowired private List < ParameterGather > parameterGathers = new ArrayList < ParameterGather > ( ) ; @ Autowired private CmsPagePrototypeService cmsPagePrototypeService ; @ RequestMapping ( "//render-comp.html" ) public AjaxResult renderComp ( @ RequestParam ( value = "pageId" , defaultValue = "0" ) long pageId , String instanceTypeTag , long prototypeId , @ RequestParam ( value = "instanceId" , defaultValue = "0" ) long instanceId , HttpServletRequest request , HttpServletResponse response ) { } @ RequestMapping ( "//render-comp-form.html" ) public AjaxResult renderCompForm ( long instanceId , String instanceTypeTag , HttpServletRequest request , HttpServletResponse response ) { } @ RequestMapping ( "//module-prototype-list.html" ) public String modulePrototypeList ( ModelMap modelMap ) { } @ RequestMapping ( "//page-prototype-list.html" ) public String pagePrototypeList ( ModelMap modelMap ) { } @ RequestMapping ( "//create-page.html" ) public AjaxResult createPage ( long prototypeId ) { } @ RequestMapping ( "//save-page.html" ) public AjaxResult savePage ( long pageId , String pageLayout ) { } @ SuppressWarnings ( "unchecked" ) @ RequestMapping ( "//save-comp-params.html" ) public AjaxResult saveCompParams ( HttpServletRequest request , HttpServletResponse response ) { try { String instanceTypeTag = ServletRequestUtils . getStringParameter ( request , "instanceTypeTag" , "" ) ; long instanceId = ServletRequestUtils . getLongParameter ( request , "dbId" , 0 ) ; if ( ( instanceId == 0 ) || ( StringUtils . isBlank ( instanceTypeTag ) ) ) { return AjaxResult . errorResult ( "找不到您要编辑的模块" ) ; } BaseCmsInstance instance = getInstance ( instanceTypeTag , instanceId ) ; if ( null == instance ) { return AjaxResult . errorResult ( "找不到您要编辑的组件" ) ; } <START_BUG> CmsModulePrototype prototype = cmsModulePrototypeService . getById ( instance . getPrototypeId ( ) ) ; <END_BUG> if ( null == prototype ) { return AjaxResult . errorResult ( "找不到您要编辑的组件原型" ) ; } List < ParameterGather > supportedGather = new ArrayList < ParameterGather > ( ) ; for ( ParameterGather gather : parameterGathers ) { if ( gather . support ( prototype ) ) { supportedGather . add ( gather ) ; } } Map < String , ParameterValuePair > paramMap = new HashMap < String , ParameterValuePair > ( ) ; for ( ParameterGather gather : supportedGather ) { List < ParameterValuePair > params = gather . gatherParams ( prototype , instance , request ) ; for ( ParameterValuePair pair : params ) { paramMap . put ( pair . getName ( ) , pair ) ; } } instance . setParamsWithList ( paramMap . values ( ) ) ; CmsPageInstance page = null ; long pageId = ServletRequestUtils . getLongParameter ( request , "pageId" , 0 ) ; if ( pageId > 0 ) { page = cmsPageInstanceService . getById ( pageId ) ; } if ( null == page ) { return AjaxResult . errorResult ( "要编辑的页面不存在" ) ; } RenderContext context = getCommonContext ( request , response ) ; context . setMode ( design ) ; if ( ( TYPE_TAG . equals ( instanceTypeTag ) ) && ( instance instanceof CmsPageInstance ) ) { cmsPageInstanceService . save ( ( ( CmsPageInstance ) ( instance ) ) ) ; } else if ( ( CmsLayoutInstance . TYPE_TAG . equals ( instanceTypeTag ) ) && ( instance instanceof CmsLayoutInstance ) ) { cmsLayoutInstanceService . save ( ( ( CmsLayoutInstance ) ( instance ) ) ) ; } else if ( ( CmsColumnInstance . TYPE_TAG . equals ( instanceTypeTag ) ) && ( instance instanceof CmsColumnInstance ) ) { cmsColumnInstanceService . save ( ( ( CmsColumnInstance ) ( instance ) ) ) ; } else if ( ( CmsModuleInstance . TYPE_TAG . equals ( instanceTypeTag ) ) && ( instance instanceof CmsModuleInstance ) ) { cmsModuleInstanceService . save ( ( ( CmsModuleInstance ) ( instance ) ) ) ; } evictCache ( page , instance , context ) ; AjaxResult renderResult = renderComp ( pageId , instanceTypeTag , prototype . getDbId ( ) , instanceId , request , response ) ; if ( renderResult . isSuccess ( ) ) { return AjaxResult . successResult ( ) . addData ( "compContent" , renderResult . getRawData ( ) ) ; } else { return AjaxResult . errorResult ( ) ; } } catch ( Exception e ) { logger . error ( "保存模块参数错误！" , e ) ; return AjaxResult . errorResult ( ) ; } } No newline ; at end ; of file ; }

Fix:
BaseCmsPrototype prototype = getPrototype ( instanceTypeTag , instance . getPrototypeId ( ) ) ;