javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-3153

Converter does not run on GET parameter after redirect from login page

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.5
    • Fix Version/s: 2.2.6
    • Component/s: conversion
    • Labels:
      None

      Description

      I have secured web application. Scenario:
      1. http://localhost:8080/crawler-web/app/crawler/configure.xhtml?crawlerId=top-reality
      2. Login screen appears
      3. send username/password
      4. after successful login I see requiredMessage from configure.xhtml which is "Unknown crawler, please use a link from within the system."
      5. After refresh (F5) crawlerConverter runs and converts crawlerId parameter

      I think crawlerConverter should run also after redirect from login page.

      web.xml
          <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                  <form-login-page>/app/login.xhtml</form-login-page>
                  <form-error-page>/app/login.xhtml</form-error-page>
              </form-login-config>
          </login-config>
          
          <security-constraint>
              <web-resource-collection>
                  <web-resource-name>Admin user</web-resource-name>
                  <url-pattern>/app/*</url-pattern>
                  <http-method>GET</http-method>
                  <http-method>POST</http-method>
              </web-resource-collection>
              <auth-constraint>
                  <role-name>ADMIN</role-name>
              </auth-constraint>
          </security-constraint>
      
      configure.xhtml
      <?xml version='1.0' encoding='UTF-8' ?> 
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
            xmlns:f="http://xmlns.jcp.org/jsf/core"
            xmlns:h="http://xmlns.jcp.org/jsf/html">
          <h:body>
              <ui:composition template="/template/layout.xhtml">
                  <ui:define name="metadata">
                      <f:metadata>
                          <f:viewParam name="crawlerId" value="#{crawlerConfigureBean.crawlerItem}" 
                                       converter="crawlerConverter"
                                       required="true" requiredMessage="Unknown crawler, please use a link from within the system.">
                          </f:viewParam>
                      </f:metadata>
                  </ui:define>
                  <ui:define name="content">
                      <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"/>
                      <h:messages styleClass="error-message"/>
                      Configuration:
                      <pre class="prettyprint">
                          <h:outputText value="#{crawlerConfigureBean.configuration}" />
                      </pre>
      
                      Crawler Configuration:
                      <pre class="prettyprint">
                          <h:outputText value="#{crawlerConfigureBean.crawlerConfiguration}" />
                      </pre>
                  </ui:define>
              </ui:composition>
          </h:body>
      </html>
      

        Activity

        Hide
        hlavki added a comment -

        I discovered that getAsString() method is executed after login with null value while getAsObject() doesn't.

        Show
        hlavki added a comment - I discovered that getAsString() method is executed after login with null value while getAsObject() doesn't.
        Hide
        Manfred Riem added a comment -

        Can you please supply us with your entire example? Please send it to issues@javaserverfaces.java.net. Thanks!

        Show
        Manfred Riem added a comment - Can you please supply us with your entire example? Please send it to issues@javaserverfaces.java.net. Thanks!
        Hide
        hlavki added a comment -

        sent entire example to issues@javaserverfaces.java.net on 23. january 2014

        Show
        hlavki added a comment - sent entire example to issues@javaserverfaces.java.net on 23. january 2014
        Hide
        Manfred Riem added a comment -

        Applied to 2.2 branch,

        svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-3153, r=edburns, make sure we ask the underlying request for its parameter names prior to trying to get the first request parameter so it will be fully populated."
        Sending jsf-ri/src/main/java/com/sun/faces/context/RequestParameterMap.java
        Transmitting file data .
        Committed revision 12801.

        Show
        Manfred Riem added a comment - Applied to 2.2 branch, svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-3153 , r=edburns, make sure we ask the underlying request for its parameter names prior to trying to get the first request parameter so it will be fully populated." Sending jsf-ri/src/main/java/com/sun/faces/context/RequestParameterMap.java Transmitting file data . Committed revision 12801.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            hlavki
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: