-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Justin Deoliveira wrote:
Hi Magne,
Hi
Yes, I am more certain now that it is a good and safe solution.
As long as we stick with the specification we should be on the safe side.
I have already create the code for this of course, but it is at work.
I will however upload it first thing Monday morning.
I am now able to do post and get forms from a html page, and also from
java code in my servlet. The TestWfsPost wrapper still works from the
request demo pages so I am pretty confident that I haven't broke
anything. I will do some more testing on Monday, but a unit test for
this would be great. Unit testing is a good way of doing software
development.
I have also create a JIRA task for the GetMapKvpReader which has a bug
in it that made non-ascii stream fail.
http://jira.codehaus.org/browse/GEOS-440
I uploaded a fix for that there.
I need to be able to use utf-8 in the sld, due to some Norwegian
letters. I probably need to add Russian labels later on, but I am not
sure about that yet. This is why I keep going on about utf-8 and
encoding. I hope I don't bore you guys.
But this is the last issue with encoding that I have found. And my
system now works perfectly.
I use this in a bit different approach that gis directly, where the
values, if any, is in the map itself.
This is a spatial system that gets data from a OLAP system and display
spatial data using colours on the map. We use the SLD to colour polygons
and set labels. It is because of the labels I need proper utf-8 support.
We are moving from a geotools1 applet implementation, to use a proper
wms implementation. We are pretty excited about the geoserver. It is a
great piece of software.
Magne
Thanks for doing the research on this. It looks like you are correct,
there is enough information available in the request header to handle
the request properly. I am attaching this conversation to the jira issue.
Any chance you would be interested in the patch. If you are worried
about breaking things we can set you up with a cite test suite. Cite
tests are run when releasing geoserver. They serve as great safety net.
If not, this issue will be addressed for the 1.3.0 version. Thanks.
Justin
Magne Skjeret wrote:
Justin Deoliveira wrote:
Hi
Isnt it in fact the content type that says what happens, if there is a
stream or not?
The browsers send this mime-type: application/x-www-form-urlencoded for
both POST and GET form submits, unless explicit altered in your html.
This means that the content is available through request.getParameter().
There is no body to stream in.
http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type
There are however also a multipart/form-data system, which is what in
fact is the only supported method in the geoserver now.
You can have url parameters and at the same time stream more data in.
That is the multipart part of this whole deal.
E.g. uploading a file in your html form, or stream bytes directly in
from your code, at the same time as the url contains e.g
http://localhost/geoserver/wms?layers=topp:states.
- From what I have been reading, it should be safe to assume that if the
content type is application/x-www-form-urlencoded, then it does not
matter wether it is post or get. request.getParameter("layers") will
work for both.
If it is not this content type, there are multiple parts to handle.
1 part could be the parameters on the url like on the urlencoded part,
and at the same time there could be a file upload or byte transfer of
some kind.
I wonder if it would be good just to use jakartas commons-fileupload, a
package created for a servlet to easily use a posted multipart/form-data
transmission from any client.
http://jakarta.apache.org/commons/fileupload/
<snip>
FileUpload parses HTTP requests which conform to RFC 1867 ,
"Form-based File Upload in HTML". That is, if an HTTP request is
submitted using the POST method, and with a content type of
"multipart/form-data", then FileUpload can parse that request, and make
the results available in a manner easily used by the caller.
</snip>
What the getReader() accesses is not unlike a fileupload. Maybe even the
exact same.
Magne
Good point, I am going to look into what the spec says.
Jody Garnett wrote:
Magne Skjeret wrote:
Justin Deoliveira wrote:
Hi Magne,
This is a known issue. And after looking into it I cant really
think of
a reason why post has to be directly streamed in. However one of the
other developers may have a reason.
Hi Justin
This is one of my fears, that I break some existing code, or even
worse
break some of the projects that use geoserver.
I just made the assumption that if SLD_BODY is on the url, then there
will be no sld streamed directly in.
I wonder if it would possible to check the stream if there is content,
before moving to doGet() instead if there is content in
request.getParameter(). I need to investigate that further.
Is there a example section? I can provide some example code how to use
POST directly from your java code, making it possible to use POST as
GET.
Can we just check the specification? One of the benefits of having one
is that we do not have to worry about things like this
Jody
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
- -------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDa8rNDjwfc5lfNZcRAr2jAKCaCbe7Hp07d/RUnfR41JD8C/tqTACgsGI6
2C/z5+EZonkj1dcOUJStdJY=
=ZX7I
-----END PGP SIGNATURE-----