Re: javax.websocket.Session.getRequestParameterMap() encoding
On 22/11/2018 21:29, Johan Compagner wrote: > Op do 22 nov. 2018 22:05 schreef Mark Thomas >> On 22/11/2018 16:06, Johan Compagner wrote >>> >>> problem is how do we do that in a websocket scenario? >> >> Several options: >> - configure the connector >> - use a filter before the request reached the WebSocket filter >> > > > We can't do a Tomcat only version. We don't control deployment, we only can > generate the war file and configure in the web.xml in the war or in code. > > But can you add a filler to the same websocket url (let's say /websocket) > And then quickly set the encoding on that request before it upgrades it to > a websocket? That will work on Tomcat because: a) Tomcat uses a Filter to redirect requests to WebSocket; and b) Tomcat puts this filter at the end of the chain to ensure that any filters that - for example - enforce security run first. For other containers it will depend on how they do the mapping. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: javax.websocket.Session.getRequestParameterMap() encoding
Op do 22 nov. 2018 22:05 schreef Mark Thomas On 22/11/2018 16:06, Johan Compagner wrote > > > > problem is how do we do that in a websocket scenario? > > Several options: > - configure the connector > - use a filter before the request reached the WebSocket filter > We can't do a Tomcat only version. We don't control deployment, we only can generate the war file and configure in the web.xml in the war or in code. But can you add a filler to the same websocket url (let's say /websocket) And then quickly set the encoding on that request before it upgrades it to a websocket? > Mark > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: javax.websocket.Session.getRequestParameterMap() encoding
On 22/11/2018 16:06, Johan Compagner wrote: Hi, If we send have a value that is utf8 url encoded to the websocket: H%C3%BCnenberg then somehow tomcat just encodes that using i think "ISO-8859-1" Tomcat version? See URIEncoding for the Connector. if we are in a filter or servlet we just do: request.setCharacterEncoding("UTF8"); and then ask for the parameter map then everything is fine it will be decoded correctly to Hünenberg problem is how do we do that in a websocket scenario? Several options: - configure the connector - use a filter before the request reached the WebSocket filter Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
javax.websocket.Session.getRequestParameterMap() encoding
Hi, If we send have a value that is utf8 url encoded to the websocket: H%C3%BCnenberg then somehow tomcat just encodes that using i think "ISO-8859-1" if we are in a filter or servlet we just do: request.setCharacterEncoding("UTF8"); and then ask for the parameter map then everything is fine it will be decoded correctly to Hünenberg problem is how do we do that in a websocket scenario? the session object of a WebSocket doesn't have anything for that as far as i can see the same goes for ServerEndpointConfig.Configurator using the modifyHandshake method.. -- Johan Compagner Servoy