• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Undertow (Wildfly8) doesn't handle request parameters as expected

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I do migration from Jboss AS7 /EAP6 to Wildfly8 and would like to ask here for any hint about undertow, why it doesn't handle request parameters as catalina does in EAP6.
So, I make a request from client to url './client/boom/index.htm?i=1', it comes to an error servlet where I want to get value of parameter i

With EAP6 it returns 1, but with Wildfly8 it return null. Why?

Additional info. I have a security domain called 'boom' declared in jboss-web.xml

and in standalone.xml


Auth method is declared as basic in web.xml.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


So, I make a request from client to url './client/boom/index.htm?i=1'


That appears to be a static htm file. Moreover that doesn't even look like the real URL. What exactly is the full URL and how is it mapped to the servlet in which you are invoking the getParameter API?
 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chain of calls is the following (assume basic auth):

1. Call with js to url './client/boom/index.htm?i=1'.
2. Flow doesn't come to subclass of UsernamePasswordLoginModule because authorization required.
3. Flow comes to the error-servlet with

httpServletRequest.getAttribute("javax.servlet.error.status_code") == 401
httpServletRequest.getAttribute("javax.servlet.error.message") == Unauthorized

Here, in the error-servlet I need to get parameter i. Error-servlet is mapped in this way:

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it looks like the request parameter isn't available in the servlet to which the control is passed after an error occurs. Although I haven't looked into the details/code, I suspect this might be related to this similar issue http://lists.jboss.org/pipermail/undertow-dev/2014-October/000975.html which got fixed in Undertow just a few days back. Someone from the Undertow development team will have to confirm that. Since you already have a thread in the JBoss developer community forums here https://developer.jboss.org/thread/249382, someone from the team will probably respond soon.
 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaikiran Pai, thanks for hint. According to https://issues.jboss.org/browse/UNDERTOW-322 I replaced modules websockets-jsr, servlet and core of Undertow by the newest version 1.2.0-Beta1. It did not fix the issue.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was just a guess, based on some details in that JIRA. So perhaps you are running into something else. I don't have the code right now, so can't help much further. Someone from the Undertow team might be able to help.
 
Qu Vad
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update. The list of attributes in error servlet is different in EAP6 and WF8

Attributes in WF8:

javax.servlet.error.message: Unauthorized
javax.servlet.error.status_code: 401
javax.servlet.error.servlet_name: default
javax.servlet.error.request_uri: /boom-portal/client/boom/index.htm

Attributes in EAP6:

javax.servlet.forward.request_uri: /boom-portal/client/boom/index.htm
javax.servlet.forward.context_path: /boom-portal
javax.servlet.forward.servlet_path: /client/boom/index.htm
javax.servlet.forward.path_info: /Error.error
javax.servlet.forward.query_string: i=1
javax.servlet.error.message:
javax.servlet.error.status_code: 401
javax.servlet.error.servlet_name: default
javax.servlet.error.request_uri: /boom-portal/client/boom/index.htm


Any idea why 'forward'-attributes are missing in WF8?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to login to the IRC channel #wildfly as noted here http://wildfly.org/gethelp/ and point them to the discussion here. Usually you find some developers on that channel who are willing to help.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a FYI - Someone else ran into this problem today and raised it in the undertow-dev mailing list and it appears that this has been acknowledged as an open bug:

http://lists.jboss.org/pipermail/undertow-dev/2015-July/001298.html
https://issues.jboss.org/browse/UNDERTOW-505
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic