Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom tag - exception

 
Aleksander Zielinski
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Started preparing to SCWCD, writing some custom tags to lean how they work and have a problem. I'm getting: org.apache.jasper.JasperException: jsp.error.beans.property.conversion, and don't know what may be wrong.

Would be very appreciated for help. Below are code snippets.

movies.jsp - starting page
--------------------------



testers.tld
------------



showme.jsp - VIEW
-----------------



MTS.java - tag handler
-----------------------



Main.java - CONTROLLER
------------------------





getMovies(String) method in MovieHelper class return ArrayList with Movie objects. I can paste MovieHelper and Movie classes if you want to, but I think it's not necessary, the error is somewhere else.

Thank you very much if anyone would like to help me.
[ April 04, 2006: Message edited by: Aleksander Zielinski ]
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

One possible reason, you have not defined the taglib directive in your JSP for the prefix t.

Thanks
 
Aleksander Zielinski
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for interesting in my problem. I have a taglib directive in my jsp file. It looks like this.

<%@ taglib prefix="t" uri="testers" %>

And I have a match for the uri name "testers" in my TLD file. Any other thoughts? I spent a lot of time on it and have no idea what's going on.
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Its complaining about porperty, so could it be something to do with the movieList being declared private. I am not sure, worth a try.
Ta
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The usage of hte attribute is defined as movies and the invocaiton is using movie, could you please try using ${movies.title}

Regards
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Not tested practically. Reading thru code, please try this

Change the code

<body>
<t:names movieList="movies">
<tr><td>${movie.title}</td></tr>
</t:names>
</body>


to

<body>
<t:names movieList="${movies}">
<tr><td>${movie.title}</td></tr>
</t:names>
</body>


You are passing the string to the attribute setter method, but it actally require List. It should work.

Thanks
 
Aleksander Zielinski
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nileesha Bojjawar:
Hi,
The usage of hte attribute is defined as movies and the invocaiton is using movie, could you please try using ${movies.title}

Regards


Attribute is movies, because I'm passing a list of movies, then the tag handler set a new attribute "movie" for each movie in a Collection. But thanks anyway, I appreciate your help.

Originally posted by Narendra Dhande:

You are passing the string to the attribute setter method, but it actally require List. It should work.


SCORED! I missed that! THANK YOU!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic