I was hoping someone might have a pointer for me. I am new to the turbine
framework, although I have used products built on it like Jetspeed and IBM
WPS.

I have created a sample application in the TDK and named it sample_jsp. I
futzed with the Turbine.properties until I was able to get it to work with
using JSP as the templating engine.

I use the TurbineServlet as the entrance to then create a Login.jsp page
that is composed of several screen(I basically followed the Velocity layout
system). I created a Login.java action module that creates a users hashtable
to verify the login user. Then I thought that I could forward the request
onto another jsp page. Here is the code

public class Login extends org.apache.turbine.modules.Action {
    // declare member variables

   // declare methods
   /** creates user/password hashtable */
   public java.util.Hashtable createUsers() {
       java.util.Hashtable users = new java.util.Hashtable();
       users.put("saroehr", "P6Y3BHkK");
       users.put("admin", "s809926r");

       return users;

   }

   /** performs user lookup against users hashtable */
   public boolean validate(String userName, String password) {
       java.util.Hashtable users = createUsers();
       boolean authenticated = false;
       if (users.containsKey(userName) &&
users.get(userName).equals(password)){
           authenticated = true;
       }
       else {
           authenticated = false;
       }
       return authenticated;

   }
    /** actionHandler */
    public void doPerform(org.apache.turbine.util.RunData runData) throws
java.lang.Exception {
        String user = runData.getRequest().getParameter("username");
        String password = runData.getRequest().getParameter("password");
        boolean validUser = validate(user, password);
        if (validUser == true) {

(runData.getRequest().getRequestDispatcher("/layout/Home.jsp")).forward(runD
ata.getRequest(), runData.getResponse());
            System.out.println(user+" is a valid system user.");
        }
        else {
            throw new Exception();
        }

    }

However, the forward always raises an exception about being forwarded too
many times.

If this did make any sense, would anyone have any suggestions. Basically I
am trying to figure out how to make the login work and then return a page
based upon the login.

Thanks so much!
Scott

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

Reply via email to