• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem Struts : get checked multibox (Session/form/request)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys.
I've got a serious problem for 3 days. I can't get the right value of the multibox and the rigth bean, whatever I store my bean in scope session or request or as an attribut of my form.

Here is the code I use :

In the InitAction class before the jsp page listing all the parameter values' of the bean userVO

/*INITACTION JAVA*/


/*INITACTION JAVA*/

Here is the code used in my jsp :
/*JSP*/


And in the identityUser_inc.jsp :


/*JSP*/

Here is my struts-config code :
/*STRUTS CONFIG*/


/*STRUTS CONFIG*/

Finally, here is my UpdateUserAction class :

/*UPDATE ACTION*/


/*UPDATE ACTION*/

I tried every solutions and search dor hours on the web, I'm really desperate now , so any idea would be appreciated.


Regards,

Apocys.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happens if you put the form input elements directly in the parent JSP rather than splitting it off into a separate file?
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Do you have the proper getters and setters in your Form bean that will pick
up the multibox values?
 
y Isola
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, in my FormSelectionUser formBean I have :


And I have the same in my UserVO bean, a getter and a setter, for the attribute groups (etc...)

Then, I try to pick up the attribute groups of my UserVO bean, but I can't access UserVO because it's not visible in scope request or in the form.

In fact, my question is, Is it possible to set a bean in scope session or in a form, access a String[] attribut of that bean into a jsp page to "multibox it" and on submit get the bean back with those modifications ?

How can I do that ?

Thanks for the reply

to David Newton : Unfortunately, I must split my file off

Regards,

Apocys.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

y Isola wrote:to David Newton : Unfortunately, I must split my file off


That's not really my question: I'm asking what happens if you don't, and I'm asking for a reason.
 
Gian Franco
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

y Isola wrote:In fact, my question is, Is it possible to set a bean in scope session or in a form,
access a String[] attribute of that bean into a jsp page to "multibox it" and on submit get the bean
back with those modifications?



Putting a bean in the scope session is possible, but I don't think your changes on the multi-boxed
items will be reflected automatically in the same bean.

When you need to read the multibox there are some other things that need to be put in place,
one of them is the String array of selected items that is returned from the jsp...

This is what you would be likely to see in the action form bean.



In the action bean you process the selectedUsers array.

Additionally, when you are displaying the values in the jsp it is
handy to use the org.apache.struts.util.LabelValueBean, for
example like this (in the Action bean)



I hope this helps you out...
 
y Isola
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gian Franco and David Newton,

Sorry for the delay in my reply, I'll try to do as you said today

Thanks a lot
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic