Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Is UserDirectory a default class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Is UserDirectory a default class" Watch "Is UserDirectory a default class" New topic
Author

Is UserDirectory a default class

Prasanna RamKumar
Ranch Hand

Joined: Nov 30, 2005
Posts: 31
hi
in a sample program they are using
UserDirectory.getInstance().setUser(username,password1);
but im not able to compile that source code
the code is

package app;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.io.*;
public class RegisterAction extends Action {
public ActionForward perform (ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) {
// b Cast the form to the RegisterForm
RegisterForm rf = (RegisterForm) form;
String username = rf.getUsername();
String password1 = rf.getPassword1();
String password2 = rf.getPassword2();
// c Apply business logic
if (password1.equals(password2)) {
try {
// d Return ActionForward for success
UserDirectory.getInstance().setUser(username,password1);
return mapping.findForward("success");
} catch (UserDirectoryException e) {
return mapping.findForward("failure");
}
}

is the class UserDirectory included defaultly or should i import
from any package
please help me in this

prasanna
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I suspect this example came from the book "Struts in Action". The UserDirectory class is one that the book directs you to write and the book provides the code for it. It is not one of the standard Struts classes.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is UserDirectory a default class