• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

HELP on Struts compile

 
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: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Use javac -d . LookupForm.java LookupAction.java
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If LookupForm is in a different package from LookupAction, you will need an import statement for LookupForm in order for LookupAction to compile.
 
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,

Solution: javac -d . LookupForm.java LookupAction.java

The above statement gave me a clue that it would be deprecated and it was...

Thanks for all of your help.

George
 
reply
    Bookmark Topic Watch Topic
  • New Topic