velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: two VelocityViewServlets loading the same properties file
Date Thu, 18 Dec 2008 04:57:26 GMT
Yeah, you'll need to turn off shared configuration.

<servlet>
  <servlet-name>velocityCss</servlet-name>
  <servlet-class>org.apache.velocity.tools.view.VelocityViewServlet</servlet-class>
  <init-param>
      <param-name>org.apache.velocity.tools.shared.config</param-name>
      <param-value>false</param-value>
  </init-param>
  <init-param>
      <param-name>org.apache.velocity.properties</param-name>
      <param-value>/WEB-INF/velocity_css.properties</param-value>
  </init-param>
  <init-param>
      <param-name>org.apache.velocity.toolbox</param-name>
      <param-value>/WEB-INF/tools.xml</param-value>
  </init-param>
  <load-on-startup>20</load-on-startup>
</servlet>

On Wed, Dec 17, 2008 at 6:57 PM, Charles Harvey III <charlieh@alloy.com> wrote:
> Hello.
> Seems I have a problem.  I have two VelocityViewServlets configured in my
> web.xml.
> One for *.vm files and one for *.css files.  The one for css files is so I
> can
> do $link.setRelative() on my images in stylesheets.
>
> But, each of these is different.  For .vm files I use the
> VelocityLayoutServlet.
> For .css I use VelocityViewServlet.  For .vm the contentType is text/html.
>  For
> .css it is text/css.
>
> Thing is, the second servlet isn't reading its own properties file like it
> should.
> The first properties file is getting cached somehow and its properties are
> being
> read into the second servlet.  This was not happening in 1.4 but it is
> happening
> in 2.0-beta3.
>
>
> <servlet>
>   <servlet-name>velocity</servlet-name>
>
> <servlet-class>org.apache.velocity.tools.view.VelocityLayoutServlet</servlet-class>
>   <init-param>
>       <param-name>org.apache.velocity.properties</param-name>
>       <param-value>/WEB-INF/velocity.properties</param-value>
>   </init-param>
>   <init-param>
>       <param-name>org.apache.velocity.toolbox</param-name>
>       <param-value>/WEB-INF/tools.xml</param-value>
>   </init-param>
>   <load-on-startup>10</load-on-startup>
> </servlet>
> <servlet>
>   <servlet-name>velocityCss</servlet-name>
>
> <servlet-class>org.apache.velocity.tools.view.VelocityViewServlet</servlet-class>
>   <init-param>
>       <param-name>org.apache.velocity.properties</param-name>
>       <param-value>/WEB-INF/velocity_css.properties</param-value>
>   </init-param>
>   <init-param>
>       <param-name>org.apache.velocity.toolbox</param-name>
>       <param-value>/WEB-INF/tools.xml</param-value>
>   </init-param>
>   <load-on-startup>20</load-on-startup>
> </servlet>
>
> <servlet-mapping>
>   <servlet-name>velocity</servlet-name>
>   <url-pattern>*.vm</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
>   <servlet-name>velocityCss</servlet-name>
>   <url-pattern>*.css</url-pattern>
> </servlet-mapping>
>
>
> All my stylesheets keep coming up with the text/html contentType.  That
> second properties
> file is completely ignored.
>
> Let me know if there is anything I can do.  Thanks a lot.
>
>
> Charlie
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message