[OT] Re: org.apache.jasper.JasperException: /CheckCustomer.jsp(36,67) equal symbol expected

2004-07-30 Thread David Smith
Where your app goes after submitting is up to your action code.  
Normally there's a class that extends org.apache.struts.action.Action 
and implements the execute method.  Somewhere in that execute method is 
something like return mapping.findForward( newUser ) or return 
mapping.findForward( returningUser ) where newUser and 
returningUser are forwards defined in your struts-config.xml file.

At this point you might want to take a walk down to the local book store 
and find a good book on Struts.  Lurking around the struts email lists 
wouldn't hurt either.  I've found Mastering Jakarta Struts by James 
Goodwill pretty good both for learning and as a reference.  I just hope 
he put out a new edition to better cover Struts 1.1.  Lastly, take a 
look around the struts documentation both on the struts website and in 
the various .war files you downloaded with the struts package.

Good luck.
--David
Shilpa Nalgonda wrote:
I did waht all is mentioned, but still i have one problem, radio button not
functioning properly.
when i select new user it will take me to shipping.jsp and if i select
returning usr radio it should take me to another ordersummary.jsp page.
But my application is currently taking me to only shipping.jsp no matter
which radio i select.
Am i missing some scope issue...
Below is my jsp---
label
 html:radio property=customerType value=new/
  bean:message key=prompt.checkCustomerType1/
/label
br
label
  html:radio property=customerType value=returning/
  bean:message key=prompt.checkCustomerType2/
/label
br
Below is my struts config==

form-bean
name=CheckCustomerForm
type=com.ecommerce.form.CheckCustomerForm/
/form-beans
action
path=/checkCustomer
   type=com.ecommerce.action.CheckCustomerAction
   name=CheckCustomerForm
   input=/CheckCustomer.jsp
   forward name=new path=/EditShipping.jsp /
   forward name=returning path=/OrderSummary.jsp /
/action
===
This is my formBean class--
public class CheckCustomerForm extends ValidatorForm
{
private String ms_EmailAddress = null;
private String ms_CustomerType = null;
private String ms_Password = null;
public CheckCustomerForm()
{
   setCustomerType(new);
}
 public String getCustomerType()
{
return this.ms_CustomerType;
}
public String setCustomerType(String type)
{
return this.ms_CustomerType = type;
}
   public void reset(ActionMapping mapping, HttpServletRequest request)
   {
   this.ms_EmailAddress = null;
   this.ms_Password = null;
   }
   /**
* Validate the properties that have been set from this HTTP request,
* and return an codeActionErrors/code object that encapsulates any
* validation errors that have been found.  If no errors are found,
return
* codenull/code or an codeActionErrors/code object with no
* recorded error messages.
*
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
*/
   public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request)
   {
   // Perform validator framework validations
   ActionErrors errors = super.validate(mapping, request);
   if ((ms_CustomerType == null) || (ms_CustomerType.length()  1))
   errors.add(CustomerType,
  new ActionError(error.CustomerType.required));
   if ((ms_EmailAddress == null) || (ms_EmailAddress.length()  1))
   errors.add(EmailAddress,
  new ActionError(error.EmailAddress.required));
   if ((ms_EmailAddress != null)  (ms_Password == null))
   errors.add(Password,
  new ActionError(error.Password.required));
   return errors;
   }


