This blog really didn't turn out to be about math and programming did it????
Well, let's change that.
I'm going to talk now about richfaces 3.3.x. [0]
This is what you need if you are programming in richfaces 3: [0]
That's it. If that's down, you can't program in richfaces 3.
Other quirks I've learned while using it for the past 3 years:
- a4j has bad xml tree code. like, who hired that *** excuse for a *** *** * and ***?
- If you are going to open a new browser window, and expect both windows to be used, put the code for the new window in a different war.
- richfaces programming style is jquery 1.3, but the thought process is pre-1.3. In case you forgot, or were still in diapers, jquery 1.3 was when they invented feature detection [1]. Thus trying to support any browsers that did not exist in 2009, you are going to have a Bad Time.
- As far as I can tell JSF2 ppls decided to completely ignore the work jboss put in to adding ajax to JSF[2]. I know that's the choice I would have made.
- xml is parsed and traversed in tree every request (ajax included). Today in 2015 we know that xml is bad because its slow. In fact, XML surpasses other data exchange formats in almost every other category: schema expressiveness, built in query language, reference types. But it's slow. XPATH is slow. Parsing on server is slow. Parsing on client is slow. Reading is slow. Writing is slow. Diffing is slow.
- because xml is slow, and jsf wasn't made for ajax, things are fragile. too many events and it dies. too special characters and it dies. too specific re-render instructions and it dies. two forms and on ie and it dies.
- Special characters: if you send valid html escape codes, richfaces server will parse them fine. If you send them back, they will display fine. If you a4j rerender them it will die. silently. unless you change your code, add an a4j:log, you can see xml parsing errors on the client. all browsers xml parsers are different in which characters they accept.
- WYSIWYG editor with custom css'd templates. oh man don't go there. Every browser treats keys differently (Enter is <br> or <p> or <div> depending on which browser you are using) Every browser treats whitespace differently. 400 line javascript monkey patch sitting on top of our editor for that right there. The 10x-law-of-demeter-violating-hack[5] discovered and written by me in 4 hours thank you very much. Debugged corner cases over the course of 3 weeks and I still can't get enters to work when cursor is at top level and no text has been written. I think richfaces just eats 'enter's.
- Richfaces eats 'a's. You just can't do it. You are in a pick list and want to select all? you are in a pick list and you SIMPLY WANT TO SCROLL TO THE 'A's. Nope. Richfaces eats 'a's.
- if you have one view root, and you want to talk to another view root, you can't. you encode your message in the url and make another request, creating another instance. Or you create a session scope or above bean that will serve as message communicator. Or you can hack javascript into giving you references to other views which give references to other richfaces objects.
- If you open up the js debugger, you will see an exception ONLY SOMETIMES that A4J.log is not defined. it is defined. Richfaces defined it everywhere. Twice. You defined it everywhere. Twice. js debugger will pause where the exception is thrown and it will be defined. but the exception doesn't go away. It's just something you have to ignore.
- Lets say you have a custom page you wrote in a day. it's decently sized, couple hundred lines. For some reason, a4j requires up to 85MB allocations to process this. I don't care if you don't have backing beans, I don't care that you are not storing anything in session. a4j just allocates crap per session. Of course it's all garbage at the end of the request.
- What the above means is that each of your servers will have a hard and low limit of "in flight" requests it can process. This past week I've OOM'd[4] an old 32 bit jrockit weblogic 10.3 server instance with just 10 concurrent requests to a large richfaces 3 page.
- Richfaces 3 is ABANDONWARE [3] -- "old and unsupported"
- Any javascript error while in an oncomplete= is invisible and swallowed.
welp. I forgot the rest of the lessons learned, which is why I'm going to start posting every week.
[0] http://livedemo.exadel.com/richfaces-demo/
[1] http://blog.jquery.com/2009/01/14/jquery-1-3-released/
[2]https://developer.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration?_sscc=t
[3]https://developer.jboss.org/thread/241053
[4]OutOfMemoryException. see https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/memleaks002.html
[5] https://en.wikipedia.org/wiki/Law_of_Demeter