Question: I am currently making a website. Basically when the user scrolls to the bottom of the screen I am going to download another 10 posts (I'm making a little social network). To do this I have downloaded JQuery. The following JavaScript is ran when the user scrolls to the bottom of the page:

```
page++;
var next = 'posts?page=' + page;
$('.pContainer').append("code that loads the servlet in the next var goes here");

```

Inside the posts servlet I have a few out.println statements to test this. I have tried using JSP: Include tags inside the append brackets but it does not work.

Answer: 
Sounds like you need an interface.

Extract an interface (IAbstractEntity) from AbstractEntity. Or maybe IContact from Contact- the question isn't very clear about which class has the methods and properties that you want to share. It would looks something like this:

```
public interface IContact
{
    int Id { get; }
    string Name { get; }
    string Phone { get; }
}

```

Implement IContact on Contact. Then modify any methods that only use the particular methods/properties in IContact to use an IContact instead of Contact.

And I agree with @Jamie-Penney, it sounds like you should read <http://en.wikipedia.org/wiki/Data_transfer_object>

Finally, if this is a DTO, you are probably going to find yourself in need of something like [AutoMapper](http://automapper.codeplex.com/)
While I think that using a simple DTO would probably be the easiest solution, another option would be to [implement the IXMLSerializable interface](https://stackoverflow.com/questions/279534/proper-way-to-implement-ixmlserializable) on your Contact class and have it only serialize the properties you care about. Of course, this would affect the XML serialization of the object in other situations as well, not just with the web services.