property name repetition in one form

2004-06-03 Thread Samuel Rochas
Hello,
I am using a form displaying properties from a bean. One property of
this bean is named aProperty.
The bean as another property which is a list of other beans (call it 
items), which one of the item has the property named aProperty too.

In my form, I want to know which user is shown, so I use the property 
aProperty of my bean. And I want to know which item of the items list is 
selected, with the help of the property aProperty of each item.

So in the form, I have the repetition of the property name aProperty.
How can I deal with that? Is there a way to handle that, for example 
giving a different name to the form controls than the property name they 
are representing?

Thanx in advance
Samuel
-
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]


property name mismatch / trouble

2004-05-31 Thread Samuel Rochas
Hello,
I am using a form displaying properties from a bean. One property of 
this bean is the unique id from db: id.
The bean as a property which is a list of other beans (call it items), 
which ones has the property of the unique id from db too: id.

In my form, I want to know which user is shown, so I use the property id 
of my bean. And I want to know which item of the items list is selected, 
 with the help of the id property of each item.

To avoid the mismath between the two id properties, I would like to tell 
the tags (html:hidden, html:text, etc) to use a different name for the 
field in the request, than the object property.
How can I do that?

Thanx in advance
Samuel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: only with bean?

2004-05-28 Thread Samuel Rochas
Hello Henrique,
Thanks for your answer.
Your solution suppose I maintain two lists of objects, one for the 
labels and one for the values.
Is it not possible to give a list of object, and to use the object 
properties for the value and for the label?

Samuel

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


only with bean?

2004-05-27 Thread Samuel Rochas
Hello there,
I am able to create a html select with struts when the collection to 
display in the options tag is a collection stored in the session or 
request and to use the selected value for my form. Fine.

But now I have a Form representing a bean. This form has an attribute of 
type ArrayList. I'd like the select/options tag to show me the content 
of the ArrayList for the actual Form property value. I want to use the 
form attribute and not create a collection to store in a scope.

My JSP looks like:





My form DataForm has the attributes identification, selectedItems and 
allItems.

But it is not working. Anybody a hint?
Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Server side validation

2004-05-17 Thread Samuel Rochas
Hello Nicholas,
Ok, thank you very much for the explanation, it makes the things a bit 
clearer and less magical to me.

I have two questions:
-Why making that difference once for all? I mean, why not just accept 
everything here (page, action, forward)?
-Where is a good and complete documentation with examples about 
config-struts.xml to find (except struts-config_1_1.dtd)?

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Server side validation

2004-05-14 Thread Samuel Rochas
Hello Geeta,
I've solved the problem, still don't really understand the reason.
I've defined a global forward for the input of my reluctant form, and 
now, in case of validation error, I am forwarded to the desired page, 
not to the blank one.

Thanks for you help.
Samuel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Server side validation

2004-05-14 Thread Samuel Rochas
Good Morning Geeta,

Geeta Ramani wrote:
Hmm.. Ok, look at the source code of the page you get.. anything there?


No so much, right?

I used to work, then I probably change _something_ 

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Server side validation

2004-05-13 Thread Samuel Rochas
Hello Geeta,

"login" must have been defined as a global-forward ..?
You are right, I am quite new here, I did no notice.

No reason. So just take it out..:)
Ok, it's gone.

