Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java 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
167
In last 30 days
0
Total given
184
Likes
Total received
4428
Received in last 30 days
6
Total given
2850
Given in last 30 days
12
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt Green check
expand Greenhorn Scavenger Hunt Green check

Recent posts by Bear Bibeault

Stephan van Hulst wrote:

Tim Moores wrote:I wonder if this might create an uncomfortable atmosphere for meat eaters. For example, might they rightfully worry that they are not as welcome at the company, or may no longer get promotions?


Did the same happen with smokers?


At one company I worked for it was a firing offense.
2 days ago
Tough luck for employees on Atkins!
2 days ago
If you don't want to be left struggling in the tar pit, modern web development embraces JavaScript or TypeScript (everything you hated about JavaScript and more!)
2 days ago
You don't do that by changing the URL. Showing the URL of the servlet is correct. Notice that in the servlet, the code forwards to the JSP. That is what causes the JSP's result to be shown. If that's not happening, changing the URL is not the way to fix it. Finding out what is wrong with the forward (if anything) is the way to fix it.

So what's happening? What is the real problem? You haven't told us.
3 days ago
For question #1, why? You never want to show the address of the JSP in the URL. The URL should be to the servlet that then forwards to the JSP. Why would you want to change that?

For question #2 (in the future please create separate posts for separate questions), I don't know what you are asking, Please start a new post for that question and explain what your problem is in greater detail. Thanks.
3 days ago
React apps are written as SPAs (single page applications) and are just static HTML/JavaScript pages. Serve them from any web app just as you would any other static pages.

That said, I always keep my SPA apps and backend APIs separate. Things are more versatile that way.
5 days ago

Puspender Tanwar wrote:Since this comes under the front end technology, wouldn't be this the correct forum.


Perhaps. The focus of this forum is web pages, HTML, JavaScript and CSS. Things that run in the browser, rather than as part of the browser. But as Chrome extensions are written using the same technologies, it's likely the closest thing we have.

I'd suggest starting here.
Why a chrome extension rather than a web app?

If you want to write an extension, this isn't the right place for the question, but we don't have a forum for writing browser extensions, so not sure where would be better.
Welcome to the Ranch.

I would also recommend to post the code here as many people will not go to other sites to view code. Be sure to use code tags (there's a CODE button in the reply form).
header1header2
cell 1cell 2
header1header2
cell 1cell 2
Welcome to the Ranch.

Your form action is a simple term with no path. That makes it a page-relative URL which is almost always guaranteed to not work in a Java web application. Your URL should be a server-relative URL that beings with the context path. Please see the JSP FAQ (see the top of the forum list for link) for details on how to properly construct URLs in Java web applications.

The indentation in your JSP is very poor. You should strive for consistent indentation that reveals the structure of the DOM rather than obscuring it.

P.S. Please be sure to post in the correct forums. I have moved this post to the JSP forum for you.
1 week ago
JSP

Al Hobbs wrote:

Bear Bibeault wrote:Populating form field values won't involve DOM manipulation.


Why is it not considered Dom manipulation? Wouldn't she have to at least add something to existing html?


No. Setting the value of an existing form field makes no changes to the DOM, just to the attributes of existing DOM elements.

Now, if instead, she needed to create the form elements from scratch, then that would require DOM manipulations, but that doesn't sound like what she needs.
Populating form field values won't involve DOM manipulation, but everything in the browser is easier with jQuery.
Also if it's your first client-side framework foray after JSP and servlets, it is whole 'nuther way of thinking
1 week ago
I'm guessing here, but but perhaps part of the problem is learning ES6+ in addition to React? React itself can be pretty simple to get started with; but learning its toolchain (Babel and Webpack et al) is a huge hurdle, and learning all the new notation in ES6+ can make it grueling.

Also, once you throw Redux into the picture, well, now it's getting complicated...
1 week ago
Skin your backend with a REST API and then use React on the front-end. Any other path will be a tar pit of misery and pain.

Edit: You could also go with the increasingly popular GraphQL backend, but that's likely more work.
2 weeks ago