Category Archives: web

Using an embedded SQL database in Java web application

You have a Java web application needing a relational SQL database. According to JavaEE conventions, you declare the DataSource in web.xml: <resource-ref> <res-ref-name>jdbc/DS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> and then fetch it in code with (DataSource)new InitialContext().lookup(“java:comp/env/jdbc/DS”). Using Maven, Jetty and HSQLDB, … Continue reading

Posted in Java, JavaEE, web | 3 Comments

How to design a RESTful protocol

What is REST? In most cases, it is sufficient say that REST is a way to design a network protocol based on HTTP. I perfer to call it a RESTful protocol, but it can also be called RESTful API or … Continue reading

Posted in web | Leave a comment

PHP session timeout

The developers of PHP has, in their infinite wisdom, decided that the default session timeout should be 24 minutes (1440 seconds). This means that if you have a MediaWiki wiki and are editing a single page for half an hour … Continue reading

Posted in PHP, web | Leave a comment

Web application frameworks in Java

When you know which type of web application you are to develop, it’s time to have a look at some possible choices. I have tried to categorize some modern and popular web application frameworks in Java. Simple server driven MVC … Continue reading

Posted in AJAX, Java, JavaEE, web | 1 Comment

Web applications and web frameworks

If you are to develop a web application, there are a lot if frameworks to choose between. I assume that the web application by its nature needs to have bi-directional communication between the web browser and the server during the … Continue reading

Posted in AJAX, web | 2 Comments

Using Vaadin with Maven

Vaadin is a comprehensive framework for developing web applications in Java. The Vaadin web site presents a number of ways to use Vaadin with Maven, but I am not completely satisfied with any of those. Here is how I do … Continue reading

Posted in Java, web | 2 Comments

How to implement RESTful JSON Web Services in Java

You can implement RESTful Web Services in Java using the JAX-RS framework. JAX-RS is part of the JavaEE 6 platform. But if you are not using a JavaEE 6 application server, you can use the reference implementation Jersey and embed … Continue reading

Posted in AJAX, Java, JavaEE, web | 1 Comment

Misuse of HTTP GET is a cardinal sin

According to the RESTful style, you should make use of the four HTTP methods GET, POST, PUT and DELETE. However, in many cases only GET and POST is used, and POST is used when you really should use PUT or … Continue reading

Posted in web | 4 Comments

Type safe JSP and JSTL

When using JavaServer Pages, you want to use JSTL to be able to to flow-control (iterations and conditionals) in a reasonable way. And the recommended way to use JSTL is to use the Expression Language (EL). However, using EL is … Continue reading

Posted in Java, JavaEE, web | 1 Comment

Poor Javascript performance is an obstacle in AJAX development

I’m currently developing my first AJAX based web application. The goal is to have a pure AJAX application, i.e. never reload the entire page, use only background XMLHTTPRequest to contact the server. My observations so far is that it is … Continue reading

Posted in AJAX, web | Leave a comment