I am running the Java Pet Store example and this is the top part of my “index.jsp” file :
<%-- Copyright 2006 Sun Microsystems, Inc. All rights reserved. You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at: http://developer.sun.com/berkeley_license.html
$Id: index.jsp,v 1.20 2007-03-16 20:18:59 basler Exp $ --%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*, com.sun.javaee.blueprints.petstore.model.CatalogFacade, com.sun.javaee.blueprints.petstore.model.Tag"%>
<%
try {
CatalogFacade cf = (CatalogFacade)config.getServletContext().getAttribute("CatalogFacade");
List<Tag> tags=cf.getTagsInChunk(0, 12);
// since top 20 come from database or desending refCount order, need to reorder by tag name
Collections.sort(tags, new Comparator() {
public int compare(Object one, Object two) {
int cc=((Tag)two).getTag().compareTo(((Tag)one).getTag());
return (cc < 0 ? 1 : cc > 0 ? -1 : 0);
}
});
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>Java Pet Store Reference Application</title>
<link type="text/css" rel="stylesheet" href="./tag.css"/>
</head>
<body>
….
This is not a direct answer to your question, but I’ll attempt to show what goes on to render a JSP. Following that path, and analysis of domains/domain1/server.log (if your installation is using the default domain called domain1) might give you a hint on what’s wrong.
Normally in a GF2 there’s a file called default-web.xml in the domain’s config directory.
It contains these snippets:
The above code configures JSP support – of course it will fail if it cannot locate the servlet code, but that should be logged in server.log.
After that, the following snippets ensure that the above servlet is called to manage jsp’s – one mapping for “classic” jsp’s and one for “xml syntax” jsps.
Now, if for whatever reason these segments are missing in default-web.xml, jsp support will be inactive, and you’ll get an effect like the one you describe because the file will be picked up by the default servlet, and will be handled as a static resource.