RE: paging taglib and struts?

2002-04-17 Thread Mattos, John

Malcolm

I've been reading throughthe documentation for the taglib, and I'm getting
the impression that the collectionof things I'm interating over has to exist
in it's entirety in server memory. Is that true? This is slightly
problematic for me because it's a large collection of data (I know, I should
push back on the user...it's along story)

My questions are
1. how does it know what the collection is that I'm iterating
through
2. what are you using the ""
for?

currently ,y 
I've included my jsp for reference...

Any help is appreciated.

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

--- My JSP--- 



View Valid Transactions


Type
Status
Org Id
Org Name
Channel
Product Title
Signal Type
Event #
Deal
Retail
Buys
Amount Due
Post Date





<%=buyTransaction.getType()%> 
<%=buyTransaction.getStatus()%> 
<%=buyTransaction.getOrgId()%>
<%=buyTransaction.getAffiliateFullName().trim()%> 
<%=buyTransaction.getChannel()%> 
<%=buyTransaction.getAssetTitle()%> 
<%=buyTransaction.getTiertype()%> 
<%=buyTransaction.getIndAsstId()%> 
<%=buyTransaction.getDealTerm()%> 
$<%=buyTransaction.getTransAmt()%> 
<%=buyTransaction.getBuys()%> 
$<%=buyTransaction.getTotalTransAmt()%>
<%=buyTransaction.getPostDate()%> 






 

  

  [ (<%= pageNumber %>) << Previous ]


   <%= pageNumber %> 


  [ Next >> (<%= pageNumber %>) ]

  




--- END ---

-Original Message-
From: Malcolm Wise [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 4:32 AM
To: 'Struts Users Mailing List'
Subject: RE: paging taglib and struts?


John,

I am using this taglib quite extensively and it works very well with Struts.
Below is a fairly basic example jsp.
Essentially, the pager url attribute specifies the destination when any of
the navigation links is clicked.  Request parameters required by the action
class can be specified using the param tag.  These can be literals
(value="search") as in my example or use  and specify the value
attribute as the resulting variable (value="<%=expr%>").  The item tag
defines each row to be displayed, and needs to be enclosed within
.  The index tag defines the navigation bar (prev, next etc)
as a series of hyperlinks.  The maxIndexPages attribute of the pager tag
defines how many page numbers will be displayed in the navigation bar, i.e
the below example will display

[<>]

assuming there are 10 pages worth of data.  [<>] only
display if there are previous or more pages.  The maxPageItems attribute
specifies how many detail rows per page to be displayed.

I'm happy to answer any further questions or give examples.

Cheers
Malc


  

   
   
   
 




 
 

   
  
  
  
  
   

 
  
  
  
 
 

[<< Prev]


   
   
   <%=pageNumber%>
   
   
   <%= pageNumber %>
   
 
 [Next >>]
 
  
  
   

 
  
   


-Original Message-
From: John Menke [mailto:[EMAIL PROTECTED]]
Sent: 03 March 2002 02:08
To: struts-user
Subject: paging taglib and struts?


Does anyone any suggestions for implementing paging with struts? I have
searched the archive and karl basel posted this:



There's a good pager taglib at jsptags.com. I've used it in a struts app and
does the job quite well when embedded in the iterate tags.


   
   Item Details
   





I have downloaded this pager and the documentation is not providing enough
info

RE: Announce Struts E-Book for less than $10

2002-04-05 Thread Mattos, John

But really, it does suck.

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 11:20 AM
To: 'Struts Users Mailing List'
Subject: RE: Announce Struts E-Book for less than $10


;-)

You work for Land's End? In Maine?

-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 9:25 AM
To: Struts Users Mailing List
Subject: RE: Announce Struts E-Book for less than $10


Ahh yes ... it's Friday! :-)

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526


