Extention of struts - BeanFactory

2001-06-02 Thread Oleg V Alexeev

Hello struts-user,

  I am glad to publish pre-alpha version of
  BeanFactory - extention of struts framework,
  intended to simplify processes of data publishing.
  
  Main idea of it - to move functionality to declarations.

  You can find short info about BeanFactory, sources, precompiled
  binaries and sample web allication (needs some configure in database
  access) at page -
   http://www.sura.ru/~gonza/bean-factory

-- 
Best regards,
 Oleg  mailto:[EMAIL PROTECTED]





Re[2]: Proposed feature: Bean property transformations

2001-06-02 Thread Oleg V Alexeev

Hello Ted,

Saturday, June 02, 2001, 1:30:00 AM, you wrote:

TH Harris, Andrew S wrote:
 A component would be able to hold a text value and a data value. The text
 value could hold the value entered by the user, prior to validation, then
 this could be played back to the user if validation failed on that
 component. If validation succeeded, the data value would be updated, then
 the text value would be replaced by the formatted value, using the data
 value and the formatter.

TH This is a good design pattern, and one we can use with Struts today. In
TH the ActionForm bean, define two properties, one for the text value and
TH one for the data value. If validation succeeds, convert the text value
TH to the data value, and (optionally) update the text value to match your
TH preferred formatting. 

TH Though, with a general conversion/transformation package, we would
TH really only need to store the desired data value since we could
TH transform it again later when the value was accessed for presentation,
TH perhaps via a bean:writeTransform tag.

What reason to store text values and data values in ActionForm? I
think that more flexible approach is to use ActionForm with text only
fields and data bean with native types, not String. In this case we
can name all corresponded fields in data bean with same names as for
ActionForm and use convert methods under it, for example, or use
another convert methods.
 We can convert text values to/from with one of the ways -
 1. Perform conversion of all fields in some method in ActionForm, for
example import/export.
 2. Make it in every setter/getter.
 3. Write special helper class to perform conversion - in this case
more flexible approach can be used - one helper can handle
multiple sources and targets.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Format on the JSP pages

2001-06-02 Thread Michael Mok

In addition to Craig's comment, if you decide to use the Jakarta Taglibs
project http://jakarta.apache.org/taglibs , you can this on your JSP page.

%@ taglib uri=http://jakarta.apache.org/taglibs/datetime-1.0; prefix=dt
%

  dt:format pattern=EEE MMM d, bean:write name=curForm
property=startDateTime//dt:format

In the above example my bean contain the following method

public long getStartDateTime() {
  //
  //  return the Calender.getTime() component;
};


Cheers

Michael Mok
www.webappcabaret.com/teatimej

- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Joyce Tang [EMAIL PROTECTED]
Sent: Saturday, June 02, 2001 12:29 PM
Subject: RE: Format on the JSP pages




 On Mon, 21 May 2001, Joyce Tang wrote:

   Sorry if I didn't make it clear.  What I am asking is how to format a
  embedded attibute?
 

 There isn't any particular support for formatting within the Struts tags
 at the moment.  However, there is a formatting library in the Jakarta
 Taglibs project http://jakarta.apache.org/taglibs that might help.

 Craig


  -Original Message-
  From: Joyce Tang
  To: '[EMAIL PROTECTED]'
  Sent: 5/21/01 2:13 PM
  Subject: Format on the JSP pages
 
  One property of my form is a customer object.
 
  So in the JSP page, I am displaying them as:
 
  bean:write name=Customer property=customer.dateOfBirth
  scope=request filter=true/
 
  How should I format it?
 
  Thanks
 
 





Re: Extention of struts - BeanFactory

2001-06-02 Thread Craig R. McClanahan



On Sat, 2 Jun 2001, Oleg V Alexeev wrote:

 Hello struts-user,
 
   I am glad to publish pre-alpha version of
   BeanFactory - extention of struts framework,
   intended to simplify processes of data publishing.
   
   Main idea of it - to move functionality to declarations.
 
   You can find short info about BeanFactory, sources, precompiled
   binaries and sample web allication (needs some configure in database
   access) at page -
http://www.sura.ru/~gonza/bean-factory
 
 -- 
 Best regards,
  Oleg  mailto:[EMAIL PROTECTED]
 
 
 

To keep things organized, can I ask a favor?  Can we have discussions of
1.1 feature design on the STRUTS-DEV list?  The STRUTS-USER list has lots
of traffic about using Struts already, and talking about the new stuff
here will be a little distracting.

