My understanding is that you don't use forwarding, but instead you set the
screen template property on the run data object (rundata.setScreenTemplate
("otherScreen.jsp")).  This will cause the templating service to include
the jsp file that you set the property to.

This is just my beginner understanding - so I could be completely wrong
(truth told I haven't got Turbine really successfully running yet).

Thanks,
Donald Bell

IBM Knowledge & Content Management



                                                                                       
                            
                    "Scott A.                                                          
                            
                    Roehrig"             To:     <[EMAIL PROTECTED]>     
                            
                    <saroehr@hotma       cc:                                           
                            
                    il.com>              Subject:     Turbine with JSP Beginner's 
Question                         
                                                                                       
                            
                    09/21/2001                                                         
                            
                    08:24 PM                                                           
                            
                    Please respond                                                     
                            
                    to                                                                 
                            
                    turbine-user                                                       
                            
                                                                                       
                            
                                                                                       
                            



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]





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

Reply via email to