[ 
https://issues.apache.org/jira/browse/SCB-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331792#comment-16331792
 ] 

ASF GitHub Bot commented on SCB-253:
------------------------------------

wujimin commented on issue #517: [SCB-253] make integrate with spring-webmvc 
view simpler
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/517#issuecomment-358876529
 
 
   already update the document.
   https://java.huaweicse.cn/build-provider/protocol/rest-over-servlet.html
   
   微服务默认不建议跟UI功能混合在一起,所以RestServletContextListener中并未初始化springmvc内置的spring 
context,如果业务有特殊需求,需要将UI跟微服务混合在一个进程中部署,需要使用springmvc中的view能力,那么不能在web.xml中同时配置RestServletContextListener以及springmvc的DispatcherServlet,直接用DispatcherServlet的使用方法,但是将org.springframework.web.servlet.DispatcherServlet修改为org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet即可
   
   
CseDispatcherServlet的功能在2018.2月以后发布的版本中才有,如果是之前的版本需要继承DispatcherServlet,再在web.xml中使用继承类:
   ```
   @Override
   protected WebApplicationContext 
createWebApplicationContext(ApplicationContext parent){
     setContextClass(CseXmlWebApplicationContext.class);
     return super.createWebApplicationContext(parent);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> As a developer, I  want to use springmvc's view function
> --------------------------------------------------------
>
>                 Key: SCB-253
>                 URL: https://issues.apache.org/jira/browse/SCB-253
>             Project: Apache ServiceComb
>          Issue Type: New Feature
>          Components: Java-Chassis
>            Reporter: wujimin
>            Assignee: wujimin
>            Priority: Major
>             Fix For: java-chassis-1.0.0-m1
>
>
> not suggest provide UI together with data
> so in rest servlet listener, we did not instance springmvc spring context
>  
> but if user want to do this, it's better we provider a easy way to do that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to