Reply To: Issue with @ConversationScoped bean

Splash Forums Rewrite Users Issue with @ConversationScoped bean Reply To: Issue with @ConversationScoped bean

#25180

jmirc
Participant

I worked with JF and I found the problem with Weblogic 12.1.2. Actually weblogic uses an internal version of JSF-api that you can found at this address https://svn.java.net/svn/mojarra~svn/tags/2.1.20/.

The problem occurs in the MultiViewHandler.java class under the getActionURL method after the comment //Deal with extension mapping.

1) the URL rewrite returns the right URL – http://localhost:7001/com.wizard/step1?cid=2
2) the code in the MultiViewHandler class looks for an extension that doesn’t exist. So it adds the extension at the end of the URL – http://localhost:7001/com.wizard/step1?cid=2.jsf.
3) JSF tries to check if the URL contains the parameter cid and it found it so it adds it (http://localhost:7001/com.wizard/step1?cid=2.jsf&cid=2)

Do you have an idea how I can fix this problem?


    /**
     * <p>
     * This code is currently common to all {@link ViewHandlingStrategy} instances.
     * </p>
     *
     * @see ViewHandler#getActionURL(javax.faces.context.FacesContext, String)
     */
    public String getActionURL(FacesContext context, String viewId) {

        Util.notNull("context", context);
        Util.notNull("viewId", viewId);

        if (0 == viewId.length() || viewId.charAt(0) != '/') {
            String message =
                  MessageUtils.getExceptionMessageString(
                        MessageUtils.ILLEGAL_VIEW_ID_ID,
                        viewId);
            if (logger.isLoggable(Level.SEVERE)) {
                logger.log(Level.SEVERE, "jsf.illegal_view_id_error", viewId);
            }
        throw new IllegalArgumentException(message);
        }

        // Acquire the context path, which we will prefix on all results
        ExternalContext extContext = context.getExternalContext();
        String contextPath = extContext.getRequestContextPath();

        // Acquire the mapping used to execute this request (if any)
        String mapping = Util.getFacesMapping(context);

        // If no mapping can be identified, just return a server-relative path
        if (mapping == null) {
            return (contextPath + viewId);
        }

        // Deal with prefix mapping
        if (Util.isPrefixMapped(mapping)) {
            if (mapping.equals("/*")) {
                return (contextPath + viewId);
            } else {
                return (contextPath + mapping + viewId);
            }
        }

        // Deal with extension mapping
        int period = viewId.lastIndexOf('.');
        if (period < 0) {
            return (contextPath + viewId + mapping);
        } else if (!viewId.endsWith(mapping)) {

            for (String ext : configuredExtensions) {
                if (viewId.endsWith(ext)) {
                    return (contextPath + viewId.substring(0, viewId.indexOf(ext)) + mapping);
                }
            }

            return (contextPath + viewId.substring(0, period) + mapping);
         
        } else {
            return (contextPath + viewId);
        }

    }