-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 8:01 PM
To: Tomcat Users List
Subject: Re: org.apache.jasper.JasperException:
/CheckCustomer.jsp(36,67) equal symbol expected
Ok.  Cool.  That's what I'm using as well.
Your on the right track with the bean.  Just make sure it extends
org.apache.struts.action.ActionForm (it won't work otherwise) and then
add it to the form-beans section of your struts-config.xml file.
There are examples already there if you're using one of the struts war
files.  I tend to  start with struts-blank.war when I start my projects.
You won't have to instantiate the bean yourself in the jsp because that
will be taken care of by the html:form tag.  You will have to make
sure the name of your form-bean is specified in the name attribute of
your action entry of the struts-config.xml.  Again, the struts war
files have examples in their stock standard 

RE: [OT] Re: org.apache.jasper.JasperException: /CheckCustomer.jsp(36,67) equal symbol expected

2004-07-30 Thread Shilpa Nalgonda
thanks, i forgot to send you my action class, anyway i'll work on it.
just in case if you can find quickly something wrong in the below code let
me know.
Thanks for all ur help David.

public ActionForward execute(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws Exception
{

HttpSession session = request.getSession();

CheckCustomerForm usrform = (CheckCustomerForm)form;

if ( usrform.getCustomerType().equals(new))
{//create a new cutsomer..
return (mapping.findForward(new));
}
else
{
if ( usrform.getCustomerType().equals(returning))
{//display a ordersummary.
return (mapping.findForward(returning));
}
}
return (mapping.findForward(new));
}

===
-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:37 AM
To: Tomcat Users List
Subject: [OT] Re: org.apache.jasper.JasperException:
/CheckCustomer.jsp(36,67) equal symbol expected


Where your app goes after submitting is up to your action code.
Normally there's a class that extends org.apache.struts.action.Action
and implements the execute method.  Somewhere in that execute method is
something like return mapping.findForward( newUser ) or return
mapping.findForward( returningUser ) where newUser and
returningUser are forwards defined in your struts-config.xml file.

At this point you might want to take a walk down to the local book store
and find a good book on Struts.  Lurking around the struts email lists
wouldn't hurt either.  I've found Mastering Jakarta Struts by James
Goodwill pretty good both for learning and as a reference.  I just hope
he put out a new edition to better cover Struts 1.1.  Lastly, take a
look around the struts documentation both on the struts website and in
the various .war files you downloaded with the struts package.

Good luck.

--David

Shilpa Nalgonda wrote:

I did waht all is mentioned, but still i have one problem, radio button not
functioning properly.
when i select new user it will take me to shipping.jsp and if i select
returning usr radio it should take me to another ordersummary.jsp page.
But my application is currently taking me to only shipping.jsp no matter
which radio i select.
Am i missing some scope issue...

Below is my jsp---
 label
  html:radio property=customerType value=new/
   bean:message key=prompt.checkCustomerType1/
 /label
 br
label
   html:radio property=customerType value=returning/
   bean:message key=prompt.checkCustomerType2/
/label
br

Below is my struts config==

form-bean
   name=CheckCustomerForm
   type=com.ecommerce.form.CheckCustomerForm/

 /form-beans

 action
 path=/checkCustomer
type=com.ecommerce.action.CheckCustomerAction
name=CheckCustomerForm
input=/CheckCustomer.jsp
forward name=new path=/EditShipping.jsp /
forward name=returning path=/OrderSummary.jsp /
 /action

===
This is my formBean class--
public class CheckCustomerForm extends ValidatorForm
{

   private String ms_EmailAddress = null;
   private String ms_CustomerType = null;
   private String ms_Password = null;

   public CheckCustomerForm()
   {
  setCustomerType(new);
   }
  public String getCustomerType()
   {
   return this.ms_CustomerType;
   }
   public String setCustomerType(String type)
   {
   return this.ms_CustomerType = type;
   }

public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.ms_EmailAddress = null;
this.ms_Password = null;
}

/**
 * Validate the properties that have been set from this HTTP request,
 * and return an codeActionErrors/code object that encapsulates any
 * validation errors that have been found.  If no errors are found,
return
 * codenull/code or an codeActionErrors/code object with no
 * recorded error messages.
 *
 * @param mapping The mapping used to select this instance
 * @param request The servlet request we are processing
 */
public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request)
{
// Perform validator framework validations
ActionErrors errors = super.validate(mapping, request);
if ((ms_CustomerType == null) || (ms_CustomerType.length()  1))
errors.add(CustomerType,
   new ActionError(error.CustomerType.required));
if ((ms_EmailAddress == null) || (ms_EmailAddress.length()  1))
errors.add