more than one condition using logic tags...

2003-10-29 Thread VKeswani
Hello,

I asked this before - 
Is it possible to have more than one condition using struts logic 
tags...like

If A  B  C then {
do something...
} 


how to achieve this in the jsp using logic tags?
Please help

Re: more than one condition using logic tags...

2003-10-29 Thread VKeswani
Thanks all...




David Graham [EMAIL PROTECTED]
10/29/2003 10:06 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: more than one condition using logic tags...



--- [EMAIL PROTECTED] wrote:
 Hello,
 
 I asked this before - 
 Is it possible to have more than one condition using struts logic 
 tags...like
 
 If A  B  C then {
 do something...
 } 

The JSTL provides this capability:

c:if test=${A  B  C}
  do something
/c:if

http://java.sun.com/products/jsp/jstl/

David

 
 
 how to achieve this in the jsp using logic tags?
 Please help


__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Help please -- How to provide a Back button?

2003-10-29 Thread VKeswani
for ur question 2:

you can use javascript function to call two different action:

function faddpurpose() {
document.editform.methodtocall.value = addpurpose;
document.editform.forwardpage.value = totalsuccess;
document.editform.target=_self;
document.editform.submit();
}

function fcalculatepaypd() {
document.editform.methodtocall.value = calculatepaypd;
document.editform.forwardpage.value = totalsuccess;
document.editform.target=_self;
document.editform.submit();
}
html:form name=editform method=post action=adjrecordsdispatch.do
type=aaa.ers.struts.forms.RecordsForm

so U can create a dispatch action and call two different action changing 
value for methodtocall.If you are not using dispatch action then just set 
your forms action to whatever action U want to go to..




ZYD [EMAIL PROTECTED]
10/29/2003 01:18 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Help please -- How to provide a Back button?


Dear all,

Question 1:

How to provide a Back button on a page?

Is there a html tag like the one for Cancel button: html:cancel ?

Question 2:

How to provide two submit buttons on one JSP page,
when click on the 1st button, the page is submitted to 1st action,
when click on the 2nd button, it's submitted to 2nd action?

Any response will be appreciated.
Thanks.

bruce



Re: DynaValidatorForm and copyProperties

2003-10-27 Thread VKeswani
try using :

BeanUtils.copyProperties( formBean, searchBean );




Frers Michael [EMAIL PROTECTED]
10/27/2003 09:16 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:DynaValidatorForm and copyProperties


Hello
anyone have an idea how to easy copy values from a dynavalidatorform to an
existing bean?

i have a dynavalidatorform like:

form-bean
name=SearchForm
type=org.apache.struts.validator.DynaValidatorForm
form-property
name=searchString
type=java.lang.String/
/form-bean

and a Bean looking like:

public class SearchValues {
private String sSearchString;

public String getSearchString() {
return sSearchString;
}
public void setSearchString(String iStringi) {
sSearchString = iStringi;
}
}


something like following in my action class didnt work
DynaActionForm formBean = (DynaActionForm)form;

SearchValues searchBean = new SearchValues();

PropertyUtils.copyProperties(formBean,searchBean);




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





More than one condition using struts logic tags???

2003-10-27 Thread VKeswani
Hello,

I have a little query -

How can I check for more that one condition using struts logic tags? like 

if (A  B  C) {
do something.
}

how do I achieve the same using struts logic tags?

Multiple error pages from validate method

2003-10-24 Thread VKeswani
Hello,

I am using one ActionForm bean for multiple pages..say for add.jsp and 
edit.jsp.But when I validate and I get an error I want the user to go to 
different error pages instead of one just specified in struts-config file 
as input parameter?

Can somebody help??

Re: Multiple error pages from validate method

2003-10-24 Thread VKeswani
Thanks geeta!

Yes that might be a roundabout way of doing it.Lemme try!




Geeta Ramani [EMAIL PROTECTED]
10/24/2003 02:36 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: Multiple error pages from validate method


Here's one hacky way of doing this:  Set a request attribute, something
like goToErrorPage2 right after you validate. On the top of the error 
page
if that attribute goToErrorPage2 is nonnull, then forward to the second 
error
page else simply render the normal error page..

[EMAIL PROTECTED] wrote:

 Hello,

 I am using one ActionForm bean for multiple pages..say for add.jsp and
 edit.jsp.But when I validate and I get an error I want the user to go to
 different error pages instead of one just specified in struts-config 
file
 as input parameter?

 Can somebody help??


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





RE: Multiple error pages from validate method

2003-10-24 Thread VKeswani
Thanks Tim.This too makes good sense..thanks 




Chen, Gin [EMAIL PROTECTED]
10/24/2003 02:45 PM
Please respond to Struts Users Mailing List

 
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
cc: 
Subject:RE: Multiple error pages from validate method


Here's another way that I can think of:

I'm assuming you will have 2 actions (one for add and one for edit) or a
single action that uses a lookupdispatch add/edit handling.
In either case don't have validate=true in your struts-config but rather
do the validation from your action method:
public ActionForward addAction()
{
  ActionErrors errors = myBean.validate(...);
  if( errors != null  !errors.isEmpty())
  {
  return aMapping.findForward(ERROR_PAGE_ADD);
  }
}

