You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Gopal Ramasammy-Cook <go...@psyber.wits.ac.za> on 2001/08/07 20:21:02 UTC
JSP Usage
Hi
I have been trying to get some basic Turbine stuff working in JSP, with no real luck. I have setup my TurbineResources properties file correctly (I think).
I have setup some basic test components as follows:
testjsp.jsp template
―--------------------------
<p> This is a test Jsp template </p>
default.jsp (as per given sample)
―-----------------------------------------------
<%@ page import = "org.apache.turbine.services.jsp.util.*" %>
<%@ page import = "org.apache.turbine.util.*" %>
<%@ page import = "java.util.*" %>
<%@ taglib uri='/WEB-INF/tlds/template.tld' prefix='turbine' %>
<jsp:useBean id="rundata" class="RunData" scope="request"/>
<jsp:useBean id="link" class="JspLink" scope="request"/>
<html>
<!--
A simple jsp layout
<a href="mailto:jmcnally@collab.net">John D. McNally</a>
-->
<head>
<turbine:screen section="head" contextRelevant="false" />
</head>
<body<turbine:bodyAttributes />>
<table width="100%" border="0">
<tr>
<td>
<turbine:navigation template="top.jsp" />
</td>
</tr>
</table>
<table width="120" align="left" border="0">
<tr>
<td valign="top">
Some side<br>
links<br>
Home<br>
</td>
</tr>
</table>
<table width="480" border="0">
<tr>
<td>
<p><font color="#330000"><%= rundata.getMessageAsHTML()
%><br></font></p>
<turbine:screen section="body" />
</td>
</tr>
</table>
<br clear="all">
<table width="100%" border="0">
<tr>
<td>
<turbine:navigation template="bottom.jsp" />
</td>
</tr>
</table>
</body>
</html>
TestJsp.java class
―-------------------------
This extends BaseJspScreen and effectively has an empty doPerform method.
However, when I run this via url http://localhost:8080/tests/servlet/turbine/template/TestJsp.jsp , I get the following error:
Error: 500
Location: /tests/templates/app/layouts/default.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to open taglibrary /WEB-INF/tlds/template.tld : Parse Error in the tag library descriptor: Element type "web-app" is not declared.
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java, Compiled Code)
I am running TDK 2.1 under Tomcat 3.2 and JDK 1.2.2.
tia
Chris
Re: turbine setup, installation, getting started, help please?
Posted by Dan Kha <da...@YorkU.CA>.
Thanks, but in that setup I was trying to use the HypersonicSQL db.
Now I'm getting the same error when I try it with Oracle... I've read the
Oracle 8i-howto doc and I have appropriately changed my
<tdk_root>/webapps/newapp/WEB-INF/build/build.properties and
<tdk_root>/webapps/newapp/WEB-INF/conf/TurbineResources.properties files.
I think the problem is with the "ResourceNotFoundException: Unable to find
resource 'sql/db-init/oracle/windows.vm'" error, as you can see in the
following error text (I'm sure I must not be the first one to get this,
so what did you guys do to resolve this problem in TDK 2.1?):
E:\Java\software\tdk\webapps\newapp\WEB-INF\build>ant init
E:\jdk1.2.2\bin\java
Buildfile: build.xml
init:
init-tasks:
set-os:
set-windows2000:
set-windowsNT:
set-windows98:
set-unix:
unix-ext:
windows-ext:
ext:
[echo] Platform = windows
[echo] Extension = bat
create-database:
[echo] create-database.bat
E:\Java\software\tdk\webapps\newapp\WEB-INF\src\sql\create-database.bat
BUILD FAILED
E:\Java\software\tdk\webapps\newapp\WEB-INF\build\build.xml:115: Exception
throw
n by 'generator.parse'. For more information consult the velocity log.
--- Nested Exception ---
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource
'sql/db-init/oracle/windows.vm'
at
org.apache.velocity.runtime.resource.ResourceManager.getResource(Reso
urceManager.java, Compiled Code)
at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java)
at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava, Compiled Code)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java, Compiled Code)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTRefere
nce.java)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java, Compiled Code)
at org.apache.velocity.Template.merge(Template.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java,
Compi
led Code)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:124)
at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java,
Compiled Cod
e)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java, Compiled
Code)
at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java,
Compiled Cod
e)
at org.apache.tools.ant.Project.executeTargets(Project.java,
Compiled Co
de)
at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 11 seconds
Thanks in advance,
-dan
On Wed, 8 Aug 2001, Andrea Papotti wrote:
> > In step #4 on the tdk-howto, I've modified the
> > TDKROOT/webapps/APPNAME/WEB-INF/build/build.properties
> > to use Hypersonic sql db (just for testing this newapp for now). I'm not
> > even sure if the properties for hsql is correct, so I'm listing them here:
> >
> > databaseUrl=jdbc:HypersonicSQL:FULLPATH/newapp
> > databaseDriver=org.hsql.jdbcDriver
> > databaseUser=sa
> > databasePassword=
> >
> > (what's FULLPATH really? do I specify something like C:\hsql\db or what?
> > any examples?)
> >
>
> from my test:
> ---
> databaseUrl = jdbc:mysql://127.0.0.1/newapp
> databaseDriver = org.gjt.mm.mysql.Driver
> databaseUser = root
> databasePassword = [password removed to protect innocents]
> databaseHost = 127.0.0.1
> ---
>
> I was using mySql, so the databaseDriver does not apply, but the remaining
> lines should be correct also for you.
>
> Hope is useful,
> Andrea
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: turbine setup, installation, getting started, help please?
Posted by Andrea Papotti <bi...@ettelematica.it>.
> In step #4 on the tdk-howto, I've modified the
> TDKROOT/webapps/APPNAME/WEB-INF/build/build.properties
> to use Hypersonic sql db (just for testing this newapp for now). I'm not
> even sure if the properties for hsql is correct, so I'm listing them here:
>
> databaseUrl=jdbc:HypersonicSQL:FULLPATH/newapp
> databaseDriver=org.hsql.jdbcDriver
> databaseUser=sa
> databasePassword=
>
> (what's FULLPATH really? do I specify something like C:\hsql\db or what?
> any examples?)
>
from my test:
---
databaseUrl = jdbc:mysql://127.0.0.1/newapp
databaseDriver = org.gjt.mm.mysql.Driver
databaseUser = root
databasePassword = [password removed to protect innocents]
databaseHost = 127.0.0.1
---
I was using mySql, so the databaseDriver does not apply, but the remaining
lines should be correct also for you.
Hope is useful,
Andrea
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
turbine setup, installation, getting started, help please?
Posted by Dan Kha <da...@YorkU.CA>.
Hi,
I'm trying to test out turbine 2.1 and ran into a few problems that I hope
you guys/gals will be able to help out with.
I'm following the doc at
http://jakarta.apache.org/turbine/howto/tdk-howto.html to setup the first
turbine app 'newapp'. (btw, feedback on the getting_started.txt file in
the download package is that it doesn't really help..)
In step #4 on the tdk-howto, I've modified the
TDKROOT/webapps/APPNAME/WEB-INF/build/build.properties
to use Hypersonic sql db (just for testing this newapp for now). I'm not
even sure if the properties for hsql is correct, so I'm listing them here:
databaseUrl=jdbc:HypersonicSQL:FULLPATH/newapp
databaseDriver=org.hsql.jdbcDriver
databaseUser=sa
databasePassword=
(what's FULLPATH really? do I specify something like C:\hsql\db or what?
any examples?)
Then, in step #5 of the tdk-howto, I'm suppose to run "ant init" but this
causes the following exception:
E:\Java\software\tdk\webapps\newapp\WEB-INF\build>ant init
E:\jdk1.2.2\bin\java
Buildfile: build.xml
init:
init-tasks:
set-os:
set-windows2000:
set-windowsNT:
set-windows98:
set-unix:
unix-ext:
windows-ext:
ext:
[echo] Platform = windows
[echo] Extension = bat
create-database:
[echo] create-database.bat
E:\Java\software\tdk\webapps\newapp\WEB-INF\src\sql\create-database.bat
BUILD FAILED
E:\Java\software\tdk\webapps\newapp\WEB-INF\build\build.xml:115: Exception
throw
n by 'generator.parse'. For more information consult the velocity log.
--- Nested Exception ---
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource
'sql/db-init/hypersonic/windows.vm'
at
org.apache.velocity.runtime.resource.ResourceManager.getResource(Reso
urceManager.java, Compiled Code)
at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java)
at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.j
ava, Compiled Code)
at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTRefer
ence.java, Compiled Code)
at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTRefere
nce.java)
at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.
java, Compiled Code)
at org.apache.velocity.Template.merge(Template.java)
at org.apache.velocity.texen.Generator.parse(Generator.java)
at org.apache.velocity.texen.ant.TexenTask.execute(TexenTask.java,
Compi
led Code)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:124)
at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java,
Compiled Cod
e)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java, Compiled
Code)
at
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java,
Compiled Cod
e)
at org.apache.tools.ant.Project.executeTargets(Project.java,
Compiled Co
de)
at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 10 seconds
And finally, is there any doc on the file <TDK_ROOT>/build.properties?
Like what does the following properties do in the file?
app.root = share/sample
share.dir = share
TIA,
dan
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org