0

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 call 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:

httpServletRequest.getParameter("i");

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

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.

Additional info.

Error-servlet is mapped in this way:

<servlet-mapping>
    <servlet-name>error</servlet-name>
    <url-pattern>*.error</url-pattern>
</servlet-mapping>
...
<error-page>
    <error-code>401</error-code>
    <location>/Error.error</location>
</error-page>

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

<jboss-web>
    <security-domain>boom</security-domain>
    <disable-audit>true</disable-audit>
</jboss-web>

and in standalone.xml

<subsystem xmlns="urn:jboss:domain:security:1.2">
    <security-domains>
        ...
        <security-domain name="boom" cache-type="default">
            <authentication>
                <login-module code="com.boom.security.BoomLoginModule" flag="required"/>
            </authentication>
        </security-domain>
    </security-domains>
</subsystem>

Auth method is declared as basic in web.xml.


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 
Qu Vad
  • 11
  • 4

1 Answers1

0

Maybe this problem is related to Forwarded multipart requests may lose submitted form parameters

Try changing the settings of the servlet by adding this annotation @MultipartConfig

or in the web.xml descriptor in this way

<servlet>
    <servlet-name>Servlet</servlet-name>
    <servlet-class>.....</servlet-class>
    <load-on-startup>0</load-on-startup>        
    <multipart-config/>
 </servlet>

UPDATE

The problem is the authentication, you are receiving a status code 401:

401 Status Code Explained

The request requires user authentication. The response MUST include a WWW-Authenticate header field containing a challenge applicable to the requested resource.

Check how you are making the autentication.

Federico Sierra
  • 5,118
  • 2
  • 23
  • 36