Unable to set JSP as welcome file in GAE guest book example

I follow the example here:

https://developers.google.com/appengine/docs/java/gettingstarted/usingjsps

so I created a really basic jsp file:

<html> <body> testing </body> </html> 

and I'm trying to make this welcome page, as the tutorial says:

  <welcome-file-list> <welcome-file>guestbook.jsp</welcome-file> </welcome-file-list> 

but he is not called. when I go to http://localhost:8888 , as if it was missing a file (I renamed index.html. when there is index.html - it displays it).

when i'm http://localhost:8888/guestbook.jsp , i see the jsp file without problems

UPDATE: this only happens on my development server. when I deploy to Google App Engine, it works as expected:

http://test-ishener.appspot.com/

+6
source share
1 answer

You probably do not store the JSP in the root folder, please show the structure of your project.

Also, if you have multiple matches in the welcome lists, say:

 <welcome-file>index.html</welcome-file> <welcome-file>guestbook.jsp</welcome-file> 

then the first match will be executed, i.e. index.html, if so, either move guestbook.jsp for the first one or delete index.html welcome tag file

+2
source

Source: https://habr.com/ru/post/921935/


All Articles