aspose file tools*
The moose likes Struts and the fly likes IllegalArgumentException property not indexed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "IllegalArgumentException property not indexed" Watch "IllegalArgumentException property not indexed" New topic
Author

IllegalArgumentException property not indexed

Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I fixed a struts error recently because of changes in the Introspector class from JDK 1.3.1_08 and above. The error looks something like this

java.lang.IllegalArgumentException: Property 'displayContracts' is not indexed

The solution is to change the struts tag from something like

bean.displayContracts['counter'].property

to

bean.indexedDisplayContracts['counter'].property

The corresponding bean should have an indexed getter and setter like below

Type getIndexed<type>(int index)
void setIndexed<type>(int index, Type T)

I just chose to add the word "indexed". It is not necessary to follow that format. The indexed getters and setters should return a type based on the index passed and the the classic getters and setters can be retained to access the variable in a normal way. This way you can access the variable with both the classic getters and the indexed getters thus solving the problem. Just posting to let others know how to solve this. For more information

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4926813

P.S - Can a Mod please lock this topic ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
John,

Thanks for providing that insight. Your contribution is much appreciated.

However, we do not lock topics in this forum. I believe there is an even better option, though. I added your post to the JavaRanch Struts FAQ as question number 13.

I think you might be able to edit it if you want. Try clicking the "Edit this page" link at the bottom of your entry. Then make a small change and click the "commit" button. If you want changes made, and for some reason it's not letting you commit changes, just let me know and I'll change it.

Merrill


Merrill
Consultant, Sima Solutions
Prasad Tamirisa
Ranch Hand

Joined: Mar 26, 2007
Posts: 130
Thanks John,

Thats really a great job. This helped me alot to solve a very critical issue in two of my applicaion.



Regards,
Durga Prasad
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I added your post to the JavaRanch Struts FAQ as question number 13.


Thats cool thanks

Thanks John,

Thats really a great job. This helped me alot to solve a very critical issue in two of my applicaion.


Glad to be of help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IllegalArgumentException property not indexed