• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Help on Symbol not found

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone give me an idea why this will not compile?

I would be very greatfull!!!

George

LookupAction.java [48:1] cannot resolve symbol
symbol : class LookupForm
location: class com.actmort.LookupAction
LookupForm lookupForm = (LookupForm) form;
^
LookupAction.java [48:1] cannot resolve symbol
symbol : class LookupForm
location: class com.actmort.LookupAction
LookupForm lookupForm = (LookupForm) form;
^
2 errors
Errors compiling LookupAction.




ackage com.actmort;

import java.io.IOException;
import javax.servlet.ServletException;

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 LookupAction extends Action {

protected Double getQuote(String symbol) {

if ( symbol.equalsIgnoreCase ("SUNW") ) {
return new Double(25.00);
}
return null;
}
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse Response)
throws IOException, ServletException {

Double price = null;

// Defau;t target to success
String target = new String("success");
if ( form != null ) {

// Use te LookupForm to get the request parameters
LookupForm lookupForm = (LookupForm) form;

String symbol = lookupForm.getSymbol ();

price = getQuote(symbol);

}

// Set the target to failure
if ( price == null ) {

target = new String("failure");
}
else {

request.setAttribute("PRICE", price);
}
//Forward to the appropriate View
return (mapping.findForward(target));
}
}
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will have to import the package containing the LookupForm class.

ram.
 
George Soto
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ram,

Thank you for you quick response. I use
Package com.actmort;

The assumption is that this will point to WEBAPP\ACTMORT\WEB-INF\classes\com\actmort\LookupForm.class

I am using netbeans as well..

I am unable to compile. But the error in itself is because it can not access the LookupForm. I am assuming and please, correct me, there something blocking it from accessing it... If this is correct I need to check the scope because I can see it there but it is not accessing it...

George






Originally posted by ramprasad madathil:
You will have to import the package containing the LookupForm class.

ram.

 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this a typo:

ackage com.actmort;



And..
Is LookupForm in the com.actmort package?

If not, you'll need to import it.
 
George Soto
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,

Its a copy paste typo. It is actually correct on the code.

Yes, the LookupForm is in the com.actmort package under the class directory.

actmort/web-inf/classes/com/actmort/LookupForm

I was thinking it was the class scope type... I need to double check that this evening!!!

George

Originally posted by Ben Souther:
Is this a typo:


And..
Is LookupForm in the com.actmort package?

If not, you'll need to import it.

 
George Soto
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution: differing version and deprecated objects in Strtus the root cause!

Struts
1.2.8 vs 1.1
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic