• 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

cannot compile

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have imported the struts
by

package net;
import javax.servlet.http.*;

but its showing

CustomerForm.java:4: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionError;
^
CustomerForm.java:5: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionErrors;
^
CustomerForm.java:6: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForm;
^
CustomerForm.java:7: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMapping;
^
CustomerForm.java:8: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMessage;
^
CustomerForm.java:10: cannot find symbol
symbol: class ActionForm
public class CustomerForm extends ActionForm{
^
6 errors
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please add struts.jar in the lib of your application.
 
Sojan Chandy Therakom
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
he i alrdy resolved but it was not because of the lack of struts.jar
i have given the wrong enviornment variable...

but the new problem is ....

can anybody help me

i am getting error while compiling my class CustomerAction ....
i alrdy have compiled my acrionform class i.e... CustomerForm

my classes are in WEB-INF/src/net

the error is

CustomerAction.java:5: cannot find symbol
symbol : class CustomerForm
location: package net
import net.CustomerForm;
^
CustomerAction.java:26: cannot find symbol
symbol : class CustomerForm
location: class net.CustomerAction
CustomerForm custForm = (CustomerForm) form;
^
CustomerAction.java:26: cannot find symbol
symbol : class CustomerForm
location: class net.CustomerAction
CustomerForm custForm = (CustomerForm) form;


code

package net;
import net.CustomerForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public class CustomerAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
if (isCancelled(request)){
System.out.println("The cancel operation Performed");
return mapping.findForward("mainpage.jsp");
}

CustomerForm custForm = (CustomerForm) form;
String firstname=custForm.getFirstname();
String lastname=custForm.getLastname();
System.out.println("Customer Firstname is " + firstname);
System.out.println("Customer Lastname is " + lastname);
ActionForward forward=mapping.findForward("success");
return forward;
}
}



i have alrdy compiled the CustomerForm.jave and placed the clas file in side the same folder
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you put the classes in the WEB-INF/classes??
If you are using ant, then the script will do it else you need to explicitly create the same directory structure and put your classes there.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic