GithubHelp home page GithubHelp logo

mojarra-bug-demo's Introduction

Mojarra JSF Javascript Bug

This repository provides a very basic web application to demonstrate a bug in the Mojarra JSF Javascript implementation

Details of the Bug

JIRA Issue: https://java.net/jira/browse/JAVASERVERFACES-3471

When the JSF AJAX Javascript library discovers a form with an encoding type of multipart/form-data, it creates an iframe for all f:ajax requests.

When the iframe is created (lazily done on the first f:ajax trigger), the form's tag is updated with a target attribute to point to the iframe. This causes all form submits to be posted to the iframe, from which the results are pulled and the page is updated.

The bug lies in that the target continues to point to the iframe. This then causes all non-ajax form submissions to still go to the iframe, meaning successful form submissions are hidden, as well as all form validation errors are hidden, without the user knowing a thing (without looking at the server console).

Patching the Bug

The patch is quite simple... return the form's target back to its original value after the form has been submitted.

To Run the Demo

Simply checkout the code and run

mvn tomcat7:run-war

A Tomcat instance will download, startup, and then deploy your app. You can then access it at http://localhost:8080/demo. From there, you'll have the option to view the bugged or patched demos.

mojarra-bug-demo's People

Contributors

mikesir87 avatar ceharris avatar

Watchers

 avatar James Cloos avatar

Forkers

ceharris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.