How use the BeanUtils and interface converts

2004-11-05 Thread Gabriel França Campolina
Hi,

I'd like know how I can use BeanUtils.copyProperties(form, model),
when I my objects have name equals but types noequals, example, in my
form I have a attribuite named "dateInsert" of type string, but in my
model I have this attribuite of the type java.util.Date. How I
specified to BeanUtils this type of conversion. I read some articles
in internet saw that I can implements a inteface converter, but i
don't know use. SomeBody can hope me, with link or example use this
classe???

Thanks folks,

----------
Gabriel França Campolina
Sun Certified Programmer for the Java 2 Plataform

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



Example about DynaForm extends other and referencing other DynaForm

2004-11-04 Thread Gabriel França Campolina
Hi,
SomeOne Know if I can do it? And How work with java.sql.Date in
DynaForm?Please post any example with action and struts config, I need
more this ???

-- 
--
Gabriel França Campolina
Sun Certified Programmer for the Java 2 Plataform

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



Re: Struts Best Practices

2004-11-04 Thread Gabriel França Campolina
Hi rajagopal,
When you use the DynaForm or DynaValidatorForm you create less code in
you system, and is more easy you

And i remember more one best pratice,

Use the LookUpDispachAction




On Thu, 4 Nov 2004 18:48:10 +0530, Y, Rajagopal
<[EMAIL PROTECTED]> wrote:
> Can any one let me know what's the advantage of using DynaForm rather than
> ActionForm or FormBean.
> 
> 
> 
> 
> -----Original Message-
> From: Gabriel França Campolina [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 04, 2004 6:47 PM
> To: Struts Users Mailing List
> Subject: Re: Struts Best Practices
> 
> I sugest some pratice:
> 
> Use plugin validador
> Extends TilesRequestProcessor
> Use DynaForm
> Use Tiles
> Use ExceptionHandler
> Use Designer Partnner
> 
> I think that this,
> 
> If any folk has more comments, please go shared.
> 
> Sory my english, I'm braziliam
> 
> Gabriel F Campolina
> SCJP
> 
> On Thu, 04 Nov 2004 11:05:56 +, Duncan Mills
> <[EMAIL PROTECTED]> wrote:
> > Ted Husted has a good set of  resources and hints
> > (http://www.husted.com/struts/)  though these may be too specific?
> > You should also check out the StrutsCatalog in the Wiki
> > (http://wiki.apache.org/struts/StrutsCatalog)
> >
> > Regards
> >
> > Duncan Mills
> > www.groundside.com/blog
> >
> >
> >
> >
> > Tushar Agrawal wrote:
> >
> > >Hi Folks,
> > >
> > >I am handling a web project and using struts framework. Can any one tell
> me where to find stuff on "Struts Best Practices"  or "Desgin and Coding
> Standards for a struts Application".
> > >
> > >I request to please share your experinces on "Struts Application Design
> Guidelines".
> > >
> > >Million Thanks in Advance
> > >
> > >Tushar Agrawal
> > >
> > >
> > >
> > >//
> > >   Tushar Agrawal
> > > Software Engineer
> > >  Seclore Technology Pvt Ltd.
> > >IIT Powai, Bombay (Mah)
> > > Cell : +919819804870
> > >   website:www.seclore.com
> > >/*/
> > >
> > >-
> > >Do you Yahoo!?
> > > Check out the new Yahoo! Front Page.  www.yahoo.com/a
> > >
> > >
> >
> > -
> > 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]
> 
> -
> 
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
--
Gabriel França Campolina
Sun Certified Programmer for the Java 2 Plataform

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



Re: Struts Best Practices

2004-11-04 Thread Gabriel França Campolina
I sugest some pratice:

Use plugin validador
Extends TilesRequestProcessor
Use DynaForm
Use Tiles
Use ExceptionHandler
Use Designer Partnner

I think that this,

If any folk has more comments, please go shared.

Sory my english, I'm braziliam

Gabriel F Campolina
SCJP




On Thu, 04 Nov 2004 11:05:56 +, Duncan Mills
<[EMAIL PROTECTED]> wrote:
> Ted Husted has a good set of  resources and hints
> (http://www.husted.com/struts/)  though these may be too specific?
> You should also check out the StrutsCatalog in the Wiki
> (http://wiki.apache.org/struts/StrutsCatalog)
> 
> Regards
> 
> Duncan Mills
> www.groundside.com/blog
> 
> 
> 
> 
> Tushar Agrawal wrote:
> 
> >Hi Folks,
> >
> >I am handling a web project and using struts framework. Can any one tell me where 
> >to find stuff on "Struts Best Practices"  or "Desgin and Coding Standards for a 
> >struts Application".
> >
> >I request to please share your experinces on "Struts Application Design Guidelines".
> >
> >Million Thanks in Advance
> >
> >Tushar Agrawal
> >
> >
> >
> >//
> >   Tushar Agrawal
> > Software Engineer
> >  Seclore Technology Pvt Ltd.
> >IIT Powai, Bombay (Mah)
> > Cell : +919819804870
> >   website:www.seclore.com
> >/*/
> >
> >-
> >Do you Yahoo!?
> > Check out the new Yahoo! Front Page.  www.yahoo.com/a
> >
> >
> 
> -
> 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]



How work DynaValidatorForm and java.sql.date and beanUtils.copyAttribuites?

2004-10-11 Thread Gabriel França Campolina
Hi folks,

I post in last week a topic iguals this, but i´m not sucess in my
aplication, but now i post my code to that all looks and find i
solution.
Well when I submit my form all values are send except the
java.sql.date, that send the value null, How i solutions this problem.

My struts-config:
.
.
.
  
  





.
  




.

My action ProdutoAction with a only metho named search:

public ActionForward search(
ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws BaseException{
 ActionErrors errors;
 ProdutoModel produtoModel = new ProdutoModel();
 DynaValidatorForm dynaForm = (DynaValidatorForm)form;
 errors = dynaForm.validate(mapping, request);
 if(errors.isEmpty()){
   try{
//copia os dados do Form para o Model
BeanUtils.copyProperties(produtoModel,dynaForm);

   }catch(Exception ex){
ex.printStackTrace();
//Envia o erro para o ExceptionHandler
throw new BaseException("errors.entity.produto", ex, new Object[]{ex});
   }
   return mapping.findForward(Constants.SUCESS);
   }else{
saveErrors(request,errors);
return mapping.findForward(Constants.ERROR);
  }
}   

My model ProdutoModel:

public class ProdutoModel{
private String nome;
private Date dataInclusao;
private String method;

public ProdutoModel(){
super();
nome = "";
method = "search";
}
//getters and setters..
}

I use to the validator, lookupdispacthAction and tiles in this application....
Thanks,.    
-- 
Gabriel França Campolina

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



Re: How work to DynaValidatorForm and java.sql.Date

2004-10-08 Thread Gabriel França Campolina
Hi Pedro,

I'd like know how i work to java.sql.Date, in my form bean I'm know
work to fields String , but in Specification of DynaValidator show
that DynaValidator support java.sql.date, but I have the problem show
in e-mail number one, Somebody help me

Thanks,



On Thu, 07 Oct 2004 21:18:46 +0100, Pedro Salgado <[EMAIL PROTECTED]> wrote:
> On 7/10/04 1:00 am, "Gabriel França Campolina" <[EMAIL PROTECTED]> wrote:
> 
> > Hi Folks,
> > I have the problem when i submit a field text that was mapping to
> > java.sql.date in format dd/MM/, I received null value, what´s my
> > problem?? only this value I don't received the other fields(String) i
> > receved correct.
> 
>  You should always use java.lang.String (or String[]) on your form-bean
> properties.
>  The validation part should be implemented on the form validate() method or
> on the validator or on the struts action itself (-).
> 
> Pedro
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Gabriel França Campolina
Tel: 9202-8320

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



How work to DynaValidatorForm and java.sql.Date

2004-10-06 Thread Gabriel França Campolina
Hi Folks,
I have the problem when i submit a field text that was mapping to
java.sql.date in format dd/MM/, I received null value, what´s my
problem?? only this value I don't received the other fields(String) i
receved correct.

Sorry my english I'm brasiliam

Thanks,
-- 
Gabriel França Campolina

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



Re: Inicialiazing a LookupDispachAction

2004-10-01 Thread Gabriel França Campolina
Hi Folks,

I'd like know more about this, if I don't set a value to variable
method, what method will call in my action???

ex in my url:

if I do:
 .../produto.do?method= //how call my methods to
lookupdispachaction(method=button.delete or method=delete)

   if I don't pass any value how method in my action is call


Thanks,

On Fri, 01 Oct 2004 08:44:47 -0700, Michael McGrady
<[EMAIL PROTECTED]> wrote:
> Hi, Gabriel,
> 
> In order to cover multiple images on submits, LookupDispatchAction does
> the following in order:
> 
>  1 Find the mapping attirbute parameter in order to find the value of
> the visual representation, e.g. "Delete It".  This requires, of course
> that this be the value of the name attribute, e.g., typically "method".
> 
>  2.  Creates a reverse map of all the keys in the application resource
> property file for the user's locale.  Imagine that!  This is then used
> to get the key in the property files for the value, e.g.,
> "button.delete", for "Delete It".  Honest!  More to do, however:
> 
>  3.  We then use the value of this key to determine from a map we have
> hard coded into our Action class what the method is, e.g.,
> "button.delete" is the key for "delete".
> 
>  4.  Calls the method, e.g. "delete" by reflection.
> 
> This requires that you coordinate the page, the struts-config.xml, the
> property file, a Map in your Action class and your methods in your
> Action class.  You sure you want to do all that as well as incur the
> need to have a reverse map to your properties file?  Check out
> 
> http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions
> 
> for a link to four simpler and lighter options.
> 
> Michael McGrady
> 
> 
> 
> 
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



-- 
Gabriel França Campolina
Tel: 9202-8320

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



How inicialized the DynaValidatorForm with a LookUpDispachAction

2004-10-01 Thread Gabriel França Campolina
Hi folks,

How inicialized the DynaValidatorForm with a LookUpDispachAction?can't?

-- 
Gabriel França Campolina
Tel: 9202-8320

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



Inicialiazing a LookupDispachAction

2004-10-01 Thread Gabriel França Campolina
Hi Folks,

I have a action-mapping that mapping a Action named ProdutoAction that
extends LookupDispachAction and have 3 methods into: start, delete,
save. I'd like inicialized my form  with values of my dataBase request
the method start. With ActionForm I can do, but I was used the
DynaValidatorForm and Validator. And When I request the url
.../produto.do?method=start, it validate my form and call the my input
attribute, How I call a method in LookupDispachAction without
validate?

Thanks,

Sorry Daniel, I don't more post my messages in portuguese

-- 
Gabriel França Campolina
Tel: 9202-8320

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



Re: Validator

2004-09-30 Thread Gabriel França Campolina
Olá Vinicius,

Poste o seu mapeamento de suas action no struts-config, e o mapeamento
dos seus form, para que eu possa analizar? Verifique o log gerado pelo
seu container web(Tomcat, JBoss etc), em geral eles listam a maioria
dos problemas da sua aplicação.

Gabriel F Campolina
Analista desenvolvedor Java
Stefanini IT Solutions - BH
 


On Thu, 30 Sep 2004 14:33:51 -0300, Vinicius Carvalho
<[EMAIL PROTECTED]> wrote:
> Hi there! I've been using Struts for quite sometime, but haven't used
> the validator yet.
> So I followed the receipt provided by Struts in Action, but got no
> success at all.
> 
> Here's what I've done
> 
> Struts-config is configured for the right plugin
> My ActionForm extends ValidatorForm and has no validate() method
> 
> Validator-rules.xml:
> 
>   classname="org.apache.struts.validator.FieldChecks"
>  method="validateRequired"
>methodParams="java.lang.Object,
>  org.apache.commons.validator.ValidatorAction,
>  org.apache.commons.validator.Field,
>  org.apache.struts.action.ActionMessages,
>  javax.servlet.http.HttpServletRequest"
> msg="validator.errors.required">
> 
>   
> 
> 
> 
> validation.xml:
> 
>   
> 
>   
>   
>  
> ApplicationResources.properties
> 
> validator.errors.required= O campo {0} é obrigatório
> prompt.nome=nome
> 
> And my jsp file looks like this:
> 
>  type="br.com.auge.errors.action.form.UserForm" onsubmit="return
> validateRequired(this)">
> Nome  />
> 
> 
> 
> Well, what is happening is that after I submit with no values at all,
> nothing happens, it forwards to the
> correct path. And also, the javascript generated isn't inside a
>  block. So it's printed
> on the page footer.
> 
> Where did I miss?
> 
> Thanks
> 
> Vinicius
> 
> -
> 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]



The best pratice to developer a login system

2004-09-30 Thread Gabriel França Campolina
Hi folks,

I never developed a login system,and I'm need developer this now with
autheticantion and perfis of the user, I'd like know if exists
anything developed or how created a system with secury in the Struts

Sorry my english, I´m Braziliam.

Thanks,


-- 
Gabriel França Campolina
Tel: 9202-8320

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



Re: The Original Web Page Cannot Be Found (HTTP 404) After Validation is Turned On

2004-09-29 Thread Gabriel França Campolina
Try put the /ContentMgmt.do




On Wed, 29 Sep 2004 12:00:31 -0700 (PDT), Caroline Jen
<[EMAIL PROTECTED]> wrote:
> I have action mapping in the struts-config.xml like
> this:
> 
>path="/ContentMgmt"   // the path for a link
>type="org.dhsinfo.content.SelectPage"
>scope="request"
>validate="false">
>   name="success"
>path=".frame.Content"/>
>
> 
> The .frame.Content is defined in the tiles-def.xml to
> display a drop-down menu based on the data obtained
> from the action servlet SelectPage.java.
> 
> This drop-down menu is included in the
> 'editTitleForm'.  The Submit button of the form has
> the following action mapping:
> 
>path="/content/UpdateTitle"
>type="org.dhsinfo.content.UpdateTitle"
>name="editTitleForm"
>scope="request"
>validate="true"
>input="/ContentMgmt">
>  name="success"
>   path=".title.Confirmation"/>
>
> 
> If there is no validation errors, successful execution
> of the UpdateTitle.java will give me the
> ".title.Confirmation" in the tiles definition.  If
> there are validation errors, I want to go back to the
> first action mapping (note that input="/ContentMgmt"
> ).
> 
> I intentionally made validation mistakes for testing
> purpose and click on the Submit button of the form.  I
> got Internet Explorer HTTP 404 - file not found:
> 
> The page you are looking for might have been removed,
> had its name changed, or is temporarily unavailable.
> 
> Please try the following:
> 
> If you typed the page address in the Address bar, make
> sure that it is spelled correctly.
> 
> Open the localhost:8080 home page, and then look for
> links to the information you want.
> Click the  Back button to try another link.
> Click  Search to look for information on the Internet.
> 
> What should I do to fix the problem?
> 
> __
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



-- 
Gabriel França Campolina
Tel: 9202-8320

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



How change the mainlayout of tiles on the fly

2004-09-29 Thread Gabriel França Campolina
Hi folks,
I'd like know How I change the mainlayout of tiles on the fly, Can I
do this?How???


.
.
.


.
.
.


 


.


Please helpme

-- 
Gabriel França Campolina

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



How copy the values of my DynaForm to my Bean

2004-09-28 Thread Gabriel França Campolina
Hi folks,

I'd like know how copy fields that not String, of my DynaForm to my
bean, I'm use the commos beanutils, but when this read one field the
type java.util.Date one exception is created...How i do?

Thanks,

-- 
Gabriel França Campolina
Tel: 9202-8320

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



How restrict the validation when I use the DynaForm

2004-09-28 Thread Gabriel França Campolina
Hi,
Sorry with my text, I don´nt speak and write english very well(I´m
brazilian), but I will try...

I'm using the DynaForm and I created 3 methods in my action: save,
delete and start, but only in  the fist method I need validation,  the
others I don't went to use, How I do?

Thanks,

-- 
Gabriel França Campolina

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



How I extends a DynaValidator

2004-09-24 Thread Gabriel França Campolina
Hi,
I have a problem, I'd like extends a DynaValidator but I  can't.
Look the form-beans in my struts-config.xml:
...
...
...

   
 
   

   
 
 
   


...
...
...

What is wrong?
When I start the tomcat this alert about: The attribuite extends
require a form-bean.

-- 
Gabriel França Campolina
Tel: 9202-8320

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