Hi Antonio

I have been setting TDK v1.2b4 to run under Win2000 with mySQL v1.1 for 
Windows with TDK and standalone Tomcat and jdk1.3.0_02... as a first step 
before putting it onto Linux. I wanted to use hypersonic [since the sample 
app in JetSpeed uses this] but this does not seem to be fully supported.

I've [just about managed with lots of patience] managed to get it up and 
running, most info is available but scattered. I have a very 'loose' 
understanding of tomcat and 2 days knowledge of turbine, so some of the 
following info may be very wrong!

Relevant docs are:
http://jakarta.apache.org/turbine/getting-started.html
http://jakarta.apache.org/turbine/howto/tdk-howto.html
http://jakarta.apache.org/ant/manual/install.html
http://jakarta.apache.org/turbine/services/jsp-service.html
http://jakarta.apache.org/turbine/howto/jsp-howto.html

Files:
http://jakarta.apache.org/builds/jakarta-ant/release/v1.3/bin/akarta-ant-1.3-bin.zip
http://jakarta.apache.org/builds/jakarta-turbine/release/2.1b4/tdk-2.1b4.zip
http://jakarta.apache.org/builds/jakarta-turbine/release/2.1b4/turbine-src-2.1b4.zip

Assuming you've managed to get the sample turbine app running with Velocity 
[doing the whole 'ant' and 'ant init' steps], then you should be able to 
make the following changes and get a sample JSP running:

- Use the default TurbineResources.properties with the following changes

<start of property file>

database.default.driver=org.gjt.mm.mysql.Driver
database.default.url=jdbc:mysql://127.0.0.1/[db_name]
database.default.username=[db_user_name]
database.default.password=[db_password]

template.homepage=/Index.jsp

screen.homepage=

template.login=/Login.jsp

page.default=JspPage

services.JspService.classname=org.apache.turbine.services.jsp.TurbineJspService
services.TemplateService.template.service.name=TurbineTemplateService
services.TemplateService.default.extension=jsp
services.TemplateService.default.navigation=BaseJspNavigation
services.TemplateService.default.screen=BaseJspScreen
services.TemplateService.default.layout.template=/default.jsp

services.JspService.template.extension=jsp
services.JspService.default.page = JspPage
services.JspService.default.screen=BaseJspScreen
services.JspService.default.layout = JspLayout
services.JspService.default.navigation=BaseJspNavigation
services.JspService.default.error.screen = JspErrorScreen
services.JspService.default.layout.template = /default.jsp

services.JspService.templates = /templates/app,/templates/flux
services.JspService.buffer.size = 8192

<end of property file>

[db_name] is the name you've chosen for your database, I had to create this 
manually in mySQL before running 'ant init' to create the om db table and db 
objects

[db_user_name] & [db_password], a valid profile allowing you to create 
tables in your database.

You'll obviously need to select the right driver and update the database 
connection URL if you are not using mySQL

The next thing I had to do was get the correct files in place:

...\webapps\[app_name]\templates\app\layouts\default.jsp
...\webapps\[app_name]\templates\app\navigations\bottom.jsp
...\webapps\[app_name]\templates\app\navigations\top.jsp
...\webapps\[app_name]\templates\app\screens\Index.jsp
...\webapps\[app_name]\templates\app\screens\Login.jsp
...\webapps\[app_name]\templates\app\screens\welcome.jsp

where [app_name] is the tomcat context you have chosen (you get to choose 
this when building the application using ant).

I don't think the locations I used above are necessary correct but I didn't 
want to spend too much time trying to figure out how to change the templates 
root or update source code, the location above seemed to work okay for the 
task at hand.

I created these JSP files from the sample app provided with the source for 
TDK v1.2b4 [separate download to binary]. Look for the file 
'jsp_example.txt' and separate out each jsp file [as per instructions in the 
text file] and save in the locations as specified above.

You'll obviously need to also provide the dependent tld files for the sample 
jsp app in the following target locations:

...\webapps\[app_name]\WEB-INF\tlds\template.tld
...\webapps\[app_name]\WEB-INF\tlds\Test.tld

template.tld comes with the example in the source package, Test.tld comes 
with the binary in location 'tdk\share\sample\templates\jsp\tld\Test.tld'.

I had to update the file default.jsp to remove 'contextRelevant="false"' 
from the following source line [otherwise I get an error message, 'Attribute 
contextRelevant invalid according to the specified TLD']:
<turbine:screen section="head" contextRelevant="false" />

Having a peep at the source for the class 
org.apache.turbine.services.jsp.tags.ScreenTag I find the following text:

/**
* contextRelevant attribute. Meant to allow the Screen
* java code to be skipped in the event the content is static.
* Not working and have not decided whether to make it work or
* remove the functionality.
*/

Last thing I had to do was put file 'UserInfoTag.java' in the following 
location and compile:

...\webapps\[app_name]\WEB-INF\classes\com\planetcad\suitex\UserInfoTag.java

This is for the 'UserInfo' tag in 'Test.tld', the source file can be located 
in the TDK binary, you need to update the package value in the java source 
file to 'com.planetcad.suitex'.

Running this with TDK seemed to be okay except for null being shown for <%= 
rundata.getMessageAsHTML() %> from file default.jsp - I haven't bothered to 
track down the cause of this yet..., but am happy to ignore it for the 
moment.

I then tried copying the web application into tomcat v3.2.1 [i.e. I 
separatly set up tomcat as standalone discarding tomcat v4.x as packaged 
with the TDK], i.e.

..\[tomcat_home]\webapps\[app_name]\...

where [tomcat_home] is where tomcat has been installed. I had to make the 
following adjustments to get the same results as I had been seeing with the 
TDK:

- copy all jar files from:
...\[tomcat_home]\webapps\[app_name]\WEB-INF\lib\
to
...\[tomcat_home]\lib\

- package up Flux into a jar file put the new file in:
...\[tomcat_home]\lib\

You can find the class files for Flux in package 'org.apache.turbine.flux.' 
@:
...\[TDK_home]\webapps\[app_name]\WEB-INF\classes\

- update the dtd definition in web.xml from:

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.3.dtd";>

to

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

The stuff with the jar files is because I'm a novice with tomcat [I thought 
there were 2 places where files get automatically included in the classpath, 
this didn't seem to work so I made the silly workaround above].

Tomcat will then automatically created the correct context on start up and 
you should be able to use the same URL as what you were using to test with 
the TDK, i.e.:

http://localhost:8080/[app_name]/servlet/[app_name]

Hope this helps, Hong

>From: "Antonio Ortega" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: More about JSP
>Date: Wed, 30 May 2001 13:26:07 +0200
>
>Just a fact: I have never been able to run a JSP page under any version
>of TDK (including 1.2b4).
>
>One question:
>     Has someone REALLY run a JSP under TDK.?
>
>Continue only if yuor answer is: YES, I have a JSP running!!!
>
>Now I request your aid. Can anyone sendme an example on how tu run a
>JSP .... :(
>
>For exmple a Turbine Resources.properties file that shows index.jsp or
>login.jsp at the beginning (the files that comes with TDK 1.2b4).
>
>
>_________________
>       Toni Ortega
>[EMAIL PROTECTED]
>_________________

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to