This is from the view
<html:form action="/Lookup" name="lookupForm" type="edu.LookupForm">
package edu;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class LookupForm extends ActionForm
{private
String symbol=null;
public String getSymbol()
{return (symbol);
}
public void setSymbol(String symbol)
{this.symbol=symbol;
}
public void reset(ActionMapping mapping,HttpServletRequest req)
{
this.symbol=null;
}
}
package edu;
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.ActionMapping;
import org.apache.struts.action.ActionForward;
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;
String target=new String("success");
if(form!=null)
{
LookupForm lookupForm=(LookupForm)form;//At this point while compilation shows cannot resolve symbol
String symbol=lookupForm.getSymbol();
price=getQuote(symbol);
}
if(price==null)
{target=new String("failure");
}
else
{request.setAttribute("PRICE",price);
}
return(mapping.findForward(target));
}
}