• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
To All
i want help pls

package roseindia.web.struts.action; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; public class LoginForm extends ActionForm{static public final long serialVersionUID = -1L; private String action="add"; private String username=null; private String password=null; private String usertype=null; public void setAction(String action){this.action=action; } public String getAction(){return this.action; } public void setUsername(String username){this.username=username; } public String getUsername() {return this.username; } public void setPassword(String password){this.password=password; } public String getPassword(){return this.password; } public void setUsertype(String usertype){this.usertype=usertype; } public String getUsertype(){return this.usertype; } public void reset(ActionMapping mapping,HttpServletRequest request){ this.username=null; this.password=null; this.usertype=null; this.action="add"; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request ) { ActionErrors errors = new ActionErrors(); if( getUsername() == null || getUsername().length() < 1 ) { errors.add("username",new ActionMessage("error.username.required")); } if( getPassword() == null || getPassword().length() < 1 ) { errors.add("password",new ActionMessage("error.password.required")); } if( getUsertype() == null || getUsertype().length() < 1 ) { errors.add("usertype",new ActionMessage("error.usertype.required")); } return errors; } }

--------------------------------------------------------------------------------


It already got compiled and am having a LoginForm.class file in same dir.

Am having my action class in same dir as below-:


code:
--------------------------------------------------------------------------------

package roseindia.web.struts.action; import roseindia.web.struts.action.*;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping; public class LoginAction extends Action{ public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception{ LoginForm loginform = (LoginForm) form; if (loginform.getUsername().equalsIgnoreCase("admin") && loginform.getPassword().equals("admin")) { return mapping.findForward("success"); } else { return mapping.findForward("failure"); } }}

--------------------------------------------------------------------------------

But when i'am trying to compile LoginAction.java am getting an error as-:

cannot find symbol
symbol: class LoginForm
location: class roseindia.web.struts.action.LoginAction


As am having the class file of LoginForm in same dir as LoginAction and am importing the package too, still am getting this error. Please help

Give me the Solution in detail pls help
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please re-post the code between [ CODE ] tags so it is readable.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure you are running your javac command from your root source (the one above the roseindia directory).

- Brent
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic