Quantcast
Channel: PTC Community : All Content - Windchill
Viewing all articles
Browse latest Browse all 6049

How to configure your own MVC Controller in WIndchill in treatment

$
0
0

请教大家,怎样在自己的 WC10.2 F000 系统中配置自己的 MVC 处理架构

 

1. {wt.home}\Windchill_10.2\Windchill\codebase\config\mvc  配置文件: custom.xml

Header 1Header 2
注册 Controller<bean class="com.cmd.part.mvc.controller.CommonController"/>

 

2. {wt.home}\Windchill_10.2\Windchill\codebase\config\mvc  配置文件: custom.properties

Header 1Header 2
路径 映射#/servlet/cmd/app = CommonController

 

3.编写Spring 注解的 Controller Java Class

Header 1

//@Controller("CommonController")

public class CommonController {

 

//@RequestMapping("get/app")

public void getData(HttpServletRequest request, HttpServletResponse response, HttpParams data){

 

}

 

}

 

4. Web 页面使用 Extjs 框架。 使用 Ajax.request

 

Header 1

var myAjax = new Ajax.Request(

        "Windchill/get/app",

        {

            method:"post",       //表单提交方式

            parameters:"name=acai&age=26&sex=male",   //提交的表单数据

            setRequestHeader:{"If-Modified-Since":"0"},     //禁止读取缓存数据

            onComplete:function(x){    //提交成功回调

                    alert(x.responseText);

            },

            onError:function(x){          //提交失败回调

                    alert(x.statusText);

            }

        }

   );

 

通过 URL 请求到具体的 Controller  的 方法。


Viewing all articles
Browse latest Browse all 6049

Latest Images

Trending Articles



Latest Images