But I still get an empty page when I make a validation error :-(

The validation code is going thru, maybe another hint?

Samuel

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


Re: forward request parameter

2004-05-13 Thread Samuel Rochas
Hello Geeta,

Thanks.

Geeta Ramani wrote:

You will have to put the data again in the request 
> scope in your second action..
It means I'll have to process it again, and put again in the request?
So a session variable may be more apropriate?
Samuel

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


Re: Server side validation

2004-05-13 Thread Samuel Rochas
Hello Geeta,

Thanks again for your answer.

Geeta Ramani wrote:
The "input" field is the path to the jsp where your form resides, something like: 

	input="/myDir/myForm.jsp"
If the page is under /web (root of the application), then a "/page.jsp" 
is ok?
Why in the login example there is only a input="login" without a page name?

..and you may want to check on the "scope=session" bit. 
> Are you using session scope?
For what? What should be in the session?
Samuel

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


forward request parameter

2004-05-13 Thread Samuel Rochas
Hello,

I am using an Action which puts some data in the request scope. That's
just fine to display the data in the next jsp page (let's
call it target.jsp).
I am submiting a form in target.jsp which should do some action an show
again the target.jsp page.
When I show again the target.jsp page, the data are not shown. How can I
do to show again my data without using a session variable?
Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -




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


Server side validation

2004-05-13 Thread Samuel Rochas
Hello,

I am trying to use server side validation. I validate my form data in 
the validate method of the form. When there is a validation error the 
application shows me a blank page, and not the form again.

I guess I have an error in the action mapping configuration in 
struts-config, I am not sure about the use of the "input" field.


  

My form validation works fine with the login (from the struts example) 
but I can't see what is the difference between both form configuration.

Can anybody help?

Thanks
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


reuse of request parameter in application flow

2004-05-12 Thread Samuel Rochas
Hello,

I am using an Action which puts some data in the request scope. That's 
just fine to display the data in the (exactly one) next jsp page (let's 
call it target.jsp).

I am submiting a form in target.jsp which should do some action an show 
again the target.jsp page.

How can I tell my page / app to use the data of the prior request to 
resend the page? Can I resend the request info from the page to the server?
Or should I use a session scope variable, or reexecute the prior action 
instead?

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


html:select and html::iterate

2004-05-10 Thread Samuel Rochas
Hello,

I have a JSP page with a  element. According to the user 
selection, a bean is filled with apropiate data, and should be displayed 
in a jps page.

My jsp page looks like:












...
When I select an entry from the select and press the button, the action 
is called and I can update my entries collection. But when I forward to 
the success page, the combo still have the original value, and the list 
is not updated.

Has any body a hint or some sample code?

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Handle dynamic form (form/iterate)

2004-05-06 Thread Samuel Rochas
Hello,

My app has a form which content is generated dynamicly with the help of 
an iterate tag.

The form displayed is fine, the fields in the repeated lines have all 
the same name, which is correct and easy to handle with servlet.

How can I handle this fields in my xForm / xAction classes? How do I 
have to declare the attributes? How do I have access to them?

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: button as link

2004-05-04 Thread Samuel Rochas
Hi Hubert,

Hubert Rabago wrote:

You can use an empty dyna form:
Great, that is doing the job.

I was afraid I needed to create the corresponding class too, but
since the declaration is needed only in the struts-config.xml, that's fine.
Thanks a lot.
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


button as link

2004-05-04 Thread Samuel Rochas
Hello,

I would like to use a button as a link.

I used to solve that, before struts, with a form containing only a button.

With struts, it seems I have to declare a form object in the 
struts-config.xml, create a class for that empty form, etc.

Is there a simple way to solve that?

Sincerly
Samuel Rochas
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Database access in contextInitialized

2004-05-02 Thread Samuel Rochas
Hello Craig,

Indeed, the recommended pattern today is for you to acquire your 
DataSource instances from the JNDI naming context
Thanks for your advise. I was the way I handled it before using struts, 
so I will continue that way.

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[SOLVED] Re: Multiple action for one (1) form

2004-04-30 Thread Samuel Rochas
Hello there,

The problem using multiple actions for one form is solved :-)

I followed exactly the instructions in the API reference for the class 
org.apache.struts.actions.LookupDispatchAction (like explained in the 
newbie faq), and everything is fine.

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[SOLVED] Re: Action mapping mismatch

2004-04-30 Thread Samuel Rochas
Hello,

I had an error in my jsp page, there still was a lost  tag before 
my  tag.

Samuel

---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Drop down population question

2004-04-30 Thread Samuel Rochas
Hello Abhi,

I am sorry, which one is the storeToBean and storeToProperty with 
reference to my example?
I can't say, cause your example show me only the code in the JSP.

Think about where do you want to store the object selected in your 
option. I assume it is in a bean in which you'll store the content of 
your form. In my example, the bean where you store the result is the 
storeToBean.
For each field in your form, you will store the result in a property 
(attribute) of your bean class. The storeToProperty indicates in which 
field of your bean you'll store the result.

If you don't have this bean class yet, you should create it.

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:img define src dynamicly

2004-04-30 Thread Samuel Rochas
Hello there,

I'vesolved it like this, using the bean tag inside the html src tag:



Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Drop down population question

2004-04-30 Thread Samuel Rochas
Hello Abhi,

 request.setAttribute("lstCountry", v)
So the bean with you list is "lstCountry".

JSP:



Explanation:
-storeTo is the bean where to store the result
-storeToProperty is the property of the bean storeTo where to store the 
result
-lstCountry: your bean with the collection of beans
-id: the property of the bean contained in you collection that you use 
for the "value" part of the option (the value returned to 
storeToProperty when you select an option)
-name: the property of the bean contained in you collection that you use 
for the content shown to the users of you site

Sincerly
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Action mapping mismatch

2004-04-30 Thread Samuel Rochas
Hello there,

The link:
http://project:8080/start.do
shows me the page configured in struts-config.xml:

This form contains a  tag which looks like that in the
generated html page:

If I press the submit button, the page shown is:
http://project:8080/start.do?category=4 ...
and not, like I would expect:
http://project:8080/myAction.do?category=4 ...
Why am I not directed to the new defined action "myAction.do" like the
form says?
Why the URL stays with the original "start.do" action from the page
where I am, and which is not defined anywhere in my form?
Any hint?
Thanx in advance
Samuel
---  andinasoft SA - Software y Consulting  ---
Mariano Aguilera 276 y Almagro - Quito, Ecuador
Tel. +593 2 290 55 18  Cel. +593 9 946 4046
-  http://www.andinasoft.com  -


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