Anyone, of course, is welcome to subscribe to STRUTS-DEV to participate in
(or just lurk on) the discussions of the new features.

Craig





struts:parameter tag

2001-06-02 Thread Bruno Antunes

Hi. In previous releases of struts we have the tag struts:parameter
name=paramName that will render a request parameter, encoding special
HTML characters.

We can do this without a tag with (i am ignoring null pointer exception)

%= ResponseUtils.filter( request.getParameter(paramName)) %

Is this tag being removed from 1.0?

--
Bruno Antunes,
Java Software Engineer

email: mailto:[EMAIL PROTECTED]
Phone: +351.21.7994200
Fax  : +351.21.7994242

WhatEverSoft - Java Center
Centro de Competencia Java
Praca de Alvalade, 6 - Piso 4
1700-036 Lisboa - Portugal
URL: http://www.whatevernet.com



_
  INTERNET MAIL FOOTER 
A presente mensagem pode conter informação considerada confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e por
gentileza informar o emissor de tal facto.
-
Privileged or confidential information may be contained in this
message. If you are not the addressee indicated in this message, you
may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply
email.
-




Re: struts:parameter tag

2001-06-02 Thread Craig R. McClanahan



On Sat, 2 Jun 2001, Bruno Antunes wrote:

 Hi. In previous releases of struts we have the tag struts:parameter
 name=paramName that will render a request parameter, encoding special
 HTML characters.
 
 We can do this without a tag with (i am ignoring null pointer exception)
 
 %= ResponseUtils.filter( request.getParameter(paramName)) %
 
 Is this tag being removed from 1.0?
 

It sounds like you are still using the Struts 0.5 tags (from TLD file
/WEB-INF/struts.tld).  You should be converting your programs to use the
1.0-compatible tag libraries (struts-bean.tld, struts-html.tld,
struts-logic.tld, and struts-template.tld).

The 1.0 approach to this requirement would be:

  bean:parameter id=bean name=paramName value=defaultvalue/
  bean:write name=bean/

Besides setting a default value (if the parameter is missing) as I did
above, you can also avoid null pointer exceptions by using logical
comparisons to detect the presence or absence of request parameters:

  logic:present parameter=paramName
... The parameter is present ...
  /logic:present

  logic:notPresent parameter=paramName
... The parameter is not present ...
  /logic:notPresent


 --
 Bruno Antunes,
 Java Software Engineer
 

Craig McClanahan





Re[2]: Extention of struts - BeanFactory

2001-06-02 Thread Oleg V Alexeev

Hello Craig,

Saturday, June 02, 2001, 7:41:43 PM, you wrote:

CRM To keep things organized, can I ask a favor?  Can we have discussions of
CRM 1.1 feature design on the STRUTS-DEV list?  The STRUTS-USER list has lots
CRM of traffic about using Struts already, and talking about the new stuff
CRM here will be a little distracting.

CRM Anyone, of course, is welcome to subscribe to STRUTS-DEV to participate in
CRM (or just lurk on) the discussions of the new features.

Yes, of course, Craig.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Client/Server Side Validation for Struts 1.1

2001-06-02 Thread David Winterfeldt

I'd like to get a discussion started on the
client/standard validations for Struts 1.1.  I thought
it would be good to talk about what basic features it
would include and implementation.  Here are the
descriptions from the To Do list for 1.1.

Standard Validations. 
Add the ability to configure standard validations on
particular properties to be enforced by the controller
servlet automatically. Where feasible, client-side
JavaScript validations may also be generated based on
the same configuration rules. 

Client Side Validation. 
Add the ability to automatically generate optional
JavaScript code to perform client-side validations for
things like required fields, numeric fields,
dates/times/timestamps, and so on. The required
validation should mesh with validation enhancements
provided in the controller servlet itself.

Nic Hobbs and I have both volunteered for the Standard
(Server Side) Validations and Ted Husted, Nic Hobbs,
Spencer Smith and I have volunteered for the Client
Validations (JavaScript).  Ted has been using a
validation framework I've done on a project (I'm not
sure what version).  It lets you define your
validation rules in an xml file.  It supports
internationalized rules for a form and
internationalized messages.  It has basic support for
creating JavaScript methods that can do what a server
side method does. The code, documentation, and example
webapps are posted here.  And of course Struts is
welcome to the source code if everyone thinks that
what I've done so far is good foundation to start on.
http://home.earthlink.net/~dwinterfeldt/

