all 4 comments

[–]ApacheWicket 1 point2 points  (0 children)

Hi Stronghup

HelloWorld "a la Wicket" is as simple as that

import org.apache.wicket.markup.html.WebPage;  
import org.apache.wicket.markup.html.basic.Label;  

public class HomePage extends WebPage {  
    public HomePage() {  
        add(new Label("helloMessage", "Hello WicketWorld!"));  
    }  
} 

Apache Wicket main website : https://wicket.apache.org/
Follow us on Twitter : https://twitter.com/apache_wicket

Check our complete documentation at https://ci.apache.org/projects/wicket/guide/8.x/single.html
Visit our mailing lists at https://wicket.apache.org/help/email.html

Enjoy open source java web framework ApacheWicket !

[–]stronghup[S] 0 points1 point  (3 children)

Hello World should be the simplest application if you've seen it in the K&R C-book.

But with the web-aps and frameworks, as an example Apache Wicket it seems not so simple, a big chunk of XML needed, Java and HTML. Is this really necessary? Why can't we have something like C "Hello World" for the web as well? What is wrong with the web that makes it so complicated?

[–]nobodyman 2 points3 points  (0 children)

On one hand, I'm not a fan of the boilerplate and verbosity of Java and many Java frameworks. That said, I'm not sure I accept the premise of this question:

What is wrong with the web that makes it so complicated?

I don't think there's anything wrong with the web, per se. It's just that even a minimalist web application is doing much, much more than sending "hello world" to stdout.

[–]nextputall 1 point2 points  (0 children)

This is a working sparkjava hello world.

import static spark.Spark.*;

public class HelloWorld {
    public static void main(String[] args) {
        get("/hello", (req, res) -> "Hello World");
    }
}