>-Original Message-
>From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
>Sent: Friday, April 05, 2002 7:28 AM
>To: 'Struts Users Mailing List'
>Subject: RE: Announce Struts E-Book for less than $10
>
>
>It sucks.
>
>Mark
>
>-Original Message-
>From: Jim Smith [mailto:[EMAIL PROTECTED]]
>Sent: Friday, April 05, 2002 7:18 AM
>To: [EMAIL PROTECTED]
>Subject: Re: Announce Struts E-Book for less than $10
>
>
>Hi,
>
>  The people reviewing "Struts Fast Track" on
>Amazon.com seem to dislike this book.  I won't quote
>examples of such comments as I'm not wanting to agree
>with the Amazon reviewers, but could someone please
>provide a "good" review?
>
>=
>JS
>
>__
>Do You Yahoo!?
>Yahoo! Tax Center - online filing with TurboTax
>http://taxes.yahoo.com/
>
>--
>To unsubscribe, e-mail:
>
>For additional commands, e-mail:
>
>
>--
>To unsubscribe, e-mail:   
>[EMAIL PROTECTED]>
>For 
>additional commands, 
>e-mail: 
>
>

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Preselecting an within a

2002-04-05 Thread Mattos, John

Hi All,

I have the following code in my JSP






I need to preselect one of the OPTIONS in the SELECT list.

The thing is, I can't set the values in the corresponding ActionForm object,
since this form submits to itself and the Select Boxes have to be
repopulated from the database

Is there any way to add "Selected" to the html:options tag?

Thanks

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE [2]: Form Question - Dynamic number of checkboxes - Multibox ?

2002-03-22 Thread Mattos, John

Okay, so now I have the following:


  

<%=sb.getProductName()%> 
 
 


 
   


and I have an int[] field on my bean called "assetId"

and it's telling me 

"You must specify the value attribute or nested tag content"

I thought that's what I was doing when I specified
value="<%=sb.getCheckBoxName()%>" in the multiBox.

the getcheckboxName, by the way, returns the assetId, so I hope to end
upwith an array of these things in the bean

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:42 AM
To: [EMAIL PROTECTED]
Subject: RE: Form Question - Dynamic number of checkboxes


Look at the multibox tag.  Add an attribute to your form called product (I
think it has to be an a String array) and when you read.  It will populate
the array with the product selected.

David



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:32 AM
To: Struts Users Mailing List
Subject: Re: Form Question - Dynamic number of checkboxes




why don't you use indexed=true on the checkboxes and it will create indexed
names for them.  Have to use nightly build or new 1.1 beta.

Cheers,
Dave




"Mattos, John" <[EMAIL PROTECTED]> on 03/22/2002
11:13:16 AM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Form Question - Dynamic number of checkboxes



Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
  
  




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

 No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


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








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

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

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




Form Question - Dynamic number of checkboxes

2002-03-22 Thread Mattos, John

Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
 
   




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN 

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Pre Populating Fields - bit of a newbie question

2002-03-05 Thread Mattos, John

Anyone?

Pre populating fields?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


