i can not believe that i am the only one using this functionality ...
please help!!
i solved some problems, but it still doesn't work ...
here is what i did:
i use tdk1.1a9
* create a new application (newapp.bat test)
* set module.packages=org.test,org.apache.turbine.modules
* set
action.sessionvalidator=sessionvalidator.TemplateSecureSessionValidator
* add template.login=login.vm
* create login.vm (attached)
* create org.test.Login.java (attached)
* build test
now i get my login-screen http://localhost:8080/test/servlet/test :o)
but if i try to log in i get the following excption: :-(
[Fri Nov 17 07:24:54 GMT+01:00 2000] -- ERROR -- An error occurred
while rendering template layoutsnull:
null
[Fri Nov 17 07:24:54 GMT+01:00 2000] -- ERROR --
Exception: java.lang.NullPointerException
Stack Trace follows:
java.lang.NullPointerException
at org.apache.velocity.Template.merge(Template.java:276)
at
org.apache.turbine.services.velocity.TurbineVelocityService.handleRequest(TurbineVelocityService.java:236)
at
org.apache.turbine.services.velocity.TurbineVelocityService.handleRequest(TurbineVelocityService.java:201)
at
org.apache.turbine.services.velocity.TurbineVelocity.handleRequest(TurbineVelocity.java:106)
at
org.apache.turbine.modules.layouts.VelocityECSLayout.doBuild(VelocityECSLayout.java:129)
at org.apache.turbine.modules.Layout.build(Layout.java:93)
at org.apache.turbine.modules.LayoutLoader.exec(LayoutLoader.java:122)
at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:170)
at org.apache.turbine.modules.Page.build(Page.java:92)
at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:122)
at org.apache.turbine.Turbine.doGet(Turbine.java:372)
at org.apache.turbine.Turbine.doPost(Turbine.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:799)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:745)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:407)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
please help to solve this problem ... then i will write some nice
documentation for tdk
login.vm:
$page.setTitle("This is the index title")
$page.setBgColor("#ffffff")
<font face="verdana,geneva,helvetica">
<h3>$message</h3>
<form method="POST" name="turbine"
action="http://localhost:8080/test/servlet/test/template/index.vm/action/LoginUser"
>
<p>Username
<input type="text" name="textfield2">
</p>
<p>Passwort
<input type="password" name="textfield">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
$today
</font>
Login.java:
package org.test.screens;
// JDK Imports
import java.io.*;
import java.util.*;
import org.apache.turbine.modules.*;
import org.apache.turbine.util.*;
import org.apache.turbine.services.*;
import org.apache.turbine.modules.screens.*;
// Velocity Stuff
import org.apache.velocity.Context;
/**
* Sample LoginScreen for using Velocity.
*
* @author Dave Bryson<a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
*/
public class Login extends VelocityScreen
{
/**
* This is an example of all you need to do to add custom screens
* into the WebMacro site. Just extend the WebMacroSiteScreen and
* override this method. Note: context is a protected variable in
the
* base class. It is very important that you add any information to
the
* WebContext using "context". Otherwise it will not show up in your
* template.
*/
public void doBuildTemplate( RunData data, Context context )
{
// Could add Security checks here if desired and
// perform any needed logic. Then add to the context and
// let the WebMacroSiteScreen handle the rest.
//context = getContext(data);
context.put("today", new Date().toString());
context.put("message", data.getMessage());
}
}
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]