Why i have to specify the parameters (property and name) in both tags?

Recently i learned how to populate a html:select with data from a DB table with a int value and a String value (value and label of an option). For that i create a business object that represent one pair value&label (i called categoryBO) and another business object that contains a list of the business objects categoryBO. So in my JSP i have the next code:
<html:select name="lista" property="listaPropiedades">
<html:optionsCollection name="lista" property="listaPropiedades" value="varValor" label="varLabel" />
</html:select> Well i understand the next: name is the name of the business object that contains the list with the objects that represents the options in the select tag; property is the name of the list object, in the business object i need to have the getters and setters for that list; then value is the name of the variable that contains the data that will be the value of each option and label is the name of the variable that contains the data that will be the value of each label.
But i have the next questions:
1. Why i have to establish the parameters property and name for bot html:select and html:optionsCollection? Why not only in html:select or only html:optionsCollection?
2. In the ActionForm for my JSP i don�t know what data type have to use to declare the variable that's linked with the option or with the select. I'm using Object for now.
3. Why the only way to populate the html:optionsCollection in the Action is passing the object in the request object as an atribute in the next way:
request.setAttribute("lista", objectThatContainsList);instead
((ActionForm)form).setListaPropiedades(objectThatContainsList);why's that? I have the same question when i'm populatina a normal html table using a logic:iterate tag or using a display:table tag from displaytag library.

Ok, you have one big misconception here - you're using the same name/property for both the select component and its contents.
The html:select should refer you to ONE selected value (in this case an int). It should tie to a field on your action form.
The html:optionsCollection should refer to a list of beans used to populate this select component.
<html:select property="selectedItem">
<html:optionsCollection name="myList" property="listOfProperties" value="varValor" label="varLabel" />
</html:select>
1. Why i have to establish the parameters property and name for bot html:select and html:optionsCollection? Why not only in html:select or only html:optionsCollection?Because they actually refer to two different things, and should be two different values.
html:options gets the list of possible values
html:select stores the "selected" option. (consider what you would have if you just used a standard html:input here, and typed the id directly in - THATS the property to bind to)
2. In the ActionForm for my JSP i don�t know what data type have to use to declare the variable that's linked with the option or with the select. I'm using Object for now.You do now - because it is declared/mapped seperately
3. Why the only way to populate the html:optionsCollection in the Action is passing the object in the request object as an atribute in the next way:Its not.
The way you mentioned is also valid. If both the "selectedItem" and "listOfItems" are properties on your action form, you can leave out the "name" attribute, and they will be found there.
However if you are dealing with request scoped beans, you will have to populate the list on each access of the page - you will need a "load" action to poupulate the bean with the items for the dropdown, and make sure that it is always populated when you return to it (eg on an error condition).
That is why setting it as an attribute is sometimes preferable.
Cheers,
evnafets