-Original Message-
From: Mattos, John [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 11:19 AM
To: 'Struts Users Mailing List'
Subject: Pre Populating Fields - bit of a newbie question


Hi

I need to have a startDate and endDate field in my form, and I'd like to
prepopulate the endDate field with today's date. There's a bean that has
set/getEndDate() methods, and I get to the form from an Action.perform()
call

What's the best way to prepopulate that field?

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

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




Pre Populating Fields - bit of a newbie question

2002-03-05 Thread Mattos, John

Hi

I need to have a startDate and endDate field in my form, and I'd like to
prepopulate the endDate field with today's date. There's a bean that has
set/getEndDate() methods, and I get to the form from an Action.perform()
call

What's the best way to prepopulate that field?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Date Form Fields Question

2002-03-05 Thread Mattos, John

Hi all

I have a form that contains a StartDate and EndDate text fields, and I'm
wondering what the best way to deal with them is.

Should the Form Bean attribute be of type Date, or should I make it a
String, and just use DateFormat.parse(StartDate); to parse it in the
validate method?

Thoughts? Best practices?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




FW: how to use an images for submit, cancel button etc

2002-02-22 Thread Mattos, John

Hmm.

I'm actually a bit confused. I don't see any  tags in the code
snippet you provided, conly  and , which are
buttons.

Can you send a bit more of the JSP?

As far as the image submitting the form, I don't know of any other way
without using JavaScript (not that it doesn't exist, I'm just not aware of
it)

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: KM [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 3:33 PM
To: [EMAIL PROTECTED]
Subject: RE: how to use an images for submit, cancel button etc 


Thanks for the tip Mattos, However javascript is not
something the end client likes in this case, so trying
to minimise using javascript. Any clue as to why the
code I posted is not working?

Thanks for your time

KM
--- "Mattos, John" <[EMAIL PROTECTED]> wrote:
> Could you do the following...
> 
> 
>  src="../images/onion.gif"
> border="0"/>
> 
>  src="../images/onionCancel.gif"
> border="0"/>
> 
>  src="../images/onionReset.gif" border="0"/>
> 
> 
> 
> Reset and submit work fine, but you need to
> implement the cancel to do
> whatever you need it to do.
> 
> Is that overly simplistic?
> 
> John Mattos
> Sr. Developer and Architect
> iNDEMAND
> 345 Hudson St. 16th Floor
> New York, New York
> 10014
> 
> -Original Message-
> From: KM [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 22, 2002 10:27 AM
> To: Struts Users Mailing List
> Subject: how to use an images for submit, cancel
> button etc 
> 
> 
> Hi
> 
> I am trying to develop a page where the user has to
> select options from a drop down box and either
> clicks
> submit or cancel. The submit and cancel options are
> images instead of a button
> 
> Following is my code
> 
> 
> 
> 
>property="action"
>   scope="request" value="Create">
> 
>   
> 
>   
>property="action"
>   scope="request" value="Delete">
> 
>   
> 
>   
>property="action"
>   scope="request" value="Edit">
> 
>   
> 
>   
> 
> 
>property="action"
>  scope="request" value="Delete">
> 
>   
> 
>   
>    
>   
> 
>   
> 
>   
> 
> here instead of the save, reset, cancel buttons I
> would like to user save.gif, reset.gif, cancel.gif
> etc
> .How to set up struts to use this.. 
> 
> Any tips on how to do this is appreciated
> 
> KM
> 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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

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




RE: how to use an images for submit, cancel button etc

2002-02-22 Thread Mattos, John

Could you do the following...










Reset and submit work fine, but you need to implement the cancel to do
whatever you need it to do.

Is that overly simplistic?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: KM [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 10:27 AM
To: Struts Users Mailing List
Subject: how to use an images for submit, cancel button etc 


Hi

I am trying to develop a page where the user has to
select options from a drop down box and either clicks
submit or cancel. The submit and cancel options are
images instead of a button

Following is my code




  

  

  
  

  

  
  

  

  


  

  

  
   
  

  

  

here instead of the save, reset, cancel buttons I
would like to user save.gif, reset.gif, cancel.gif etc
.How to set up struts to use this.. 

Any tips on how to do this is appreciated

KM



__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Development Environment

2002-02-21 Thread Mattos, John

I'm using Visual Age For Java and Websphere Studio (for JSPs) on Win2k.

We're moving to Websphere Studio App Dev 4.0

I'd rather be using JBuilder 6

but that's me.

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



-Original Message-
From: Dave Wellman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 12:41 PM
To: [EMAIL PROTECTED]
Subject: Development Environment


Hello,

Quick question, what is the preferred development environment that you are
all using, Linux - Emacs, VIM,  Windows - JBuilder, VisualAge?


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:submit button

2002-02-21 Thread Mattos, John

Hi Konstantina,

I don;t know if you have a solution yet, but I have two separate ones for
you. The first is more struts oriented. If you have the following in your
JSP:














//you need to create 3 attributes in your "ActionForm" object that's being
populated when this form gets submitted, called 
// with associated getters and setters...
boolean btnProcess, btnViewOrg, btnViewProd;

// then in the Action.perform(), simply look at the variables to see which
one is true
boolean isProcess=false, isViewProd=false, isViewOrg=false;

// Get and cast a reference to the ActionForm object for use
MyActionForm theForm=(MyActionForm)form;
   
// What button was pushed
String process =
(theForm.getBtnProcess().equals(null)?"":theForm.getBtnProcess());
String viewOrg =
(theForm.getBtnViewOrg().equals(null)?"":theForm.getBtnViewOrg());
String viewProd =
(theForm.getBtnViewProd().equals(null)?"":theForm.getBtnViewProd());

The following code will also work

// Getting what button was pressed looping through parameters 
String button_pressed = null;
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String param = (String) e.nextElement();
if (param.startsWith("btn")) {
button_pressed = param;
break;
}
}
System.out.println("button_pressed="+button_pressed);

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 5:02 AM
To: Struts Users Mailing List
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page? 
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Displaying Test if is free of errors...

2002-02-19 Thread Mattos, John

Hi

In a jsp, I want to display some text if there are no errors present, that
is, that  hasn't been populated with any errors in my perform()
method.

What's the best way to do this?

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: HTML / Struts Help - addendum to summary.

2002-02-13 Thread Mattos, John

Did you try using 

Document.forms[0].testHidden.value instead? If that doesn't work, maybe you
could do it in a JavaScript function and then submit the form manually using
document.forms[0].submit (you'd have to make the submit button a regular
button that calls the method in the onclick)

You should be able to reference the .value of a hidden field from a
JavaScript function if nothing else.

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: Matt Koidin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 1:22 PM
To: Struts Users Mailing List
Subject: RE: HTML / Struts Help - addendum to summary.


I am trying to do something similar, except with an HTML link.

I have a hidden form field:


and then I try to set its value with an onclick function in my link:


Whenever I click the link, the testHidden field comes up as NULL. BUT,
when I use a regular submit button, it says the original "blah".

Any ideas what I am doing wrong?

-Original Message-
From: Mattos, John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 11:31 AM
To: 'Struts Users Mailing List'
Subject: RE: HTML / Struts Help - addendum to summary.


I like that solution.

I Think I'll alter my solution so that I'm doing it this way.
Originally, I
was concerned about getting back "Process Suspends" or some other
strange
string from 

String getBtnProcess() ( a method on the ActionForm class) within the
Action.perform() method, but then I realized I have access to the
message
resources, and that's where I'm getting that "Process Suspends" label
anyway, so why not just compare them.

I can therefore just do something like the following:

// Action.perform() snippet follows:
MessageResources application = actionServlet.getResources();
String thingToCompare =
application.getProperty(button.button.processSuspends);

I can then compare the results of getBtnProcess() with thingToCompare
and do
whatever I need to do.

Good catch, thanks

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014
-Original Message-
From: Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 11:17 AM
To: Struts Users Mailing List
Subject: RE: HTML / Struts Help


I think the design of struts is that you should have get/setters in your
form
beans for the button parameters rather than look at the request parms
directly.

in form bean 
boolean createButton;
public void setCreateButton(String createButtonParm) {
createButton = true;
}
public boolean isCreateButton() {
return createButton;
}

in form bean reset have 
   createButton = false;
==
Then in your action code you can test
if (formBean.isCreateButton()) 
==
hope that helps
K.
--- "Andres Marcel (KASO 211)" <[EMAIL PROTECTED]> wrote:
> Hi John
> 
> You can use the  tag and set the property to a value.
> Then in the action, you are able to find out, which button was presed
like
> this :
> 
> // find out if the create button was clicked
> Enumeration enum = request.getParameterNames();
> int clickedButton = 0;
> for(int idx = 0; enum.hasMoreElements() & clickedButton == 0; idx++) {
>   String paramName = (String)enum.nextElement();
>   if(paramName.startsWith("VALUE-OF-PROPERTY-NAME")) {
>   // what ever you want to do
>   }
> }
> 
> 
> Marcel
> 
> -Original Message-
> From: Mattos, John [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 4:12 PM
> To: '[EMAIL PROTECTED]'
> Subject: HTML / Struts Help
> 
> 
> Hi.
> 
> I have a form that can be submitted by three different buttons, for
example
> the buttons read
> 
> (Button Labels)
> Process
> View by Org
> View by Product
> 
> What I want to do is in the Action Class handling the submission, find
out
> which button was pressed, and act accordingly, whether it's an
actionForward
> (in the case of the "view" options) or kicking off another process (as
will
> be done by the "process" button)
> 
> So, how can I figure out what button was pressed in that Action class?
Is
> there a way to do that?
> 
> John Mattos
> Sr. Developer and Architect
> iNDEMAND
> 345 Hudson St. 16th Floor
> New York, New York
> 10014
> 
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 


=


__

changing Built in Validation Error Message

2002-02-13 Thread Mattos, John

I seem to have got it working, except that the error message reads...

VALIDATION ERROR
   you must check the following.

I see that it's getting it from errors.footer and errors.header in the
resource file. I'd like to override that behavior temporarily, and just
display the message

Is there some sort of Message service that I can use, analogous to the Error
service, or can I temporarily change the errors.header and errors.footer?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-----
From: Mattos, John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 1:09 PM
To: '[EMAIL PROTECTED]'
Subject: Passing Action Errors from one perform() method to another
perfor m() method - Expert help?


Hi all.

I'm trying to do the following.

In an Action.perform() method, I'm adding an ActionErrors object to the
request as follows

// Snippet from an Action.perform() method
ActionErrors errors = new ActionErrors ();
errors.add("Processed", new ActionError("Processing Done"));
saveErrors(request, errors);
return new ActionForward("/suspends.do");
// End of first perform() snippet

Notice that I'm forwarding to a ".do", which means I'm in another perform()
method

in the SECOND perform() method, I want to do some preprocessing (get stuff
from a database)
then forward to a JSP, and INLCUDE the actionErrors object from the first
perform() method.
Here's how I'm doing that now

// snipped from second perform() method, mapped to suspends.do
ActionErrors errors = new ActionErrors();
errors= (ActionErrors)request.getAttribute("Processed");
saveErrors (request, errors);

return new ActionForward("/invoicing/suspendsSummary.jsp");
// End of second perform() snippet

am I going about this in the wrong way? Is this even possible?

basically, I want to pass a message back to the jsp that is really a status
message (as in.. I'm done processing)

thoughts?
John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

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

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




Passing Action Errors from one perform() method to another perform() method - Expert help?

2002-02-13 Thread Mattos, John

Hi all.

I'm trying to do the following.

In an Action.perform() method, I'm adding an ActionErrors object to the
request as follows

// Snippet from an Action.perform() method
ActionErrors errors = new ActionErrors ();
errors.add("Processed", new ActionError("Processing Done"));
saveErrors(request, errors);
return new ActionForward("/suspends.do");
// End of first perform() snippet

Notice that I'm forwarding to a ".do", which means I'm in another perform()
method

in the SECOND perform() method, I want to do some preprocessing (get stuff
from a database)
then forward to a JSP, and INLCUDE the actionErrors object from the first
perform() method.
Here's how I'm doing that now

// snipped from second perform() method, mapped to suspends.do
ActionErrors errors = new ActionErrors();
errors= (ActionErrors)request.getAttribute("Processed");
saveErrors (request, errors);

return new ActionForward("/invoicing/suspendsSummary.jsp");
// End of second perform() snippet

am I going about this in the wrong way? Is this even possible?

basically, I want to pass a message back to the jsp that is really a status
message (as in.. I'm done processing)

thoughts?
John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: HTML / Struts Help - addendum to summary.

2002-02-13 Thread Mattos, John

I like that solution.

I Think I'll alter my solution so that I'm doing it this way. Originally, I
was concerned about getting back "Process Suspends" or some other strange
string from 

String getBtnProcess() ( a method on the ActionForm class) within the
Action.perform() method, but then I realized I have access to the message
resources, and that's where I'm getting that "Process Suspends" label
anyway, so why not just compare them.

I can therefore just do something like the following:

// Action.perform() snippet follows:
MessageResources application = actionServlet.getResources();
String thingToCompare =
application.getProperty(button.button.processSuspends);

I can then compare the results of getBtnProcess() with thingToCompare and do
whatever I need to do.

Good catch, thanks

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014
-Original Message-
From: Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 11:17 AM
To: Struts Users Mailing List
Subject: RE: HTML / Struts Help


I think the design of struts is that you should have get/setters in your
form
beans for the button parameters rather than look at the request parms
directly.

in form bean 
boolean createButton;
public void setCreateButton(String createButtonParm) {
createButton = true;
}
public boolean isCreateButton() {
return createButton;
}

in form bean reset have 
   createButton = false;
==
Then in your action code you can test
if (formBean.isCreateButton()) 
==
hope that helps
K.
--- "Andres Marcel (KASO 211)" <[EMAIL PROTECTED]> wrote:
> Hi John
> 
> You can use the  tag and set the property to a value.
> Then in the action, you are able to find out, which button was presed like
> this :
> 
> // find out if the create button was clicked
> Enumeration enum = request.getParameterNames();
> int clickedButton = 0;
> for(int idx = 0; enum.hasMoreElements() & clickedButton == 0; idx++) {
>   String paramName = (String)enum.nextElement();
>   if(paramName.startsWith("VALUE-OF-PROPERTY-NAME")) {
>       // what ever you want to do
>   }
> }
> 
> 
> Marcel
> 
> -Original Message-
> From: Mattos, John [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 4:12 PM
> To: '[EMAIL PROTECTED]'
> Subject: HTML / Struts Help
> 
> 
> Hi.
> 
> I have a form that can be submitted by three different buttons, for
example
> the buttons read
> 
> (Button Labels)
> Process
> View by Org
> View by Product
> 
> What I want to do is in the Action Class handling the submission, find out
> which button was pressed, and act accordingly, whether it's an
actionForward
> (in the case of the "view" options) or kicking off another process (as
will
> be done by the "process" button)
> 
> So, how can I figure out what button was pressed in that Action class? Is
> there a way to do that?
> 
> John Mattos
> Sr. Developer and Architect
> iNDEMAND
> 345 Hudson St. 16th Floor
> New York, New York
> 10014
> 
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 


=


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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

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




RE: HTML / Struts Help - Summary

2002-02-13 Thread Mattos, John

Jay

Thanks a lot. To summarize, here is my HTML













and in my Action Class, I have the following
   String button_pressed = null;
   Enumeration e = request.getParameterNames();
   while (e.hasMoreElements()) {
   String param = (String) e.nextElement();
   if (param.startsWith("btn")) {
button_pressed = param;
   break;
   }
}

Works like a champ

Thanks a lot.

the other thing I found out I could have done, was, based on the SAME HTML
SNIPPET I could have a property on the ActionFormClass called BtnProcess
(with getter and setter) and I could get its value as follows 

// in the Action Form.perform()
ViewProcessSuspendsForm myForm=(ViewProcessSuspendsForm)form;
System.out.println("From the Action Form, getProcess(), the value is
"+myForm.getBtnProcess());

// Note, the value I get from this corresponds to  from the HTML, which is the label on the
button loaded from the resource file. It happens to be "Process Suspends". I
like the first solution better.

Anyway, thanks for all the responses and help.

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014
-Original Message-
From: Jay sissom [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 10:25 AM
To: Struts Users Mailing List
Subject: Re: HTML / Struts Help


You would do it the way you'd do it an any web application.

Here's how I do it:  All my button field names start with "btn".  I would 
name these buttons btnProcess, btnViewByOrg and btnViewByProcess (or 
something similar).

In my perform method, I'd put code like this:

   String button_pressed = null;
   Enumeration e = request.getParameterNames();
   while ( e.hasMoreElements() ) {
  String param = (String)e.nextElement();
  if ( param.startsWith("btn") ) {
 button_pressed = param;
 break;
  }
   }

At this point, button_pressed tells you the name of the button that was 
pressed.  I have a utility class that has this code in it and I use it 
everywhere.

Jay

On Wed, 13 Feb 2002, Mattos, John wrote:

> Hi.
> 
> I have a form that can be submitted by three different buttons, for
example
> the buttons read
> 
> (Button Labels)
> Process
> View by Org
> View by Product
> 
> What I want to do is in the Action Class handling the submission, find out
> which button was pressed, and act accordingly, whether it's an
actionForward
> (in the case of the "view" options) or kicking off another process (as
will
> be done by the "process" button)
> 
> So, how can I figure out what button was pressed in that Action class? Is
> there a way to do that?
> 
> John Mattos
> Sr. Developer and Architect
> iNDEMAND
> 345 Hudson St. 16th Floor
> New York, New York
> 10014
> 
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 


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

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




RE: HTML / Struts Help

2002-02-13 Thread Mattos, John

Hey

I was thinking about that (I actually have a hidden field already called
"toDo" (still working on that name)) but the problem is that it has to
change based on which button is pressed.

I could use JavaScript to set the hidden field dynamically (I don't know if
this will work with struts, but I think I can do
document.forms[0].toDo.value="process" (or whatever) but I'd rather just
have the buttons submit then be able to sort out what was pressed in the
perform method



John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

(w) (646) 638-8391
(f) (800) 877-5301
(c) (917) 202-8450
(w) www.iNDEMAND.com

This e-mail contains privileged and/or confidential information intended for
the use of the addressee. If the reader of this e-mail is not the intended
recipient, you have received this e-mail in error and any review,
dissemination, distribution or copying is strictly prohibited. If you have
received this e-mail in error, please notify the sender immediately by
return e-mail and permanently delete the copy you received. Thank you. 


-Original Message-
From: Wijewickrema , Dina E. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 10:16 AM
To: 'Struts Users Mailing List'
Subject: RE: HTML / Struts Help


Just define a hidden field in your form. Then when you press a button define
an onclick event that sets the value of the hidden field.

For example:





-Original Message-
From: Mattos, John [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 10:12 AM
To: '[EMAIL PROTECTED]'
Subject: HTML / Struts Help


Hi.

I have a form that can be submitted by three different buttons, for example
the buttons read

(Button Labels)
Process
View by Org
View by Product

What I want to do is in the Action Class handling the submission, find out
which button was pressed, and act accordingly, whether it's an actionForward
(in the case of the "view" options) or kicking off another process (as will
be done by the "process" button)

So, how can I figure out what button was pressed in that Action class? Is
there a way to do that?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



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

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

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




HTML / Struts Help

2002-02-13 Thread Mattos, John

Hi.

I have a form that can be submitted by three different buttons, for example
the buttons read

(Button Labels)
Process
View by Org
View by Product

What I want to do is in the Action Class handling the submission, find out
which button was pressed, and act accordingly, whether it's an actionForward
(in the case of the "view" options) or kicking off another process (as will
be done by the "process" button)

So, how can I figure out what button was pressed in that Action class? Is
there a way to do that?

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: "if" tag

2002-02-12 Thread Mattos, John

Hey

I was actually going to use it to place an " " in a cell of a table if
a certain bean attribute didn't exist.

I've settled on using  instead, which is fine with me. 6 of
one.13 of another.

Is there a better way to do this that I'm missing?

John

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 12:54 PM
To: [EMAIL PROTECTED]
Subject: RE: "if" tag


How many pages do you need an If tag / scriplet for? Why not switch the
Action forward to choose the right page? Just have 2 pages with no Ifs.
Perhaps I'm being too simplistic.

On Tue, 12 February 2002, "Knoll, Zach" wrote:

> 
> I totally agree with you. The only issue/desire that I have is that
because
> scriplets can get easily out of hand by developers with little patience or
> time to learn tags, I would love it if we could enforce the JSP compiler
to
> only compile XML compliant JSP's thereby forcing the developer to not code
> with scriplets. Of-course the downside is that if we do this we will have
to
> use tags for everything including simple "if's" on the other hand though,
we
> will guarantee that the JSP's will not have 100's of lines of un-readable
> scriplets which outweighs the negatives by an exponential factor.
Therefore
> if my dream should ever come true we will need the "if" tag. 
> 
> -Original Message-
> From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 12:06 PM
> To: Struts Users Mailing List
> Subject: RE: "if" tag
> 
> 
> 
> How can
> 
> 
> 
> 
> 
>(or whatever)
> 
> be better.  It's just different, but not better, and scriptlets are evil
> when they go mad and get out of hand, they are not evil of themselves.
> 
> Jonathan
> 
> 
>  Message History
> 
> 
> 
> From: "Mattos, John" <[EMAIL PROTECTED]> on 12/02/2002 11:52 EST
> 
> Please respond to "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> 
> To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> cc:
> Subject:  RE: "if" tag
> 
> 
> Ya think?
> 
> Well, if that's true, forget it. I'll just use scriptlets, although I feel
> like we're mixing too much java that way.
> 
> John
> 
> -Original Message-
> From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 11:38 AM
> To: Struts Users Mailing List
> Subject: Re: "if" tag
> 
> 
> 
> If there are plans for an if then else tag can they please be dropped.
> 
> Scriptlets are far cleaner than inventing a tag which exactly mimics java.
> 
> Jonathan
> 
> 
> 
>  Message History
> 
> 
> 
> From: "Mattos, John" <[EMAIL PROTECTED]> on 12/02/2002 10:59 EST
> 
> Please respond to "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> 
> To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> cc:
> Subject:  "if" tag
> 
> 
> Hi all
> 
> Are there any plans in the next release of Struts to have a logic:if tag?
> 
> John
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
> 
> 
> 
> --
> To unsu

RE: "if" tag

2002-02-12 Thread Mattos, John

Ya think?

Well, if that's true, forget it. I'll just use scriptlets, although I feel
like we're mixing too much java that way.

John

-Original Message-
From: Jonathan Gibbons [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 11:38 AM
To: Struts Users Mailing List
Subject: Re: "if" tag



If there are plans for an if then else tag can they please be dropped.

Scriptlets are far cleaner than inventing a tag which exactly mimics java.

Jonathan



 Message History
--------


From: "Mattos, John" <[EMAIL PROTECTED]> on 12/02/2002 10:59 EST

Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>

To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
cc:
Subject:  "if" tag


Hi all

Are there any plans in the next release of Struts to have a logic:if tag?

John

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






--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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

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




"if" tag

2002-02-12 Thread Mattos, John

Hi all

Are there any plans in the next release of Struts to have a logic:if tag?

John

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Initializer Servlet?

2002-02-08 Thread Mattos, John

Also, make sure the number in the 2 tag
is lower than the Action Servlet so it loads first...

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: Thinh Doan [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 12:01 PM
To: Struts Users Mailing List
Subject: RE: Initializer servlet?


try:

   
 Initialization
 com.yourcompany.InitializationServlet
 2
   

Thinh

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 10:38 AM
To: 'Struts Users Mailing List'
Subject: RE: Initializer servlet?


Specify it in the  tag in web.xml (not sure about the exact
tag syntax).

Mark

-Original Message-
From: Mark Woon [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 9:21 AM

I've seen a few posts about initializer servlets that basically does
whatever setup/housekeeping work needs to be done for the application.
How do you guarantee that this servlet will run before anything
else?  Is this something you can define within your servlet container?
If so, does anyone know how you'd do this with Tomcat?

Thanks,
-Mark

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using JavaScript in the JSP Pages

2002-02-08 Thread Mattos, John

Satish,

Are you just using garden variety client side JavaScript for validation,
calling a method in the onSubmit of your  tag? If so..

return false;

in your JS method will prevent the form from being submitted. 

An alternative you might consider is to check out the Struts Validator
http://home.earthlink.net/~dwinterfeldt/ (or even just using the Form Bean's
validate() method for validation) so you're leveraging the power of Struts.

Hope it helps

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: Satish Jeejula [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 10:39 AM
To: '[EMAIL PROTECTED]'
Subject: Using JavaScript in the JSP Pages


Hello All,

I am using JavaScript to validate credit card number field in the JSP page.
Using  tag for the form in JSP page.

The form is getting submitted even though the credit card is not validated.
How I can prevent this from happening.

Thanks,
Satish 

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: