Hippo Hello World with JSP; File not found

276 views
Skip to first unread message

tora...@gmail.com

unread,
Jul 24, 2015, 6:28:04 PM7/24/15
to Hippo Community
I'm running through the Hippo CMS Hello World tutorial. The tutorial uses FreeMarker, but I'm unfamiliar with FreeMarker so I thought I would be able to just copy the example using jsp instead. After adding a "home.jsp" file to the webfiles under \bootstrap\webfiles\src\main\resources\site\jsp\home.jsp I've then created a template node, a page node, and added the page to the sitemap under root. When I try to view the site at localhost:8080/site/ I get a blank page followed by the following error in the command line: javax.servlet.ServletException: File [/jsp/home.jsp] not found.

I'm sure this is a stupidly simple issue but I'm new to Hippo and don't even know where to start.

Woonsan Ko

unread,
Jul 24, 2015, 6:35:32 PM7/24/15
to hippo-c...@googlegroups.com
Hi,

Probably the template is configured this way by default in that example:

/hst:hst/hst:configurations/myhippoproject/hst:templates
+ homepage [hst:template]
- hst:renderpath = "webfile:/freemarker/home/home.ftl"

Template path in webfiles (webfile: URIs) are actually template pages
stored in Hippo JCR Repository, not file system. Therefore, it (Hippo
webfiles) cannot support JSP pages. You can use only .ftl templates with
webfiles.

You can use jsp pages instead like the following:
- Create home.jsp and put in site/src/main/webapp/WEB-INF/jsp/home.jsp.
- And change the hst:renderpath property like this:

/hst:hst/hst:configurations/myhippoproject/hst:templates
+ homepage [hst:template]
- hst:renderpath = "jsp/home.jsp"

Then it will find the jsp template in the file system at
/WEB-INF/jsp/home.jsp instead.

HTH,

Woonsan
> --
> Hippo Community Group: The place for all discussions and announcements
> about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google
> Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hippo-communi...@googlegroups.com
> <mailto:hippo-communi...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.


--
w....@onehippo.com www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Jordan Tiona

unread,
Jul 24, 2015, 7:09:48 PM7/24/15
to Hippo Community, w....@onehippo.com
Thank you. So since webfiles can't automatically update jsp files I will have to rebuild and restart hippo every time I make a change to them? Is there a way to update a file without rebuilding everything? That process takes a good couple minutes on my system and I won't be able to develop efficiently if I have to do that every time I change a single character in a file.

Bert Leunis

unread,
Jul 25, 2015, 2:21:08 AM7/25/15
to hippo-c...@googlegroups.com
On Sat, Jul 25, 2015 at 1:09 AM, Jordan Tiona <tora...@gmail.com> wrote:
Thank you. So since webfiles can't automatically update jsp files I will have to rebuild and restart hippo every time I make a change to them? Is there a way to update a file without rebuilding everything? That process takes a good couple minutes on my system and I won't be able to develop efficiently if I have to do that every time I change a single character in a file.
That is why webfiles are so handy. But you can achieve the same with jsps, see [1] for how to set up your project in Eclipse in such a way that you don't have to rebuild and restart so often. Another way is to use a tool like JRebel that achieves the same. This is a licensed tool though.

 

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.

Jordan Tiona

unread,
Jul 25, 2015, 1:09:31 PM7/25/15
to Hippo Community, b.le...@onehippo.com
Thank you for the reply. I've gone back through the developing with eclipse tutorial and have a Tomcat server running, and everything works alright until eclipse tries to publish the changes. I get a list of errors indicating a bunch of files that it's trying to delete to rewrite and it "Could not delete":

Publishing failed with multiple errors
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\.lock. May be locked by another process.
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\version\db.h2.db. May be locked by another process.
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\workspaces\default\db.h2.db. May be locked by another process.
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\workspaces\default\index\_1\_32.cfs. May be locked by another process.
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\workspaces\default\index\_2\_3b.cfs. May be locked by another process.
Could not delete C:\Users\TorA\Downloads\apache-tomcat-8.0.24-windows-x64\apache-tomcat-8.0.24\wtpwebapps\hippo-hello-world-cms\WEB-INF\storage\workspaces\default\index\_3\_44.cfs. May be locked by another process.

If I may ask for help one last time that'd be great!

Tobias Jeger

unread,
Jul 27, 2015, 6:42:04 AM7/27/15
to hippo-c...@googlegroups.com
Hi,

I recon we should document this more explicitly in [1], but when using web files, only FreeMarker templates are supported. If you want to use JSP, you'll have to store the templates under the site.war's WEB-INF folder, and re-deploy if you want to change your templates.

cheers

Tobi


On Sat, Jul 25, 2015 at 12:35 AM, Jordan Tiona <tora...@gmail.com> wrote:
I apologize if this ends up getting posted twice. I'm working my way through the Hippo CMS Hello World tutorial. The tutorial uses FreeMarker but I'm unfamiliar with that so I'm trying to copy it using JSP instead. 

I've added a home.jsp file to the webfiles under \bootstrap\webfiles\src\main\resources\site\jsp\home.jsp. I then created a template node pointing to webfile:/jsp/home.jsp, created a page node pointing to the template, and then created a node called root to the sitemap pointing to the page.

After saving the changes I then try to view the site, but receive a blank page and the following error in the command line: javax.servlet.ServletException: File [/jsp/home.jsp] not found

I'm sure there is a stupidly simple solution, but being new to Hippo I don't even know where to begin looking. Thanks for any help!

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at http://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142


US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Jeroen Reijn

unread,
Jul 27, 2015, 9:33:24 AM7/27/15
to hippo-c...@googlegroups.com
On Mon, Jul 27, 2015 at 12:42 PM, Tobias Jeger <t.j...@onehippo.com> wrote:
Hi,

I recon we should document this more explicitly in [1], but when using web files, only FreeMarker templates are supported. If you want to use JSP, you'll have to store the templates under the site.war's WEB-INF folder, and re-deploy if you want to change your templates.

Or use JRebel or Springloaded to reload the templates withoud doing a deployment.



--
Jeroen Reijn
Hippo

Amsterdam office - Oosteinde 11, 1017 WT Amsterdam
Boston office - 745 Atlantic Ave, Eight Floor, Boston MA 02111, United states of America.

Niels van Kampenhout

unread,
Jul 27, 2015, 2:46:35 PM7/27/15
to hippo-c...@googlegroups.com
On Mon, Jul 27, 2015 at 6:33 AM, Jeroen Reijn <j.r...@onehippo.com> wrote:
>
>
> On Mon, Jul 27, 2015 at 12:42 PM, Tobias Jeger <t.j...@onehippo.com> wrote:
>>
>> Hi,
>>
>> I recon we should document this more explicitly in [1], but when using web
>> files, only FreeMarker templates are supported. If you want to use JSP,
>> you'll have to store the templates under the site.war's WEB-INF folder, and
>> re-deploy if you want to change your templates.
>
>
> Or use JRebel or Springloaded to reload the templates withoud doing a
> deployment.

Or use Eclipse with Tomcat as described on:

http://www.onehippo.org/library/development/import-a-project-into-eclipse.html

Niels
Boston - 745 Atlantic Ave, 8th Floor, MA 02111
Reply all
Reply to author
Forward
0 new messages