You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by ilfrin <il...@poczta.onet.pl> on 2003/09/22 01:40:50 UTC

configuring the tdk 2.3 - tips and tricks

Hi,

  I've been asked to summarize my path of making the
  example app of the tdk 2.3 v20030905 work

  1. first of all download the tdk 2.3 from
  http://jakarta.apache.org/~mpoeschl/

  2. read carefully the tdk howto at
  http://jakarta.apache.org/turbine/tdk/tdk-howto.html and do all that
  is written there

  3. your jdk must be 1.4 at least (for tomcat), mine is 1.4.2_01
  4. chagne the TDK_HOME/ancillary/web.xml to contain the following

<web-app>
  <servlet>
    <servlet-name>@PROJECT@</servlet-name>
    <servlet-class>org.apache.turbine.Turbine</servlet-class>
    <init-param>
      <param-name>applicationRoot</param-name>
      <param-value>@APP_ROOT@</param-value>
    </init-param>
    <init-param>
      <param-name>properties</param-name>
      <param-value>@APP_PROPERTIES@</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>@PROJECT@</servlet-name>
    <url-pattern>/@PROJECT@/*</url-pattern>
  </servlet-mapping>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>templates</web-resource-name>
      <url-pattern>/templates/*</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
      <web-resource-name>logs</web-resource-name>
      <url-pattern>/logs/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Templates</realm-name>
  </login-config>
</web-app>

 save the file

  5. setup everything as told in the tdk turorial and run the build
  6. go to the webapps/newapp (or whateer name you gave it, I'll use
  webapp) and remove the servlet.jar from the web-inf/lib dir
  7. in TDK_HOME/conf/web.xml uncomment the following element

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
  
  8. I kicked out the "example" context from TDK_HOME/conf/server.xml
  couse the error was annoying me but I believe it is not necessary

  9. I corrected the templates (VTL) according to the guidelines at
  http://jakarta.apache.org/turbine/turbine-2.3/howto/velocityonlylayout-howto.html
  but the app runs without it anyway (just na <html> tags are present
  but IE and Mozilla tolerate that...)

  10. but modify first the build.props from newapp/web-inf/build/
  according to the TDK howto - add tdk.home, define database props and
  add the torque.xxx props for the database

  11. run the init task of the newapp/web-inf/build/build.xml, but (!)
  ant will need the servlet.jar to compile in it's classpath so either
  add it to claspath in the build.xml, or if you use Eclipse as I do
  just add the jar in ant's properties to the classpath (e.g. from
  TDK_HOME/tdk/lib)

  12. run tomcat and call your app with your browser at
  http://localhost:8080/newapp/servlet/newapp

  it worked for me, I turned off the log4j files cause it only gave me
  lots of FileNotFounds .. but I believe I'll get it working some time
  ;) ..

  if you have any questions or corrections feel free to comment on
  this

  just for the record:
  I used WinXP Pro and MySQL 4.x

  additionally if you're trying to get your encoding (e.g. UTF-8) to
  work add/change the following lines to your TR.props to

services.VelocityService.input.encoding=UTF-8
services.VelocityService.output.encoding=UTF-8
services.VelocityService.default.contentType=text/html; charset=utf-8

locale.default.charset=UTF-8

  this worked for my templates edited and encoded with utf-8 to be
  viewed properly in the browser ..

  I hope I didn't loose anything, and that it will help someone
  


-- 
Regards,
 ilfrin                          mailto:ilfrin@poczta.onet.pl