廖井涛
2025-11-28 67f0be5a1d634ba3274fa9366ceacc3580f056b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.northglass.web.mes;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
 
@Controller
@RequestMapping(value="/mesview")
public class JSPController {
 
    //page路径从属于layout.jsp, 不属于独立页,有菜单栏
    @RequestMapping(method=RequestMethod.GET, value="/_{groups}")
    public String getView(@PathVariable("groups") String groups){
        
 
            return "mes/view/"+groups;
    }
    
    //page路径下不从属于layout.jsp, 属于独立页,样式也和layout无关
    @RequestMapping(method=RequestMethod.GET, value="/page/_{groups}")
    public String getPage(@PathVariable("groups") String groups){
            return "mes/page/"+groups;
    }
    
    //专用于返回数据,返回一般用于返回json结构的数据,xml也可
    //由于jsp文件头<%page >的的原因该返回的数据有开头的空行,如果想在jsp里直接返回字符串,在前端接收时在前端去除空行
    @RequestMapping(method=RequestMethod.POST, value="data/_{groups}")
    public String getData(@PathVariable("groups") String groups){        
            return "mes/data/"+groups;
    }
    
 
    
}