Do the same for edit.

Of course there are a lot of other ways to do this as well.
-Tim

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 24, 2003 3:36 PM
To: Struts Users Mailing List
Subject: Re: Multiple error pages from validate method


Here's one hacky way of doing this:  Set a request attribute, something
like goToErrorPage2 right after you validate. On the top of the error 
page
if that attribute goToErrorPage2 is nonnull, then forward to the second
error
page else simply render the normal error page..

[EMAIL PROTECTED] wrote:

 Hello,

 I am using one ActionForm bean for multiple pages..say for add.jsp and
 edit.jsp.But when I validate and I get an error I want the user to go to
 different error pages instead of one just specified in struts-config 
file
 as input parameter?

 Can somebody help??


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Having trouble with html:form tag - Using 1.1 - NO luck

2003-10-24 Thread VKeswani
try changing your mapping in web.xml to  *.do  and the for your form
html:form name=myForm method=post action=myAction.do
type=aaa.ers.struts.forms.myForm
and in ur config file

action name=myForm path=/myAction parameter=methodtocall scope=request 
type=aaa.ers.struts.actions.myAction validate=false

change ur mapping





Jim Kennedy [EMAIL PROTECTED]
10/24/2003 03:12 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: Having trouble with html:form tag - Using 1.1 - NO luck


Validate method is not being fired.  I placed debug log messages in 
validate
method.  I do see the form class loaded by the class loader though.  I'm
using JBOSS with Tomcat 4.1.24

Could it have something to do with the fact that I have multiple uri's
mapped to the action servlet.  But I am not using modules.

Jim Kennedy
IT Consultant
Mobile Phone: 813-503-1484
-


- Original Message -
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 24, 2003 3:48 PM
Subject: RE: Having trouble with html:form tag - Using 1.1


 Is it possible since you are using validation; validate=true that your
 validation is failing and that is why ur action doesn't run???debug for
 validate method in actionform bean?




 Chen, Gin [EMAIL PROTECTED]
 10/24/2003 02:32 PM
 Please respond to Struts Users Mailing List


 To: 'Struts Users Mailing List'
[EMAIL PROTECTED]
 cc:
 Subject:RE: Having trouble with html:form tag - Using 
