Dashboard > blojsom > ... > Developers Guide > Configuring the JSP dispatcher
  blojsom Log In   View a printable version of the current page.  
  Configuring the JSP dispatcher
Added by David Czarnecki, last edited by David Czarnecki on Jun 08, 2005  (view change)
Labels: 
(None)

JSP stands for JavaServer pages.

Allowing users to use JSP templates represents a potential security risk for your application and your server as you have no control to prohibit users from embedding arbitrary Java code (that may or may not be intentionally malicious) in their pages.

Installing the JSP dispatcher

  • Add the following line to your /WEB-INF/dispatcher.properties file.
    jsp=org.blojsom.dispatcher.JSPDispatcher
    
  • In the above configuration, JSP templates will be associated with the .jsp file extension.
  • You may then add templates to an individual blog's /WEB-INF/(blog-id)/templates directory that use JSP.
  • You must restart your server if you are adding the JSP dispatcher while blojsom is running.

Configuring the JSP dispatcher

There are no configuration options available for the JSP dispatcher.

Configuring a flavor template to use the JSP dispatcher

You can configure individual flavors to use the JSP dispatcher by changing the properties in your /WEB-INF/(blog-id)/flavor.properties file. For example:

html=html.vm, text/html;charset=UTF-8

This line in the flavor.properties file configures the html flavor to use the html.vm template, where in the standard blojsom installation, templates with a .vm extension are associated with the Velocity dispatcher.

To configure the html flavor to use the JSP dispatcher, change the line above to the following:

html=html.jsp, text/html;charset=UTF-8

You will then need to create the appropriate /WEB-INF/(blog-id)/templates/html.jsp file using the JSP template syntax.

Writing templates using JSP

Take a look at the JSP templates that are available in blojsom's version control system. You can click on the revision number for any of the JSP files to view the file. You will then also have a chance to download any of the JSP templates by clicking on the download link on the revision's page.

You may refer to the JSP v1.2 syntax guide for all the details on the syntax of writing templates using JSP.

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators