Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

Bear Bibeault

Author and ninkuma
Marshal
+ 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
Cows
Total received
168
In last 30 days
0
Total given
184
Likes
Total received
4446
Received in last 30 days
6
Total given
2868
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

JSP pages are templates that will only let you generate the HTML pages that are sent to the browser. Any client-side interaction will still require JavaScript.

Working on the web and trying to avoid JavaScript are pretty much mutually exclusive. Perhaps you'd be better off considering a non-web implementation?
4 hours ago
To answer the question, no, there is no way for non-servlet classes to access the application content (aka servletContent). You might be tempted to pass the servletContent around -- DON'T DO IT. Just pass the data as necessary.

Most of the time such information (dropdown lists) are going to be used in a JSP, so no passing is necessary; JSPs have direct access to the application content. What is the use case where you need to pass this sort of information deeply within a call tree?
8 hours ago
By the way, that is not to say that moving the JavaScript to separate file(s) is a bad idea. In fact, it has many advantages both at development and run times. It just won't achieve any sort of hiding.

Your issue is likely that the file is not addressed correctly. Where is it in the file system relative to the HTML file?

Katie Sykes wrote:I was concerned that google would scan it, and the page is so messy, that O thought I could just save it to a file and link it,


Saving it to a file and linking it will make no difference to how Google indexes your pages and code. So if your intent is to "hide" the code from Google, it isn't happening.

Rather, I'd suggest using this opportunity make the code less messy rather than a doomed attempt to hide it. What you are describing should only take a handful of code. If there's a "lot of it", it likely could use improving.
The value of input elements is always a string. Using the type attribute doesn't change that, it just restricts what can be entered.
Why are you using (the rather old) underscore library rather than native JS to filter the array?

When you are using something different than everyone else, it makes the pool of people who can help you shrink.

I'd recommend using native methods of the JS array.
Quoted 4 times for emphasis!

Junilu Lacar wrote:Just make the code clean enough so that you can easily refactor it when whatever actual future arrives.



Junilu Lacar wrote:Just make the code clean enough so that you can easily refactor it when whatever actual future arrives.



Junilu Lacar wrote:Just make the code clean enough so that you can easily refactor it when whatever actual future arrives.



Junilu Lacar wrote:Just make the code clean enough so that you can easily refactor it when whatever actual future arrives.



2 days ago
Have you set breakpoints to check if the data is actually what you expect?

Cezar Apulchro wrote:i don't understand what you mean, what is breakpoints? How set this?



   

See the debugging section of https://coderanch.com/wiki/660075/Javascript-Links.

Trying to write JavaScript without using the debugger is like trying to cut diamonds while blind-folded.
Set breakpoints to find out where things are going awry.
Use the jQuery .val() method to set the value of an input element.
Do you have an element (and only one element) with the id value of prontu1 on the page?
My suggestion would be to adopt a grid system such as Bootstrap rather than trying to roll your own.
For a conceptual overview see this article. Anything beyond that is really up to the JSP container to deal with. Each JSP container will create different implementation code, so getting into the details of any single container isn't really useful general knowledge.
2 weeks ago