Jump to content

  • Log In with Google      Sign In   
  • Create Account

Mike_Stoddart

Member Since 26 Jun 2007
Offline Last Active Sep 16 2013 04:16 PM

Topics I've Started

newInstance and ClassCastException

11 March 2013 - 08:00 AM

I have an abstract class Entity and a derived class, let's call it Fred. I'm using newInstance() but I want to store the new instance in a HashMap<String, Entity>.  When I do    (Entity) klass.newInstance();      I'm getting an exception that I can't cast to Entity but I don't understand why. 

 

To further complicate matters, the class definition for Fred is created dynamically at runtime using a Javassist class loader.

 

Any suggestions appreciated.


Java library that can create WSDLs from POJOs, programatically/dynamically at runtime?

10 March 2013 - 04:29 PM

Does anyone know of a Java library that can create WSDLs from POJOs, programatically/dynamically at runtime? I've found various tools that can generate them using a command line tool. But I need a way to do it programatically as my classes are generated dynamically at runtime. Thanks


Reloading classes in Java?

20 February 2013 - 08:15 PM

I think I already know the answer but I thought I'd double check anyway. Is it possible to reload a class in Java when its method signatures change? I think it's forbidden by the JVM but is this possible in any way?

 

I can dynamically create class definitions and add methods and member data with Javassist. 

 

Thanks


Recommendation for Java web framework

19 February 2013 - 07:46 PM

I have some POJOs that I want to make available on the web using REST.  This is for a prototype where the user can edit/delete/add instances of these POJOs.  Any suggestions for a light web framework to make this as easy as possible? I'm hoping to find something that requires minimaI XML configuration and coding assuming there is an easy way to serve the POJOs as REST resources. I don't need to worry about user accounts/authentication etc. I will probably use extjs for the client side as we're already using it and I'm somewhat familiar with its models and stores. I am reading through tutorials for various frameworks and I'll start experimenting, probably with Vaadin first. Thanks


Help appreciated with CSS/HTML layout issue

24 October 2012 - 04:11 PM

I don't usually need to delve into CSS much in my job, but once in a while I come across that I can't work out. I've put the HTML/CSS up on jsfiddle:

http://jsfiddle.net/uvByD/3/

It's a simple two column layout, the left column is fixed and the right is fluid. The layout height must be exactly the page height, it cannot exceed the page's height or be less than it.

If you open firebug, the left and right columns both flow underneath the top navbar. They should be pushed down by the navbar but they shouldn't exceed the length of the page as a result. I've tried various options and the one I posted I tried use a margin or padding to push the sidebar and content DIVs down, but this ends up making the page too long.

The contents of the jsfiddle is here:

[source lang="xml"]<!DOCTYPE html> <head> <meta charset='UTF-8' /> <title>Test</title> <style type="text/css"> html, body { margin: 0; padding: 0; height: 100%; width: 100%; } #navbar { width: 100%; height: 30px; background-color: yellow; display: inline; top: 0; left: 0; position: absolute; } #wrapper { background-color: red; width: 100%; height: 100%; } #main-wrapper { background-color: blue; width: 100%; height: 100%; } #sidebar { background-color: orange; width: 32px; height: 100%; float: left; display:inline; } #content { background-color: green; height: 100%; margin-left: 32px; } .clear { clear: both;} </style> </head> <body> <div id="wrapper"> <div id="navbar"></div> <div class="clear"></div> <div id="sidebar"></div> <div id="content"></div> </div> </body></html>​[/source]


Any ideas what I'm missing? I can't for the life of me see how to fix this.

Thanks

PARTNERS