Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Bear Bibeault

Author and ninkuma
+ 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 Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

If you do end up handling the passwords yourself (but give serious thought to Stephan's suggestion), they should never be decryptable. Rather, when the user enters a password, you encrypt that using the same scheme as the stored password and compare the encrypted versions. If the two passwords  are identical they will encrypt to the same value.

If you can decrypt a password, so can anyone else, so always use an non-decryptable scheme.
13 hours ago

Jeanne Boyarsky wrote:
Also, note that it is poor practice to put Java code in the HTML. Especially database code.

Mayukh Singha Roy wrote:I know, I wrote like this so that the people seeing it can understand it better..

It'd be best not to do that. Showing us the code in its real setting avoids side-tracks such as this.

Mayukh Singha Roy wrote: If help me with the solution i will be happier

Jeanne already gave you the solution:

Jeanne Boyarsky wrote:You want to include a value attribute in your options. That way, when the form gets submitted, you have something there.

2 days ago
Functions in JavaScript are a deep topic, but understanding functions is key to writing good and effective JavaScript.

At its most basic level, you declare a named function and then you can call it within its scope.

For example:
declares a function. It can be called anywhere within its scope as follows:

The rabbit hole goes much deeper but that should get you started.
The for loop is a determinant loop - it is best used when we know exactly how many loops we want make. For example: "loop from 1 to 10", or "loop from 0 to 100 skipping odd numbers", or even "loop over an array with indexes from 0 to the length of the array".

The while loops are indeterminant loops - they are best used when we don't know how many loops we want to make, rather, we want to loop until some condition is met. For example: "loop until the user enters the word 'quit'", or "loop until the result of calling some function is null", and so on.

And it gets even better when you consider JavaScript as a functional language and look at the various looping methods on the Array itself; forEach, map, reduce and more. Each has its own use and place.
What kind of JavaScript? Embedded in HTML or JSP pages? Or stand-alone as with NodeJS? Or a SPA using React, Angular, or VueJS?

Some tools are better than others for each of these types of JavaScript.

Pete Letkeman wrote:

Bear Bibeault wrote:I've rappelled out of hovering helicopters and various cliffs.

What? Sounds like there is much more to the story here and this could be fun as well.

Jeanne Boyarsky wrote:Bear: Voluntarily or because the military made you? 

Military training.
5 days ago

Arun Singh Raaj wrote:
Actually we have an annotation @PathVariable in Spring framework that captures the variable passed in the url:

Yes, I understood that.

By default, HTML forms will submit values as request parameters (either on the URL or in the body depending upon the type of request), but not as path variables. That's why you need to do this the hard way.

If you don't know any JavaScript yet, you've got a long uphill climb coming...

I have idea of JQuery, JSP, JS so you can provide information about any of the three scripting languages how they generate such a url.

JSP is not client-side. It is a server-side templating mechanism. Please read this article to find out exactly how JSP works.

JavaScript (at least on an HTML page) runs in the browser (client side).

jQuery is a JavaScript library that makes doing things like event handling and making Ajax requests a lot easier than with plain JavaScript.

You might want to do a search to see if anyone has create a library that already does this for you. It seems like something that would be a common need.
Are you using jQuery or any other framework? If not, you should be using jQuery as it's going to make all of this much much easier.

What is the name (not id) of the form control that contains the value?
As this doesn't really have anything to do with it being in a JSP, I have moved this topic to the more appropriate location.

First, we need to know how you plan to submit the request. As a full-page reload, or as an Ajax request?

In either case, you'll want to capture the submit event for the form so you can get the value of the control and create a URL from it.
HTML has no way to take form inputs and construct a URL using form values as path elements in the URL. You'll need to get JavaScript involved.
Thanks for reporting back with your findings.

Have a cow.
1 week ago

Mano Ag wrote:
Still along way to go: JavaScript , Jave SE, Java EE

The Java ecosystem is just one of many possible back-end environments.

But yes, JavaScript is a must; in the front-end for certain, on the back-end optionally.

My advice would be to just start writing web apps. Nothing will tell you better where you need to shore up existing skills or learn new ones.
A book that uses a framework almost inevitably becomes about the framework.
React apps are typically written using ES6+, though nothing prevents them being written in ES5 (if you like wordiness) or even TypeScript.

Angular apps are typically written in TypeScript, but similarly they could be in ES as well.

I choose the language that the framework's general community uses as that's what tutorials, blogs, npm packages, and online questions are most likely to be using.

Babel, while essential in the toolchain, doesn't really factor into the choice.