reset password
Author Message
jadiagaurang
Posts: 53
Posted 06:28 May 07, 2009 |

I have imageURL a property of Blog class which is data type of URL (java.net.url). I have mapped (... imageurl character varying(255), ...) it to database as bytea (Binary Data Types). I did it because csns.dll gave me image url as bytea!!! I can create CSNS Blog with Title and Description and It is working fine. But, error occurs when I try to create blog by passing value for Image URL. As I understand error is about parsing of value from String to URL. I really don't know how to parse it in Spring Framework. Interesting thing is that, there is no error in my console or any log files but shows only from blog validate class!!! Undecided I am trying to solve this from last two hours and could not figure it out. Any suggestion, Help...

Attachments:
cysun
Posts: 2935
Posted 08:17 May 07, 2009 |

Your imageUrl should be of String type, not URL. URL is useful when you need to retrieve a web resource in Java code. For this assignment you'll do something like <img src="${blog.imageUrl}" />, which is just using imageURL as a string.

I think Spring does not automatically convert String to URL. If you really want to do that, you need to create something called a property editor. See csns.spring.CustomCalendarEditor for how to create a property editor, and csns.sprng.controller.survey.CreateSurveyController for how to use a custom property editor with a controller.