"Philip Wachtel" <[EMAIL PROTECTED]> writes:
>------=_NextPart_000_0035_01C36724.722AB170
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>Hi there,
>I tried to insert objects into the context objects (import =
>org.apache.velocity.context.Context) and reference them on the action =
>(.vm) screen, but they are never valid references. =20
>What I'm trying to do is simple, really:
Which Turbine version is this? I remember a bug where the context object was
rebuilt between action and screen. This _should_ work in either 2.2.1 or 2.3
Regards
Henning
>_______________my Action__________________
>package us.wachtel.webmail.modules.actions;
>import org.apache.turbine.modules.Action;
>import org.apache.turbine.util.RunData;
>import org.apache.velocity.context.Context;
>import us.wachtel.webmail.*; =20
>public class AddUser extends Action {
> public void doCreateUser(RunData runData, Context context) {
> runData.setMessage(new String("Hi there"));
> WachtelUser wachtelUser =3D new WachtelUser();
> wachtelUser.setUname("philip");
> wachtelUser.setFname("Philip");
> wachtelUser.setLname("Wachtel");
> =20
> try {
> wachtelUser.save();
> } catch (Exception e) {
> context.put("error", e.getMessage());
> =20
> }
> context.put("user", wachtelUser);
> //System.out.println("UserId is:" + wachtelUser.getUserId() + " =
>and primary key is: " + wachtelUser.getPrimaryKey()); =20
> }
> public void doPerform(RunData runData)=20
> throws Exception {
> // nothing happening here, move on please.
> }
>}
>____________________end Action_________________________
>____________________AddUserConfirm.vm_____________________
>Error, if any: $error<p/>
>Message for testing: $data.Message<p/>
>User ID is: $user.UserId<br/>
>Primary key is: $user.PrimaryKey
>___________________end AddUserConfirm.vm__________________
>___________________URL I use to test action__________________
>http://localhost:8081/webmail/servlet/webmail/template/AddUserConfirm.vm?=
>action=3DAddUser&eventSubmit_doCreateUser
>___________________end URL I use to test action__________________
>____________________Response on page__________________
>Error, if any: :null:=20
>Message for testing: $data.Message=20
>User ID is: $user.UserId
>Primary key is: $user.PrimaryKey=20
>____________________end Response on page___________________
>So, I'm confused. =20
>Thanks for the help.
>Regards,
>Philip
>------=_NextPart_000_0035_01C36724.722AB170--
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
[EMAIL PROTECTED] +49 9131 50 654 0 http://www.intermeta.de/
Java, perl, Solaris, Linux, xSP Consulting, Web Services
freelance consultant -- Jakarta Turbine Development -- hero for hire
"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!"
-- AOL CD when played backwards (User Friendly - 200-10-15)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]