views:

39

answers:

2

Hi,

I am building an application on GAE and let's say I just want a plain about page for the application. The about.jsp file should or should not have an servlet class?

in in web.xml I have something like

<servlet>
    <servlet-name>application</servlet-name>
    <servlet-class>application.applicationServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>application</servlet-name>
    <url-pattern>/about</url-pattern>
</servlet-mapping> 

how do I include the about.jsp file? is this done automatically?

A: 

If it's a static file, you should just have a static HTML page to show the content. A static page will be much quicker to serve than even a static JSP, since the server won't have to inspect the file to see if there's anything to fill in, it will just serve the page immediately.

See the docs on serving static files.

Jason Hall
but for a static jsp file do I have to specify something in the web.xml?
Nopcea Flavius
I believe you do have to specify a servlet for the JSP in web.xml (though I could be wrong). JSPs are designed for serving dynamic content based on a request to a servlet, not for serving static content.
Jason Hall
A: 

From what i can understand from your question is that wheather or not you need to make an entry for the jsp file in the configuration file. Now if you are going for the default behaviour that is the about.jsp should be displayed when the user hits the url /about.jsp,you need not make an entry for the same. and this is not specific to App engine,this is the default behavior for any container

Bunny Rabbit
yes, this is what I thought...BUT... if I name the file about.html everything works...BUT if I name it about.jsp (with no configuration in the web.xml and no servlet class) then I get a 404 error:Problem accessing /about.jsp. Reason: /about.jspDo you know the cause?
Nopcea Flavius