If any of the other volunteers have started something,
I'd like to see it and I'm sure everyone has ideas for
the design.  I'd go into more detail about everything
I've done, but it is probably easier for anyone
interested to go to my site and read the documentation
and javadocs posted there.

David Winterfeldt
http://home.earthlink.net/~dwinterfeldt/

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



Re: Problem in struts-example accessing ApplicationResources

2001-06-02 Thread Dan Miser



The only place that struts.jar should exist is in 
WEB-INF\lib.Don't put it in the CLASSPATH. Don't put it in TOMCAT\LIB. 
Don't modify BAT files to include it. Just deploy struts-example.war to 
TOMCAT\WEBAPPS and everything will be fine.
--
Dan Miser
http://www.distribucon.com

  - Original Message - 
  From: 
  MarNette Enterprises, Inc. 
  To: [EMAIL PROTECTED] 
  
  Sent: Saturday, June 02, 2001 10:12 
  PM
  Subject: Problem in struts-example 
  accessing ApplicationResources
  
  I am evaluating Struts as a development 
  environment and I am having trouble getting the struts example to run. 
  As I have found some other users are experiencing similar problems when 
  running the example application the following message appears:
  
  "javax.servlet.ServletException: Exception thrown 
  processing JSP page.
  javax.servlet.JspException: Missing message 
  for key index.title".
  


Struts 1.0-beta-3 Released

2001-06-02 Thread Craig R. McClanahan

Struts 1.0-beta-3 is a release candidate version of the Struts Framework,
likely to be the final beta prior to the Struts 1.0 Final Release, which
is currently scheduled for June 15, 2001.  Please help identify any
remaining bugs that need to be fixed prior to final release, and report
them to our bug tracking system at:

  http://nagoya.apache.org/bugzilla/

The binary distribution of Struts 1.0-beta-3 is available at:

  http://jakarta.apache.org/builds/jakarta-struts/release/v1.0-b3/

The source distribution of Struts 1.0-beta-3 is available at:

  http://jakarta.apache.org/builds/jakarta-struts/release/v1.0-b3/src/

Craig McClanahan





Credit card validation FYI

2001-06-02 Thread Jonathan Asbell



You all probably know about this but I thought I 
would send it anyway.

http://www.beachnet.com/~hstiles/cardtype.html

MOD-10 is an algorithm that is used by almost any 
credit card company togenerate / validate credit cards.How it 
works?First you have to know what kind of credit card you have.You can find 
itoutby looking at the first(leftmost) number of it.This is what 
itmeans:3= American Express4 = Visa5 = Mastercard 
etc.The algorithm goes as follows : go from right to left and multiply 
everysecond digit by 2.If the result of themultiplication is greater 
than 9 , subtract 9 from it.(ex. if 16 then 16 -9 = 7).Thenn add the result 
to the sum.All other numbers of the card don't need to be multiplied , just 
add themto the sum..When on the end (sum mod 10) = 0 ,the card is valid.In 
otherwords it means that the sum must be a multiple of 10 
(10,20,30).Example:5 4 2 4 1 8 0 0 2 6 7 6 9 0 0 
5---1+4+4+4+2+8+0+0+4+6+5+6+9+0+0+5 = 
58This card of course isn't valid because the sum (58) isn't a multiple 
of10.How to generate cards?Well if you want to generate 
cards , you first have to decide what type ofcards.If you would decide for a 
Mastercard, then the first number would bea constant of 5.Therefore we will 
have to go from left to right to generatecards.The sum will have a value of 
1 on the beginning (see example).Thengenerate random numbers up to the 15th 
digit.Like described above, multiplyevery second number and add all results 
together to a sum.Then calculatethe last number (checksum): if sum is a 
multiple of ten, then the 16thnumber (checksum digit) will be 0.Otherwise 
substract the sum from the nexthighest multiple of 10.In the example 
above we would say : 60 - 53 = 7.Therefore the last digit is7 and not 5.You 
could do that in pascal by saying : last_number:=10 - (summod 10) ;Now 
someone might say that he could generate as many cards as he wants andcould 
misuse them.But that's not the truth.Many online verificationservices will 
also check your user info and expiration date with your bank,which of course 
can't be generated by this program.I've however heardmyself that there are 
many small companies(XXX - sites,Online downloads)which still use only 
MOD-10 scripts for validation.