Similar Messages

  • Create a tablespace without specifying the datafile path and name

    HI,
    Is it possible to create a tablespace without specifying the datafile path and name.
    For eg : if we just specify the tablespace name and the size of the datafile, the datafile should be created in a default location with default name? Is it possible?

    user13364377 wrote:
    HI,
    Is it possible to create a tablespace without specifying the datafile path and name.
    For eg : if we just specify the tablespace name and the size of the datafile, the datafile should be created in a default location with default name? Is it possible?Using Oracle-Managed Files
    Oracle internally uses standard file system interfaces to create and delete files as needed for the following database structures:
    * Tablespaces
    * Online redo log files
    * Control files
    Through initialization parameters, you specify the file system directory to be used for a particular type of file.
    EXAMPLE:
    The following parameter settings are included in the initialization parameter file:
    DB_CREATE_FILE_DEST = '/u01/oradata/sample'
    DB_CREATE_ONLINE_LOG_DEST_1 = '/u02/oradata/sample'
    DB_CREATE_ONLINE_LOG_DEST_2 = '/u03/oradata/sample'
    The following statement is issued at the SQL prompt:
    SQL> CREATE DATABASE sample;
    SQL> CREATE TABLESPACE tbs_2 DATAFILE SIZE 400M ;
    SQL> CREATE UNDO TABLESPACE undotbs_1;
    refer the link for more information:
    http://download.oracle.com/docs/cd/B10500_01/server.920/a96521/omf.htm

  • HT204053 why are not all my songs I have purchased in the itunes store and are on my computer not on my phone?

    why are not all my songs I have purchased in the itunes store and are on my computer not on my phone?  Very frustrating I purchaed almosta $100 worth of songs for a trip and they are not on my phone after continuious syncs.  Do I have to pay for itunes match for this?

    Welcome to the Apple Community.
    Have you actually selected them to be synced to your device from the iTunes sync settings.

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • Printing.  My prints are not printing at the proper size.  If I designate 5x7 it prints at something around 4x3.  I have set all the parameters.

    My prints are not printing at the proper size.  If I designate 5x7 it prints at something around 4x3.  I have set all the parameters.

    When you saye a you have set all the parameters, does that include the cell size in the print module? Are you printing on 5 x 7 paper? And, if you are, have you set that paper size in the page setup?

  • Why i have to delete the Current word Text if i type wrong Previous word text in the sentence, my fingers are broad cannot accurately point the specific character, I am forced to delete current word text, its really making my mind to get rid of  iPhone4.

    Why i have to delete the Current word Text if i type wrong Previousword text in the sentence, my fingers are broad cannot accurately point thespecific character, I am forced to delete current word text, its really makingmy mind to get rid of  iPhone4.

    Hold your finger on the word for a little time - after a second or so, a magnifying view appears showing the few letters around your finger, with a cursor. Roll your finger to move the cursor to just in front of the letter you want to fix. Then let your finger go. You can now backspace to delete and replace the incorrect letter.

  • I have three chargers(the newer kind) and all three of them have major shorts in them. They have to be in a specific postition for them to charge! Why is this? Are all of them having problems?!?!

    I have three chargers(the newer kind) and all three of them have major shorts in them. They have to be in a specific postition for them to charge! Why is this? Are all of them having problems?!?! This is just RIDICULOUS!!!

    I have a charger for the iPhone 5 that has absolutely no problems.  I got my iPhone 5 the day they were first sold almost a year ago.  Also in my family are 2 iPads and 2 iPad mini's all with the new lightning cables and none have had problems. 
    If you have problems and they're legitimate Apple products, bring them back for replacement.

  • Why can't i access my itunes anymore? whenever i click on it, it makes my laptop freeze/slow down to the point where not even ctrl alt delete works properly and i have to turn the laptop off and then back on to get anything done.

    why can't i access my itunes anymore? whenever i click on it, it makes my laptop freeze/slow down to the point where not even ctrl alt delete works properly and i have to turn the laptop off and then back on to get anything done. it has been this way for the last 2/3 days now and i have uninstalled and reinstalled it but it doesnt work

    Hello there, bobbiefromIRL.
    The following Knowledge Base article goes over some great steps for troubleshooting your issue:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I have subscribed to the student package and I also received a confirmation SMS saying that the amount has been deducted. But when I sign in through creative cloud, it shows that I am still running on a trial version. Why is that?

    I have subscribed to the student package and I also received a confirmation SMS saying that the amount has been deducted. But when I sign in through creative cloud, it shows that I am still running on a trial version. Why is that?

    Sign in, activation, or connection errors | CS5.5 and later, Acrobat DC
    Mylenium

  • Specify the parameters of weighting function test

    HI:
    We do a RFX, enter a custom question: TEST,
    Maintaining weight,
    error: Specify the parameters of weighting function test.
    Sarah

    Can you share the solution?
    Regards,
    Nikhil

  • I'm relatively new to Mac and want to try and get the most out of the new MacBook Air.   My wife and I have been sharing the same Apple ID. We both have iPhones - she has a 5 and I've got a 4S.   We only have one copy of iTunes and we have been sharing t

    I'm relatively new to Mac and want to try and get the most out of the new MacBook Air.
    My wife and I have been sharing the same Apple ID. We both have iPhones - she has a 5 and I've got a 4S.
    We only have one copy of iTunes and we have been sharing the account. (She doesn't really use the computer for anything beyond writing the odd weekend assignment.)
    Would I be better off setting her up with her own and making her as a separate user on the computer? Would this require much work?
    In recent times with updates, we have a few problems with the duplication of texts and that sort of thing. Both of our texts are stored on the computer and that sort of thing. Also, sometimes texts I send her are sent through to me  from her, if that makes any sense.
    Anyway, I don't really want to overly complicate matters when it comes to accounts etc, but I wanted to know if a fresh Apple ID would be the best thing or even a new user?
    Any tips etc would be greatly appreciated
    Thanks in advance
    MacBook
    I have this question too (0) Reply

    Your question is almost too much a personal one, begging the question "do we (husband and wife) feel comfy sharing one account on the Mac"   maybe thats why nobody answered you.
    It doesnt complicate anything, but it adds steps for switching accounts on the Mac/ purchases etc. of course
    since your question is mostly personal, ..I wont answer THAT part of it, but creating a new account is easy.....messing with switching back and forth is also a personal preference 'issue' as well.   I prefer to keep things simple, but...........you and yours,  I dont know.......
    http://support.apple.com/kb/PH11468

  • I updated my 4s to IOS 8 and now it won't automatically connect with my Ford SYNC.  I have to turn the phone off and then on again for it to connect.

    I updated my 4s to IOS 8 and now it won't automatically connect with my Ford SYNC.  I have to turn the phone off and then on again for it to connect.
    Why is this?  My husband's 4s is still on IOS7 and it still connects automatically.

    I do not know if this will help.
    For a limited time Apple will allow you to downgrade to 7.1.2.  Hurry do not wait.
    See brownox second post here:
    Are there known problems with hdmi screen display and iOS 8?
    and
    http://www.gottabemobile.com/2014/09/17/downgrade-ios-8-to-ios-7/

  • HT1338 Dear  MAC-Friends.  PLEASE HELP ME.  I am extremely afraid to do something wrong - what will be a failure so I loose all the photos I had in my iphoto library before installing the Mountain Lion.  I have just installed the MOUNTAIN-LION and now I c

    Dear  MAC-Friends.
    PLEASE HELP ME.
    I am extremely afraid to do something wrong - what will be a failure so I loose all the photos I had in my iphoto library before installing the Mountain Lion.
    I have just installed the MOUNTAIN-LION and now I can´t use my Iphoto-programme without answering the following question:
    Choose another Library ?  ( But I only want the choose the photos which one was in the old iPhoto-Library and not the other photos on the MAC-computer ? ).
    and the other possibility is:
    Create a new Libray ! Which iPhoto-library  ?
    And why create a new and to risq to loose the old photos.
    PLEASE HELP ME.
    Kind regards  FINN GRABOWSKI

    Ok. Let me first ask you, do you have any backups of your files - for example, do you use Time Machine or any other backup system?
    Next, quit iPhoto. In the Finder, go to your Pictures folder. Is there a file there called iPhoto.Library? How large is it? (If it doesn't show the size, click once on it, click cmd-I to see the information). If it's a healthy size (ie, several GB), then that should be your library, and you can double-click it to launch iPhoto. (The application will remember where your library is next time, you can just launch iPhoto normally).
    If that's not the right file, check your Trash. Is there anything in there?
    Matt

  • Why we have setup tables in LO extraction and why not in CO-PA,Generic

    Hi Friends
                   Why we have setup tables in LO extraction and why not in CO-PA,Generic
    Please give me reply
                                       ****************Points are assured********************
    Thanks&Regards
    Revathi

    Hi Revathi,
    Please check the following Threads :
    [why set up tables ?;
    [Why LO only having Setup tables not Others.......?;
    Regards
    Hemant Khemani

  • I have two accounts to my computer as administrator. How can I make it so both accounts have access to the same folders and programs? grateful for answers. Martin

    I have two accounts to my computer as administrator. How can I make it so both accounts have access to the same folders and programs? grateful for answers. Martin

    Obvious question: If you want to have access to the same folders andapplications, why have two accounts? The point of different accounts is that you don't have access to the other person's data.
    Any application in the HD/Applications folder is available in all accounts.
    Sharing data between accounts depends on the material being shared. So, if you can provide more details we maybe able to help you better.
    Regards
    TD

Maybe you are looking for

  • Can't open animated GIF, even with secret trick (psd cs3)

    Hi I know a lot of people have had trouble with opening animated .gifs in photoshop cs3. I had that problem until I learned the little "trick" you could do (type *.* in "import video frames to layers") and then simply open the gif. This has worked on

  • Output to DVD - NTSC Size Challenge

    We have put together our first slideshow. Everything worked great except for the slide titles/captions. When preview on the PC everything looked fine. When viewed on the TV, the titles/captions were cut off in the horizontal. How can I correct this?

  • ERROR IN VENMDOR MASTER CREATION??

    Hii experts In IDES i have configuration for vendor master , and i have created reconciliation account for vendor also. While creating vendor master after entering all details at last its throwing error like the account 4 is already exists???? How we

  • IPhone Death Grip and Loss of Signal

    There is NO doubt the new iPhone has "death grip" "loss of signal" issues. Including my new iPhone, there are 4 Verizon phones in my home. All 4 phones show 3 bars when laying on the counter. The iPhone consistently, everytime, drops to 1 bar when it

  • Scheduling dates In Orders.

    Dear SAP Gurus, I have maintenance plan in which in scheduling parameter I  gave late completion Tolerance as 10% and early completion tolerance as 10%.Call Horizon is 90% and Scheduling period is 12 Months.The maintenances plan will be scheduled and