Search code examples
javaapigoogle-dfp

DFP Java API for a webpage


I'm a bit of a newbie when it comes to Java programming. I've been looking at DFP's API's. I've got some of their queries working through a command prompt on my computer.

However, I want to create a webpage which can make these calls through the click of a button. Can I link an action on a html page to a piece of Java code running. Then, I would need to retrieve the result from the J code and present it on the webpage.

Should I totally avoid the Java API for this type of thing?


Solution

  • Currently, Java Server Faces (JSF), which represents the evolution of Java Server Pages (JSP), is a very good option for getting data displayed as web pages.

    There are plenty advantages of using it, like: auto validation, using directly your java objects when displaying a page or receiving a request from a user, code completion (best in latest NetBeans 7.4 RC1), an abundant collection of already made professional components (see PrimeFaces) and so on.

    There are much more things to say. Of course, there is no perfect technology. It always depends on what do you actually need. Based on your description, JSF might be a good candidate for you.

    There are plenty of books (Core JavaServer Faces) and tutorials about this.
    If you combine JSF + ObjectDB (see manual) + Apache Tomcat or Apache Tomee (in case you want to try out some other technologies part of Java Enterprise Edition (Java EE)), you'll realize how efficient can a developer be. It's just unbelievable, yet not so many know about.

    Moreover, for even greater flexibility, some like to add Groovy in this combination as well. There are even more options, but I think it might be enough for you at the moment.

    In conclusion, JSF with PrimeFaces might be a good start for you. Later on you can check the other things I've mentioned, but take it step by step. I hope this gave you enough info to start with.