2012-08-15 3 views
1

내가 지금까지 내 경로 탈출 세미콜론 경로 playframework 2.0.2

GET  /redirect   com.test.redirect(redirecturl: String?="") 

내 컨트롤러이 있고, playframework로 리디렉션 기능을하고 싶으면이가 작동

public static Result redirect(String redirecturl) { 
    return redirect(redirectURL); 
} 

잘하지만 세미콜론이 포함 된 URL을 전달할 때 문제가 발생합니다. ";

내가

http:localhost:9000/redirect?redirecturl=http://www.google.com;testaftersemicolon

에 가면 그것은 google.com으로 나를 리디렉션하지만 내 로그에 redirecturl가 아니라 "http://www.google.com"세미콜론 후 중지하는 같습니다.

탈출 할 방법이 있습니까? 또는 게임 내에서 맞춤식 라우팅을 수행 하시겠습니까?

감사

답변

1

당신은 루트 파일에서 사용자 지정 정규 표현식을 사용하여 탈출 할 수 있어야한다. 이 내용은 the documentation about routing에 설명되어 있습니다. 기본적으로 다음과 같이 작동해야합니다.

GET  /redirect/$url<.+>   com.test.redirect(url: String?="")