Bear Bibeault

+ Follow
since Jan 10, 2002
Bear likes ...
IntelliJ IDE Java jQuery Mac Mac OS X
Author of:
Secrets of the JavaScript Ninja, 1st and 2nd editions,
jQuery in Action, 1st, 2nd and 3rd editions,
Ajax in Practice, and
Prototype and Scriptaculous in Action
Austin, TX
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

marten koomen wrote:React has quite a different paradigm to JQuery.

This is completely true. React and similar component-focused frameworks break applications down into well-defined and reusable components. Libraries like jQuery collect individual elements into sets that can then be operated upon. The approaches are very different.

React seems very application oriented

I'm not sure what that means. Most web development today is focused on web applications, be they simple or complex. I guess it depends upon what one defines as an "application".

The aim of React, and other modern component-focused frameworks, is to break down web applications into increasingly finer detailed components. This helps keeps the various parts of the application modular and focused, as well as testable. This becomes more and more important as the size of an application grows.

there seems no starting assumption with React that you have a well formed HTML Dom that you would like to do stuff with

It is a very different paradigm from jQuery in which you have an existing DOM (not Dom) that jQuery will operate upon. Rather, the React application code that defines the components (usually via JSX) in turn defines the DOM in terms of well-defined modular components -- from high-level containers, down to the individual HTML elements.

React doesn't sidle but barges into a web application.

I have no idea what that's supposed to mean.

JQuery assumes a DOM and is more focused on AJAX type interactions, so its a better fit for a website

This conclusion is specious and uninformed at best. React is no less "Ajax focused" than jQuery. The use, or non-use, of Ajax is completely orthogonal to the decision to use one approach over the other.

React seems better suited for creating those banal Facebook applications  (photo albums etc), where algorithms try to give you a sense that you have friends and that people remember your birthday, anniversaries etc, where in reality no one cares.

This is complete subjective nonsense. React can be used for any type of application, from the banal to the highly mission-critical. Frameworks do not dictate what type of application is being created. You can create a website that just shows pictures of cute kittens with jQuery or any other library/framework if you like. React, Angular, Vue, and all the other frameworks and libraries that came before (even jQuery) can be used for any type of web application.

I believe that you may be letting your disdain of Facebook influence your judgement.

so that I will be sticking with these.  

No one should try to convince you otherwise. Use what you like. Like what you use.

I get the sense that React is trying to undo this separation to make things that are entertaining.

Again, a subjective judgment without basis in fact.

Just thought I'd share these thoughts. It's always good to express them.

This is your prerogative.
2 days ago

Ron McLeod wrote:Also, since the values of the user and pass are only set when the script is initially loaded, and not when the validate function is called, the values will always empty, regardless of what has been entered in to the form elements.

Exactly. Something else easily uncovered in the debugger.
Also, learn how to use breakpoints. Stopping the execution and looking at the value of variables is far superior to just guessing by inspection.

Otherwise, you're fighting blind.

Always have the JavaScript debugger console open when developing JavaScript. You would have seen the syntax error.
Please read this article to understand exactly how JSP operates. It will help you understand what happens where, and when.
1 week ago
My 2¢: if you are trying to create a portfolio site showing your coding skills, using Vaadin will only impress those who also use Vaadin.

3¢ opinion: Tools like Vaadin are pretty much considered fossils at this point in web app development.
Again, so?

Yes, any page that hasn't been refreshed in a while might show old data. That's the nature of the web. If it's problem to expect users to refresh when they want to make sure they are looking at the latest data, the on-page script can periodically call back to the server for new data.

All the prevention you are trying to do on the server is just really.... odd.
2 weeks ago
I still don't understand the whole "stale pages" thing. As long as the user is properly authenticated why does it matter?
2 weeks ago

marten koomen wrote:How can I associated a bunch of state information unique to each user with its HttpSession object?

You don't. You store info in the session itself.

And (1) sounds like a really bad idea. How do you define a "stale" page?
2 weeks ago

marten koomen wrote:In my first prototype I (as programmer) had complete control of how the DOM was changed using JQuery, I don't want to cede that control to a framework. But it seems React will allow me to maintain control.

You are not ceding anything. Your code (usually via JSX) tells React what you want the DOM to be, and React figures out the best way to get there, avoiding unnecessary DOM changes. You still get the DOM you want -- how to best get it there is handled for you.
2 weeks ago

marten koomen wrote:I feel that JQuery is close to the DOM. When I read about React and Vue I get a sense these are more high level and removed, and work in a quite different paradigm.

While the paradigm is quite different, I don't see React being any less "close to the DOM". In fact, since the whole purpose of React is to manipulate the DOM via components, I might consider it even closer.
2 weeks ago
I'll expand a bit on jQuery -- while it is still used, it is pretty much considered passé for new front-end development. If you want to stay current, most new front-ends these days are SPAs (single-page applications) using React or Vue.
3 weeks ago

Gayathri Gayu wrote:What do you mean by the id values are unique?

You have multiple elements withe the same id value ("user" for example). That's not valid HTML.

My advice would be to use class names instead of id values to identify the fields; but if you are going to use id values, they must be unique within the entire HTML page.
You should have one form inside your sign-in-htm div, and another inside the sign-up-htm. Each should have their own validation function, and each should be processed by a different servlet controller.

You can share code with smaller functions, but for now concentrate on getting the structure correct. Optimizations can come later.
You don't seem to be heeding the advice to split your form into two separate forms. Or to be sure that your id values are unique.