What is different?  setProperty works, c:set does not ???

I have a class that I am instantiating twice (separate instances... i.e. using different scopes) in a jsp page. In the second instance I tried to set three properties using c:set, target, and property. It gave me an error saying the last property did not have a setter method... but it does. So then I tried using 'setProperty' instead, and it worked fine. Can someone take a look and tell me what the difference is?
This worked fine:
<jsp:useBean id="arrayOfArticles" scope="session" class="com.mystuff.blogger.beans.GetArticleBean">
<jsp:setProperty name="arrayOfArticles" property="upperBound" value="0" />
<jsp:setProperty name="arrayOfArticles" property="range" value="10" />
<jsp:setProperty name="arrayOfArticles" property="articleArray" />
</jsp:useBean>
For some reason this did not work:
<jsp:useBean id="arrayOfArticles" scope="session" class="com.mystuff.blogger.beans.GetArticleBean" />
<c:set target="${arrayOfArticles}" property="upperBound" value="0" />
<c:set target="${arrayOfArticles}" property="range" value="10" />
<c:set target="${arrayOfArticles}" property="articleArray" />
It kept giving an error like this (from Tomcat 5.0.19):
javax.servlet.ServletException: No setter method in <set> for property "articleArray"
Thanks,
BillR

a c:set represents a Set Collection I think?Nope. It is JSTL tag used fro setting properties and variables
So it doesn't "set" something, it represents a set of
values. See J2SE 1.4 API on Collection,Set, HashSet,
TreeSet, ...Generally his use is correct.
<c:set target="${arrayOfArticles} property="articleArray" value="someValue"/>
But he has to make sure
1) the arrayOfArticles bean has a method called setArticleArray(...)
2) that the method takes a parameter of some type
3) that there is a value provided that can be converted to the same type needed by the set method
canucklehead, I know I answered in your other thread, but another idea would be to create a 'dummy' value in the setArticleArray method. Sorta like this:
//doit is a dummy boolean, used just to get this method called
public void setArticleArray(boolean doit) {
  this.articleArray = new ReturnArticle().getRangeOfArticles(upperBound, range);
} Then you could use it in JSTL like this:
<jsp:useBean id="arrayOfArticles" scope="session" class="com.mystuff.blogger.beans.GetArticleBean" />
<c:set target="${arrayOfArticles}" property="upperBound" value="0" />
<c:set target="${arrayOfArticles}" property="range" value="10" />
<c:set target="${arrayOfArticles}" property="articleArray" value="true"/>

