Hi all,
I have a question.
I am new into struts and right now doing a small sample page for the
same.
Right now, I have a form which has a textbox which can take a stock
code as input - index.jsp
Here it goes:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>BAT struts application</title>
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr bgcolor="#36566E">
<td height="68" width="48%">
<div align="left">
<img src="images/bulkadmin.jpg" width="220" height="74">
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="Lookup" name="lookupForm" type="bat.LookupForm">
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /></td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>
Now, I have a class LookupForm.java. This extends ActionForm. Here it
goes.
package batclass;
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 request)
{
this.symbol = null;
}
}
Now, I have installed tomcat 4.1.24 and struts 1.1; set CATALINA_HOME
and JAVA_HOME environment variables. Also, since I use
httpServletRequest, I have set the classpath for servlet.jar as well.
Now when I compile the LookupForm.java, it gives me "cannot resolve
symbol" for ActionForm and ActionMapping classes(made them bold in the
class above). What other configuration/setting classpath etc is required
to overcome this? I mean, what other configuration did I miss in order
that I can get this class compile successfully.
Thanks in advance,
Divya.