IBM WebSphere Application Server/8.0 when ServletContext#getServerInfo() called in 8.5.0.1

What would you expect when the following servlet runs on IBM WebSphere Application Server 8.5.0.1?

package pl.japila.javaee6;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/authenticate")
public class AuthenticateServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        out.printf("<h1>%s</h1>", request.getServletContext().getServerInfo());
    }

}

It turns out that IBM WebSphere Application Server 8.5.0.1 gives a bit surprising result – IBM WebSphere Application Server/8.0.

websphere85-serverinfo

If it’s to confuse users I am.

Be Sociable, Share!
This entry was posted in Java EE, WebSphere.

Leave a Reply

%d bloggers like this: