Forums Register Login

Help on Symbol not found

+Pie Number of slices to send: Send
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));
}
}
+Pie Number of slices to send: Send
You will have to import the package containing the LookupForm class.

ram.
+Pie Number of slices to send: Send
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.

 
+Pie Number of slices to send: Send
Is this a typo:

ackage com.actmort;



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

If not, you'll need to import it.
+Pie Number of slices to send: Send
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.

 
+Pie Number of slices to send: Send
Solution: differing version and deprecated objects in Strtus the root cause!

Struts
1.2.8 vs 1.1
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1113 times.
Similar Threads
problem with struts-config.xml
cannot find symbol
HELP on Struts compile
ActionForm class
Compiling Struts from CMD.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:21:37.