hi, i m using
struts for my add/update/delete process while i am able to get the values from the db , now i wanted to put values into the db using struts...,
this is the code in
jsp...
<td> <html:text property="policyName" size="5"/></td>
<td><html:text property="policyGames" size="2"/></td>
<td><html:text property="policyDays" size="2"/></td>
<td><html:text property="policyCost" size="2"/></td>
<td><html:submit property="policyAdd" >Add Policy </html:submit></td>
when i submit i even kept the reference in PolicyForm.java...
...public void setPolicyAdd() _policyAdd="Add Policy";
...public
String getPolicyAdd() retun_policyAdd
and in Action class PolicyAction ...
public void processAction(
ActionMapping mapping, ActionForm form, PortletConfig config,
ActionRequest req, ActionResponse res)
throws Exception
{
System.out.println("Entered into ProcessAction method of Policy Action method....");
PolicyForm policyForm = (PolicyForm) form;
if(!policyForm.getPolicyName().equals("") && "Add Policy".equals(policyForm.getPolicyName()))
{
try
{
Context ctx = new InitialContext();
CcsBaseballPolicyHome home= (CcsBaseballPolicyHome) ctx.lookup("CcsBaseballPolicy");
Integer rowCount=new Integer(home.findAll().size()+1);
CcsBaseballPolicy ccsBaseballPolicy= home.create(new String(policyForm.getPolicyName()) , rowCount ,policyForm.getPolicyGames(),policyForm.getPolicyDays(),policyForm.getPolicyCost());
System.out.println("New Policy Created with : "+ccsBaseballPolicy.getPolicyName() + "..."+ccsBaseballPolicy.getPolicyId());
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
i m checking for the submit button laeble...and doing the rest...
but when i tried for trace in both the actiion and form classes i dont see any for button....submit..can any one...suggest me the process fi i gone wrong...
and if thisisz theprocess..poz..te..me...