2014-04-09 3 views
1

jhipster에서 URL에 해시 '#'을 사용할 수 없지만 '?' 잘 작동합니다. 예를 들어jhipster에서는 url에서 '#'해시를 사용할 수 없지만 물음표 '?'는 사용할 수 없습니다. 괜찮아요.

:

www.basicurl.com/firstname.lastname#/demo/test

그것은된다 URL에서 "firstname.lastname"를 제거

www.basicurl.com #/demo/test. 나는 물음표를 사용할 때이된다 :

basicurl.com/firstname.lastname?/demo/test

이 잘 작동합니다.

이름 및 성을위한 프로필 페이지 매핑에 대한 나의 코드는 다음과 같습니다 :

@RestController 
public class ProfileMappingResource { 


    @RequestMapping(value = "/{firstName}.{lastName}", method = RequestMethod.GET, produces = "application/json") 
    @Timed 
    public void loadProfilePageMapping(@PathVariable String firstName,@PathVariable String lastName,HttpServletRequest request,HttpServletResponse response) { 

     String newURI = "/dist" + "/profile.html"; 
     try { 
      RequestDispatcher requestDispatcher = request.getRequestDispatcher(newURI); 
      requestDispatcher.forward(request, response);   
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
     return; 
    } 
} 

답변

0

때문이다 그? URL의 나머지 부분을 매개 변수 문자열 (일반적으로? param1 = value1 & param2 = value2 등)로 분할하므로 경로 변수로 사용하지 않습니다.