Hi,

FWIW:

the <large number>.continue comes from the form you display (probably your
login screen). If the code doesn't go beyond that, there might be an error
in your form that prevents it from quitting.

What you could try is bypass the form and set the user in the flowscript,
then testing if you can display it in your confirm.jx.

e.g.

cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
function doLogin ()
{
//    var form = new Form("forms/login.xml");
//    form.showForm("login-display-pipeline");
//    var model = form.getModel();

      var newUser = new Packages.com.myCompany.myProject.User();
        newUser.setName("testname");
        newUser.setPassword("testPassword");

        var viewData = {user: newUser};
      cocoon.sendPage("confirm.jx", viewData); // note, use 'user' in your
JXtemplate
}

If this works, add the form and check again.

HTH.

Bye, Helma

> -----Original Message-----
> From: Stephane Delort [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 18 June 2004 12:52
> To: [EMAIL PROTECTED]
> Subject: [flowscript] importclass ?
> 
> 
> 
> Hi,
> 
> I don't think it is that simple ...........
> 
> I made tests whit and without "Packages" but it's NOT Ok.
> If the .class is missing cocoon throws me an error requiring 
> it. And if the .class is in the correct place cocoon displays 
> me a http:myport//myadress/65465465465654654654654.continue
> (I mean a high number .continue)
> 
> At the bottom of this doc : 
> http://cocoon.apache.org/2.1/userdocs/flow/java.html  it is 
> about the cocoon.xconf file. I guess that this is only for 
> automated compilation
> 
> If anyone as a good practice with Rhino and java classes, I 
> would be glad to see a snippet. (with the java class path)
> 
> 
> Thanks in advance
> Stephane
> 
> 
> >Hello Stephane,
> >it is very simple! You only have to write:
> >...
> >  importClass(Packages.com.xyz.MyClass);
> >...
> >In your code the string "Packages." is missing!
> >see also at http://cocoon.apache.org/2.1/userdocs/flow/java.html
> >I hope that helps!
> >Dirk
> 
> >Stephane Delort wrote:
> >> Hi,
> >>
> >> I made a simple flowscript which would call a home made java class.
> >>
> >> Here is the flowsctipt :
> >>
> >> 
> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.
> >> js");
> >>
> >>
> >> function main()
> >> {
> >>      importClass(com.myCompany.myProject.User);
> >>      importPackage(java.util);
> >>
> >>      var form = new Form("forms/login.xml");
> >>      form.showForm("login-display-pipeline");
> >>      var model = form.getModel();
> >>
> >>      var newUser = new com.myCompany.myProject User();
> >>     var list = new ArrayList();
> >>      //var insert  = newUser.coucou(); //model.name, 
> model.password);
> >>     cocoon.sendPage("confirm.jx");
> >> }
> >>
> >> the .class is in the 
> >> [$cocoon]/build/webapp/WEB-INF/classes/com/mCompany/myProject
> >>
> >> Here is the JAVA code :
> >>
> >> import java.lang.*;
> >> import java.util.*;
> >> import java.sql.*;
> >>
> >> public class Userpublic class User
> >> {
> >>      public int
> >>           toto = 5;
> >>
> >>      User()
> >>      {,}
> >>
> >>      public int addUser(String name, String surname )
> >>      {
> >>                    // should not be empty once the flowscript works
> >>      }
> >>
> >> }
> >>
> >> THe strange thing is that it is ok for the java.util 
> package and the 
> >> ArrayList class but the program STOPs (I mean it display a 
> >> http://anypath/[numbers]*.continue instead of the 
> JXtemplate page). I 
> >> also tried importClass(Packages.com.myCompany.myProject.User) and  
> >> importPackage(Packages.com.myCompany.myProject) unsuccessfully.
> >>
> >> Any help will be greatly apreciated as I don't find 
> anything on the 
> >> Mozilla-Rhino API.
> >>
> >> Thanks in advance,
> >> Stephane
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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

Reply via email to