1.1


 Don't know if this will do anything but change
 html:form action=pmregister
 To
 html:form action=/pmregister

 From the struts-html guide:
 If you are using path mapping to select the controller servlet, this
 value
 should be exactly equal to the path attribute of the corresponding
 action
 element.

 Note the exactly equal to
 -Tim

 -Original Message-
 From: Jim Kennedy [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 24, 2003 3:05 PM
 To: Struts Users Mailing List
 Subject: Re: Having trouble with html:form tag - Using 1.1


 I took out those attributes from the html:form tag , but the results 
were
 exactly the same.  This is weird.  My setup looks correct.

   Here's my struts XML:
  
   form-bean
   name=pmRegisterForm
   type=com.je.struts.action.PMRegisterForm
   /form-bean
   .
  
   action path=/pmregister
   type=com.je.struts.action.PMRegisterAction
   scope=request
   name=pmRegisterForm
  
  
input=/tmpl_main.jsp?page=/main/pm/regform.jspamp;page_title=Property
   Management Services
   validate=true
   forward name=fees
   path=/tmpl_main.jsp?page=/main/pm/fees.jspamp;page_title=Property
   Management Services/
   /action
  


 I think is has something to do with my servlet mappings.  It also seems
 odd
 to me that the generated action in the generated page is /webapp. Where
 /webapp is my context.  This I believe to be a problem also.

 Not sure.  Any suggestions.


 Jim Kennedy
 IT Consultant
 Mobile Phone: 813-503-1484
 -


 - Original Message -
 From: Chen, Gin [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Friday, October 24, 2003 1:58 PM
 Subject: RE: Having trouble with html:form tag - Using 1.1


  1.1 doesn't have the type and name anymore.
  Try to take that out and then show us how you have struts-config for
 that
  action setup.
  -Tim
 
  -Original Message-
  From: Jim Kennedy [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 24, 2003 1:51 PM
  To: Struts Users Mailing List
  Subject: Re: Having trouble with html:form tag - Using 1.1
 
 
  1.1
 
  Jim Kennedy
  IT Consultant
  Mobile Phone: 813-503-1484
  -
 
 
  - Original Message -
  From: Chen, Gin [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Friday, October 24, 2003 1:48 PM
  Subject: RE: Having trouble with html:form tag
 
 
   First off.. What version of Struts are you using?
   This appears to be an older version as type/name are deprecated.
   You should be have setting those in the struts-config.
   Also make sure your action matches the action path in your
 struts-config.
   -Tim
  
   -Original Message-
   From: Jim Kennedy [mailto:[EMAIL PROTECTED]
   Sent: Friday, October 24, 2003 1:42 PM
   To: Struts Users Mailing List
   Subject: Having trouble with html:form tag
  
  
   This is my first shot at using 100% struts tags for my forms.  I'm
 missing
   something.
  
   snippet from jsp:
  
   html:form action=pmregister method=post focus=firstName
   name=pmRegisterForm type=com.je.struts.action.PMRegisterForm
   !--form action=pm/pmregister method=post --
   PFirst namenbsp;*nbsp;: html:text property=firstName 
size=20
   maxlength=15//P
   PLast 

Re: Having trouble with html:form tag - Using 1.1 - THAT WORKED

2003-10-24 Thread VKeswani
I think your way should work too.You should be able to define any kind of 
mapping as per rules!!Your mapping should match the call.

But when U define mapping as /pm/* then you also have to call servlet 
like.
html:form name=myForm method=post action=/pm/myAction
 type=aaa.ers.struts.forms.myForm
action name=myForm path=/pm/myAction parameter=methodtocall
scope=request type=aaa.ers.struts.actions.myAction validate=false

and this should work too.I am not sure if you tried that??
but since the other one is working :) good





Jim Kennedy [EMAIL PROTECTED]
10/24/2003 03:39 PM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 
Subject:Re: Having trouble with html:form tag - Using 1.1 - THAT WORKED


But why.  I don't understand.  I should be able to define:

/pm/*
/hello/*
/anything/* to the Struts action servlet.  It's doing weird things here.
It's not able to figure out that I am using /pm/...  I guess because it's
getting confused by all the other subcontexts.  It should be using the
sample context/subcontext as the form itself.

Do you think this is a bug?  Or should I avoid /this/*  and /that/* ?  How
would I do security on some but not all then?

Jim Kennedy
IT Consultant
Mobile Phone: 813-503-1484
-


- Original Message -
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 24, 2003 4:21 PM
Subject: Re: Having trouble with html:form tag - Using 1.1 - NO luck


 try changing your mapping in web.xml to  *.do  and the for your form
 html:form name=myForm method=post action=myAction.do
 type=aaa.ers.struts.forms.myForm
 and in ur config file

 action name=myForm path=/myAction parameter=methodtocall
scope=request type=aaa.ers.struts.actions.myAction validate=false

 change ur mapping





 Jim Kennedy [EMAIL PROTECTED]
 10/24/2003 03:12 PM
 Please respond to Struts Users Mailing List


 To: Struts Users Mailing List
[EMAIL PROTECTED]
 cc:
 Subject:Re: Having trouble with html:form tag - Using
1.1 - NO luck


 Validate method is not being fired.  I placed debug log messages in
 validate
 method.  I do see the form class loaded by the class loader though.  I'm
 using JBOSS with Tomcat 4.1.24

 Could it have something to do with the fact that I have multiple uri's
 mapped to the action servlet.  But I am not using modules.

 Jim Kennedy
 IT Consultant
 Mobile Phone: 813-503-1484
 -


 - Original Message -
 From: [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 24, 2003 3:48 PM
 Subject: RE: Having trouble with html:form tag - Using 1.1


  Is it possible since you are using validation; validate=true that 
your
  validation is failing and that is why ur action doesn't run???debug 
for
  validate method in actionform bean?
 
 
 
 
  Chen, Gin [EMAIL PROTECTED]
  10/24/2003 02:32 PM
  Please respond to Struts Users Mailing List
 
 
  To: 'Struts Users Mailing List'
 [EMAIL PROTECTED]
  cc:
  Subject:RE: Having trouble with html:form tag - Using
 1.1
 
 
  Don't know if this will do anything but change
  html:form action=pmregister
  To
  html:form action=/pmregister
 
  From the struts-html guide:
  If you are using path mapping to select the controller servlet, this
  value
  should be exactly equal to the path attribute of the corresponding
  action
  element.
 
  Note the exactly equal to
  -Tim
 
  -Original Message-
  From: Jim Kennedy [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 24, 2003 3:05 PM
  To: Struts Users Mailing List
  Subject: Re: Having trouble with html:form tag - Using 1.1
 
 
  I took out those attributes from the html:form tag , but the results
 were
  exactly the same.  This is weird.  My setup looks correct.
 
Here's my struts XML:
   
form-bean
name=pmRegisterForm
type=com.je.struts.action.PMRegisterForm
/form-bean
.
   
action path=/pmregister
type=com.je.struts.action.PMRegisterAction
scope=request
name=pmRegisterForm
   
  
 input=/tmpl_main.jsp?page=/main/pm/regform.jspamp;page_title=Property
Management Services
validate=true
forward name=fees

path=/tmpl_main.jsp?page=/main/pm/fees.jspamp;page_title=Property
Management Services/
/action
   
 
 
  I think is has something to do with my servlet mappings.  It also 
seems
  odd
  to me that the generated action in the generated page is /webapp. 
Where
  /webapp is my context.  This I believe to be a problem also.
 
  Not sure.  Any suggestions.
 
 
  Jim Kennedy
  IT Consultant
  Mobile Phone: 813-503-1484
  -
 
 
  - Original Message -
  From: Chen, Gin [EMAIL PROTECTED]
  To: 'Struts Users Mailing