B4J Question Web server

Zlgo

Member
Hi
Playing with web server example on https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172/ find that if you create simple form page with some visual app editor(instead one in example) in Logs part of B4J IDE appear message
" org.eclipse.jetty.http.BadMessageException: 400: Unable to parse form content" .
Is it some rules how must look HTML code that could be parsed correctly, in this page which I create is included background, dimension, location and other parameters? After all I put loop For / Next to extract
key from ParameterMap with break point on "For" line and left for 20 sec before go to next line(Step IN)
and then it parsed key from map! So it looks that for parsing other format it needs much more time to finish but before he throws error.
 

Zlgo

Member
Hi
I was out of home for while so I'm delay , but I try just simple example from your tutorial and only difference is new created page with some visual tool (Dynamic HTML editor) for easier positioning fields and no HTTPS port used. Just open from \\10.0.0.x:8080 , that's it. If i make delay(debuging) of cca 22sec. then req.ParameterMap is filled correctly. Second problem is if in some fields put word with diacritic char (from CP1250) program broke in copying ParametarMap into Map variable. OS is Win10
java version "1.8.0_191".
 
Upvote 0

Zlgo

Member
Hi
In B4J editor put "breakpoint" on some line for example line 39 in Main program (your web example)39 "Dim params As Map = req.ParameterMap", put mouse over
ParametarMap and wait that data show in floating window instead "error evaulating expression" and then release program with F10 (step out). With this procedure data
come in right shape and web page is refreshed with correct return data. Hope that I answer correctly on your question? If you can, try put some name in field with char from CP1250 and will see error occur , on my PC which use this code page it is easy to produce!

Regards
 
Upvote 0

Zlgo

Member
request content encoding
Hi
I'm not sure is it correct but I put <meta charset="utf-8"/> into header of both pages (my creation and one in example "Form example") but parsing still go bad if there is
diacritic signs or many chars above 127dec . Is there any explanation for first problem that parsing go wrong with created pages with some other tools?
Regards
 
Upvote 0

Zlgo

Member
Hi
There is WWW example with inserted new created form page.
In further trying, get positive result for using other chars (UTF 8 settings ) in form fields.
Regards
 

Attachments

  • ServerHelloWorld_Test.zip
    239.2 KB · Views: 219
Upvote 0
Top