File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Error in compilation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error in compilation." Watch "Error in compilation." New topic
Author

Error in compilation.

jayaprakash Rengaswamy
Greenhorn

Joined: Nov 27, 2006
Posts: 9
Pls. help me to run the struts program steps.

i have enclosed the struts program and its error.



package app;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class RegisterAction extends Action
{
public ActionForward perform(ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res)
{
app.RegisterForm rf=(app.RegisterForm)form;
String username=rf.getUsername();
String password1=rf.getPassword1();
String password2=rf.getPassword2();
if(password1.equals(password2))
{
try
{
return mapping.findForward("success");
}catch(Exception e)
{
return mapping.findForward("failure");
}
}
return mapping.findForward("failure");
}
}



error
=====

RegisterAction.java:5: package org.apache.struts.action does not exist
import org.apache.struts.action.*;
^
RegisterAction.java:6: cannot resolve symbol
symbol : class Action
location: class app.RegisterAction
public class RegisterAction extends Action
^
RegisterAction.java:8: cannot resolve symbol
symbol : class ActionMapping
location: class app.RegisterAction
public ActionForward perform(ActionMapping mapping,ActionForm form,Http
ervletRequest req,HttpServletResponse res)
^
RegisterAction.java:8: cannot resolve symbol
symbol : class ActionForm
location: class app.RegisterAction
public ActionForward perform(ActionMapping mapping,ActionForm form,Http
ervletRequest req,HttpServletResponse res)
^
RegisterAction.java:8: cannot resolve symbol
symbol : class ActionForward
location: class app.RegisterAction
public ActionForward perform(ActionMapping mapping,ActionForm form,Http
ervletRequest req,HttpServletResponse res)
^
RegisterForm.java:2: package org.apache.struts.action does not exist
import org.apache.struts.action.*;
^
RegisterForm.java:3: cannot resolve symbol
symbol : class ActionForm
location: class app.RegisterForm
public class RegisterForm extends ActionForm

regs
jayaprakash
dexter ramirez
Greenhorn

Joined: Jul 10, 2007
Posts: 4
dowload the package that consist <org.apache.struts.action.*>.....

then add to your libraries...
jayaprakash Rengaswamy
Greenhorn

Joined: Nov 27, 2006
Posts: 9
thanks, pls. send the download link.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
You probably don't need to download them. If you've got Struts installed, then all the libraries should be in the WEB-INF/lib directory of your web application. It's just a matter of adding them to your classpath during compilation.


Ping & DNS - my free Android networking tools app
jayaprakash Rengaswamy
Greenhorn

Joined: Nov 27, 2006
Posts: 9
After the classpath setting, the same error is repeating. pls. help me.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
What is your classpath, and which command are you using for compiling?
jayaprakash Rengaswamy
Greenhorn

Joined: Nov 27, 2006
Posts: 9
My classpath is C:\register\WEB-INF\classes\app>RegisterForm.java
and i am using following command for compilation

javac RegisterForm.java.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
Originally posted by jayaprakash Rengaswamy:
My classpath is C:\register\WEB-INF\classes\app>RegisterForm.java


That's not the classpath - that's the directory you're in.

You said you changed the classpath setting - what exactly did you do?

Also, it will be easier if you go one level up the directory hierarchy (into the "classes" directory), and then compile with "javac app/RegisterForm.java".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in compilation.
 
Similar Threads
pls help me out with this error
Need help to understand the ActionServlet
Whats wrong here? 'PACKAGE'
Servlet action is not available
Is UserDirectory a default class