Similar Messages

  • I would like to use my work exchange email on my macbook pro.  But I cannot insult it.  I have not problem as on my iPhone or iPad.  My work IT person does not know what is wrong.

    I would like to use my work exchange email on my macbook pro.  But I cannot install it.  I have no problem my work email on my iPhone or iPad.  My work IT person does not know what is wrong.  Why I try to set up the email I get the message that it cannot connect to this server. 

    Try going into System Prefereces then Mail, Cintacts & Calendars then click on the Microsoft Exchange link on the right. Type in your email address and password and allow it to set it up automatically.
    Make sure your Mac is updated to the newest version of Mail.
    If that still fails then I suggest you switch email clients. I don't care for the built in mail program. IMHO it is very buggy.

  • I do not know what happened, all of a sudden Firefox does not want to work anymore. Had been conected to audible. Retried about 4 times.... no luck had to force

    I do not know what happened, all of a sudden Firefox does not want to work anymore. Had been conected to audible. Retried about 4 times.... no luck had to force quit every time. The three Firefox app. into garbage, emptied garbage and redownloaded new version from Firefox. Reinstalled but same thing happened again... no connection.
    What can I do, I like Firefox better than Safari, had it for years on my Mac.
    Please let me know.
    (Note: I have also mentioned this on the automatic response to the malfunctioning).
    '''''Email removed by moderator to protect you from spam'''''

    Hey.
    I think it might be the problem with one of your plugins.
    Try to uninstall the webbrowser AND remove the storage from Firefox in your user-account (Linux: /home/username/.mozilla). You can check the list of installed Add-Ons in Firefox under "Extras => Add-ons" or by pressing Shift + Strg + A (Linux).

  • Main speaker stopped working. Phone does not ring, sound only through earpiece/headphone. What to do?

    main speaker stopped working. Phone does not ring, sound only through earpiece/headphone. What to do?

    I spoke to the reseller today and they aggred to exchanged it. They didn't elaborate on the actual cause but thought that it had to be a hardware issue.
    It could either be the issue that Euvix suggested or it could be as simple as the outer speaker is simply not working.
    Anesi, did you use the phone before the upgrade? Looking at what you've written I take you didn't so I would go back and get it exchanged.

  • My ipod does not appear in itunes. what can i do? i installed and desinstalled intunes but it does not work, my ipod does not appear in itunes. what can i do? i installed and desinstalled intunes but it does not work

    my ipod does not appear in itunes. what can i do? i installed and desinstalled intunes but it does not work, my ipod does not appear in itunes. what can i do? i installed and desinstalled intunes but it does not work

    iOS: Device not Recognized in iTunes for Windows

  • What to do if your madden nfl12 does  not work

    what to do if your madden nfl12 does  not work

    Why doesn't it work?  What happens when you try to play it?  Have you seen this article yet?
    iOS: Troubleshooting applications purchased from the App Store
    B-rock

  • System message 38 from work area ssfcomposer does not exist in va03

    Hi,
    I created a smartform copy from standard, it is working good for all sales order,but for perticular one sale order it shwing error like
    system message 038 from work area ssfcomposer does not exist.
    i have long item line in this sale order what can i do please help me.
    Regards
    KK

    If I am not wrong, I guess you are using template/table inside your smartform.. which is causing the error.
    I issue could be because of the condition on the text inside the template which might be overlapping the output structure line and column. The issue can be also be because of your table cell.
    To trouble shoot place a false condition(like 1 = 2) first on table and if error still occurs then remove condition on table and place it on structure.
    I guess, the above answer will help you to close the thread.
    Regards,
    SaiRam

  • Have a new computer with a different name.  New computer does not reconize the ipod classic device?

    Have a new computer with a different name.  New computer does not recognize the ipod classic device? How can I remody this problem

    Add '''DOZEN''S''''' of giggs of ram, switch from hard disk to SSD or add inline SSC.
    Consult some free experts about potential malware infestation: BleepingComputer.com
    In windows control panel is an option to rate performance of your computer. What number does the applet rate your computer?
    http://windows.microsoft.com/en-US/windows7/What-is-the-Windows-Experience-Index

  • I am trying to import pictures to IPAD 2 via Ipad Connector. Use to work now it does not. Any clues?

    I am trying to import pictures to IPAD 2 via Ipad2 Camera  Connector (Flash). Use to work now it does not. Any clues? I am a neophyte to Apple products...

    If you are using a flash card, as opposed to an SD card, then I assume that you are using a third-party card reader with the kit ? If so what error, if any, are you getting e.g. a 'requires too much power' error ?
    Also how are the photos getting onto the card ? If you are adding them yoursefly then you need to create a DCIM directory off the root of the card, with the photos underneath it, and the photo filenames need to be exactly 8 characters long (no spaces) plus the file extension i.e. in a similar format as if a camera had created/written them

  • What do you do if your iPod does not have a serial number?

    What do you do if your iPod does not have a serial number?

    Have you tried restoring to factory settings/new iPod via iTunes?
    Are yo the original owner and have never jailbroke the iPod?
    Does the iPod work OK?
    The warranty is also void:
    if any serial number has been removed or defaced from the Apple Product.

  • Google search does not work. It does not bring back any results and disables my internet connection until I close the brower, wait, and then open it again.

    Google search does not work. It does not bring back any results and disables my internet connection. I have to close the browser, wait, and then open it again. It only seems to happen when I am signed into my Google account. If I am signed out the search functions properly.

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/security/scanner/en-us/default.aspx - Microsoft Safety Scanner
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • [svn] 4722: Fix for - asdoc comment on a setter does not appear if the getter is not marked @private

    Revision: 4722
    Author: [email protected]
    Date: 2009-01-28 15:40:43 -0800 (Wed, 28 Jan 2009)
    Log Message:
    Fix for - asdoc comment on a setter does not appear if the getter is not marked @private
    QE Notes: None.
    Doc Notes: None
    Bugs: SDK-18879
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18879
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java

    Hi BRIAN.MURPHY.TX,
    Based on my research, it’s better to maintain separate certificates for SQL Server and RDS as different applications might be incompatible and require certain fields of the certificate. For more details, please review this similar
    thread.
    Besides, the issue is more related to Windows security, I would like to recommend you post the question in the Windows Server Security forum at
    https://social.technet.microsoft.com/Forums/en-US/home?forum=winserversecurity . It is appropriate and more experts will assist you about the certificate sharing issues and SSL certificate best/bad practices issues.
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Hi.. I received my Iphone today. It has tiny scratches at the corners. ALSO, i cannot hear anything, have to use headphone. Siri works slow and does not speaks!!

    Hi.. I received my Iphone today. It has tiny scratches at the corners. ALSO, i cannot hear anything, have to use headphone. Siri works slow and does not speaks!! Anyone with same problems? What can i do now?

    What if they say i scratched it by dropping or something (which i obviously dint)? will they still replace it?
    It even has the plastic on it yet..!!

  • Home Page setting does not survive a system re-start

    I have recently started to have trouble with my Firefox Home Page. The settings get lost when I close Windows down and re-start.
    I run Firefox 7.0.1 on Windows 7 Starter (SP1).
    What have I done?
    Set home page to iGoogle in Windows, set home page to iGoggle in Firefox
    Result: Home Page setting does not survive a re-start.
    Set home page to Blank in Windows, set Home Page to iGoogle in Firefox
    Result: Home Page setting does not survive a re-start.
    Set home page to iGoogle in Windows, set Home Page to Blank in Firefox
    Result: Home Page setting does not survive a re-start.
    Checked Firefox help, advised to edit User.j(?) file. Following the instructions failed to locate the User. file, a search of the entire C: drive failed to locate the file.
    What next?

    ''' "Set home page to iGoogle in Windows ..." '''
    Firefox has its' own setting for the Firefox homepage, it doesn't use "Internet Options" settings in Windows. <br />
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    As far as not having a '''user.js''' file, it isn't a standard file in Firefox. It is an optional file that the user creates to "lock" certain prefs or it might be added to Firefox via an add-on or by an "exploit" perpetrated on the user by another piece of software that they installed.

  • TS2972 I cant get my home sharing to work on my mac book, apple tv or iphone. Just wondering if someone could help. It used to work now it does not. Thanks

    I cant get my home sharing to work on my mac book, apple tv or iphone. Just wondering if someone could help. It used to work now it does not. Thanks

    The helpfulness of answers is limited by the details provided.  Just saying it does not work, or I got an error does not provide much to go on.  How is it not working?  What happens or does not happen?  Is an error returned?  If so what error.  Are you sure you are logging in with your home sharing ID?  It is not the same as your Apple ID or iCloud ID.

Maybe you are looking for