[ http://mc4j.org/jira/browse/STS-247?page=comments#action_10820 ] Charlie Hubbard commented on STS-247: -------------------------------------
Actually you can use a libary called flexjson (http://fllexjson.sourceforge.net) right now with 1.4.x and get this behavior in one line. Creating JSON from your objects you've read with Hibernate is really simple. Here is an example from my stripes app: <pre> public Resolution search() throws ParseException { Map messages = doSearch(); String json = new JSONSerializer() .transform( new HTMLEncoder(), "to", "from", "cc", "bcc" ) .include("attachments") .exclude("searchText", "contentType", "mailbox", "*.class") .serialize( messages ); return toJson( json ); } </pre> > JavaScriptBuilder should allow exclusion of properties by name > -------------------------------------------------------------- > > Key: STS-247 > URL: http://mc4j.org/jira/browse/STS-247 > Project: Stripes > Issue Type: Bug > Affects Versions: Release 1.4, Release 1.3.2 > Environment: Win32/JDK1.5 > Reporter: Simon > Assigned To: Tim Fennell > Fix For: Release 1.5 > > Attachments: propertyexcluder.patch > > > Re-titling issue. The original problem (converting hibernate proxied > objects) has been fixed with an arguably simpler solution for 1.4.1. See > STS-264. > However, the possibility to exclude properties by name is also something that > would be useful independent of hibernate, so I'm leaving this targetted for > 1.5 with that purpose in mind. > -------------------------------------------------------------------------------------------------- > If an object is loaded via Hibernate and then passed to the > JavaScriptBuilder, it throws various exceptions. > See http://article.gmane.org/gmane.comp.java.stripes.user/769/ for a report > of the error - to summarize: -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://mc4j.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Stripes-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-development
