Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

UnifyqueryMap methods, fix diffent behaviour and edge cases#13223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mkurz wants to merge2 commits intoplayframework:main
base:main
Choose a base branch
Loading
frommkurz:query_map_fixes

Conversation

mkurz
Copy link
Member

...WORK IN PROGRESS...

I am not working on this right now, I am just pushing things I tried a couple of days ago.
No one complained yet and I think it's not so super important right now because some edge cases are really total edge cases.

Like said in that comment we use a different logic to create the query map and in some cases the methods behave slightly different. Of course it would be better if all methods use the same logic/method.

Test code for sample app to test locally

Java action:

publicResultindex(Http.Requestrequest) {System.out.println();System.out.println("one:" +request.queryString("one"));System.out.println("two:" +request.queryString("two"));System.out.println("three:" +request.queryString("three"));System.out.println("empty:" +request.queryString(""));returnok("one:" +request.queryString("one") +"<br>" +"one?+" +request.queryString("one?+") +"<br>" +"two:" +request.queryString("two") +"<br>" +"two=:" +request.queryString("two=") +"<br>" +"three:" +request.queryString("three") +"<br>" +"empty:" +request.queryString("") +"<br>" +"empty_all:" +Arrays.stream(request.queryString().getOrDefault("",newString[]{"<empty>"})).collect(Collectors.joining(","))        ).as("text/html");

Equivalent Scala action:

defindex()=Action {implicitrequest:Request[AnyContent]=>    println()    println("one:"+ request.getQueryString("one"))    println("two:"+ request.getQueryString("two"))    println("three:"+ request.getQueryString("three"))    println("empty:"+ request.getQueryString(""))Ok("one:"+ request.getQueryString("one")+"<br>"+"one?+:"+ request.getQueryString("one?+")+"<br>"+"two:"+ request.getQueryString("two")+"<br>"+"two=:"+ request.getQueryString("two=")+"<br>"+"three:"+ request.getQueryString("three")+"<br>"+"empty:"+ request.getQueryString("")+"<br>"+"empty_all:"+ request.queryString.get("").map(_.mkString(","))    ).as("text/html");  }

Testing with:

http://localhost:9000/?one=&two=a+b&http://localhost:9000/?one&two=a+b&http://localhost:9000/?one=&two=a+b&=http://localhost:9000/?one&two=a+bhttp://localhost:9000/?one?%2B=&two%3D

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mkurz

[8]ページ先頭

©2009-2025 Movatter.jp