Spring mvc采用配置的方式前转页面

阅读更多

 Controller

package com.tibco.gse.web.cms;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class Login {

	@RequestMapping(value = "/cms/login", method = RequestMethod.GET)
	public String login(
			@RequestParam(required = false, value = "error") String error,
			Model model) {
		model.addAttribute("error", error);

		return "forward:/jsp/login.jsp";

	}

}

 

 

applicationContext-mvc.xml




	
	
	
	 

     
          
              classpath:spring/spring-views.xml
          
     
	
	 
        
        
                
    
	

 

 spring-views.xml



         
         
	        
	    
	    
	    
	        
	    
         

 

你可能感兴趣的:(Spring mvc采用配置的方式前转页面)