This week's book giveaway is in the Android forum.
We're giving away four copies of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java and have Shai Almog on-line!
See this thread for details.
Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android 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

Tim Holloway wrote:
If you do not wish to antagonize the Bear, use the JSP as a View Template and put the Model Data into JavaBeans created and managed by a Controller Servlet. If you put logic on the View Template (JSP), you will offend him.

Never poke the bear!

Seriously, head over to this article to read about how Java servlet/JSP apps should be organized.
1 day ago
By the way, welcome to the Ranch!
4 days ago
That's not the way the web works. You send a request, you get a response.

What is traditionally done for long running processes:
  • A request initiaties a long-running process in a separate thread, or even in another program such as daemon.
  • A means is created for subsequent requests to get information about the process. Could just be a class that's available in the session that contains info like percentage of completion, or messages. Or the info could be stored in a database.
  • The response returns indicating that the process is started.
  • Create a way for users to submit requests to see the progress, or do so automatically at intervals. The request looks at the info in the "progress" class or database to know what the long-running process is doing, and can report it back to the front-end in the response.

  • Or you might want to look into web sockets, or Comet, but those're a bit of a can of worms.
    4 days ago

    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.
    1 week ago
    Tough luck for employees on Atkins!
    1 week 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!)
    1 week 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.
    1 week 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.
    1 week 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.
    1 week 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).
    cell 1cell 2
    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.
    2 weeks ago

    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.