932
I Use This!
Activity Not Available

News

Analyzed 4 months ago. based on code collected almost 5 years ago.
Posted almost 10 years ago
Ken Fogel is the Program Coordinator and Chairperson of the Computer Science Technology program at Dawson College in Montreal, Canada. He is also a Program Consultant to and part-time instructor in the Computer Institute of Concordia University's ... [More] School of Extended Learning. Preview Text:  Ken Fogel, the Program Coordinator and Chairperson of the... [Less]
Posted almost 10 years ago
Part 1 of this series on Fosfor, the free and open source EPUB tool (https://java.net/projects/epubopentoolbox), was 7 months ago. Time for part 2, clearly. What's happened in the past 7 months? Well, I did some work on this project again about ... [More] two weeks ago. I decided to continue to use JavaFX for its WebView component. However, I simply could not get the WYSIWYG stuff from the HTMLEditor to work in the WebView, and vice versa. I.e., as I have mentioned several times, and blogged about in detail here, when talking about this JavaFX stuff, integrating the best of both worlds of the HTMLEditor and WebView just doesn't work. Not for me anyway. My compromise solution is to integrate BOTH of these components. So, now, Fosfor has a "View" tab, which renders 100% correctly, i.e, the CSS and the images that are defined in the source file are shown in the view correctly: In addition, Fosfor now has an "Edit" tab, which doesn't show the CSS and images at all. However, maybe that doesn't matter. In the "Edit" tab, you have the HTMLEditor from JavaFX, so that you can do WYSIWYG editing, i.e., graphically, with all the tools for resizing text, changing fonts, etc: There's also a "Source" tab, where you have the HTML from the source file, with syntax coloring and all the cool features that the NetBeans HTML Editor provides. The next step is to synchronize the "Edit" tab with the "Source" tab, as well as with the "View" tab (so that changes in "Edit" and "Source" are visible in "View"). I've done this before in an earlier version of this tool, so just need to reimplement that in this version, shouldn't be hard. After that, the priorities are to (1) make sure all of this works on Windows and Mac OSX (especially all the JavaFX stuff), (2) create a TOC window like in Sigil, (3) create different export formats, especially XML (which is what Uitgeverij Fosfor, the client of this application, actually needs) and, of course, EPUB (i.e., now that one can open an EPUB file, i.e., extract its contents, it should also be possible to turn the contents back into an EPUB file again, which is also something I've been able to do in an earlier version so need to reimplement that). And then the first release of Fosfor will be ready. When? Not sure... can anyone out there help with this free and open source project (https://java.net/projects/epubopentoolbox), especially with solving the XML export request? (This can probably help somehow.) One cool thing is that Fosfor is built on Maven so any IDE should be usable when developing this tool, assuming the IDE has good Maven support. [Less]
Posted almost 10 years ago
Alejandro Duarte is a software developer and the author of Vaadin 7 UI Design by Example. Preview Text:  Alejandro Duarte describes how NetBeans IDE and Vaadin have enabled him to create business ... [More] applications in a web environment. Legacy Sponsored:  unsponsored [Less]
Posted almost 10 years ago
IntroductionThere are times when you need to have a JavaScript popup window that opens to another URL based on user input.  The JavaScript is usually added to the onclick event on the JSF component. The dynamic link in JSF is more difficult to ... [More] accomplish since binding the onclick using Expression Language (EL) is determined at page rendering time. As a result, this means that the JavaScript is not dynamic. As a result, the link is not dynamic either. A SolutionI have created a project that has three examples that demonstrate the different types of JSF links including the dynamic link. The last example includes <f:param /> elements that are appended to the dynamic URL that is generated. The dynamic example still uses the onclick event, but the JSF action performs a redirect of the newly opened window. Additionally, and of the parameters that are added to the JSF component are converted to query parameters and appended to the redirect URL.The Apache Maven project created with NetBeans is located on BitBucket here: jsf-link-examplesThe project was tested on GlassFish 4 using Mojarra  JSF 2.2, but the technique should work on other application servers and JSF 2.x versions.Index.xhtml IndexBean.java [Less]
Posted almost 10 years ago
IntroductionI have used Beautiful Soup with Python in the past for screen scraping. I was immediately excited at the possibilities. JSoup is a Java API for extracting data, and manipulating the DOM in HTML.jsoup implements the WHATWG HTML5 ... [More] specification, and parses HTML to the same DOM as modern browsers do.I did a quick proof of concept just to see what it would do with my "dirty" code. It results in an interesting output that could be useful if used properly. If you put in garbage, you will get "less" garbage out. It is better than nothing.I decided that this still could be really useful especially combined with Hibernate Validators and JSF.Hibernate Validator - @SafeHtmlI was looking at the Hibernate Validators to see about cleaning up some input from users to prevent XSS issues. I noticed that there was a validator called @SafeHtml(whitelistType=, additionalTags=, additionalTagsWithAttributes=). It uses the JSoup HTML parser. Alas, I am full of sorrow. I can not seem to get the <code>@SafeHtml</code> annotation to work. GlassFish vomits and complains it can not find it. I even tried to add it to every lib directory in GlassFish without success. Failing to succeed, I tried Tomcat 8 next. Again, nothing but bitterness and disappointment. It just will not get picked up.I tried looking for a working example of the validator, and didn't find any that worked. I am not sure of the what is going on, but if I can't figure it out. I imagine I am not alone. I just blog about it. ;-) UndeterredWell I decided that I didn't need Hibernate anyway! I feel like I should be in Aesop's Fables. I mentioned my Proof of Concept (POC) earlier. I figured I would look at trying to remove some <script /> tags from my code and even encoded them too to see what it would do. The whole point here is to help prevent XSS.Here is my Apache Maven project on BitBucket: jsoup-cleaner Note: See the actual code for a more complete representation of the actual code I am trying to strip. The Syntaxhighlighter is having issues with the nested script tags. The same applies to the output.I was surprised by the result actually. It stripped out the <script /> tags, but totally missed the encoded tags. That is a major issue. ImprovementsI was looking for some solutions for the encoded JavaScript issue when I discovered a blog post called Jersey Cross-Site Scripting XSS Filter for Java Web Apps.This was not exactly what I needed, but it did contain a method which used JSoup and another framework called ESAPI. Enterprise Security API (ESAPI) was developed by OWASP to enhance the security of Enterprise applications. OWASP has a lot more than this framework.  ESAPI can strip out the encoded bits to help prevent XSS.I shamelessly used the following method from the blog post. This does effectively remove any encoded <script /> tags from the output. It does not however prevent errors in judgement on the part of the developer. For example taking the results of the output and using them directly in an HTML JavaScript attribute like onmouseover, or onclick.I created an example project called XSS Scripter's Delight which I demonstrated at the Greenville Java Users Group. It demonstrates what happens when you don't validate inputs from users. The name is satirical, but does demonstrate in a non-malicious way what you can do if you are not careful.The Apache Maven project developed with NetBeans can be found on Bitbucket here: xss-scripters-delight. [Less]
Posted almost 10 years ago
Last month update 1 of NetBeans Platform for Beginners was released, so, logically, we now have update 2 because the authors have a monthly schedule of releasing updates. Everyone who buys the book receives an e-mail at the end of each month with a ... [More] link to a free new version of the book, with updates and enhancements and other changes or fixes done to the book over the past month. Below you see the key parts of the latest update, i.e., all provided by readers of the book via e-mail or via the feedback page. Without any question at all, this is the best book to get if you want to get a thorough and complete start to the NetBeans Platform.  Dustin Marx recently provided a very good overview of everything the book contains, so check it out if you're still debating with yourself about the value of this book: http://marxsoftware.blogspot.nl/2014/04/book-review-netbeans-platform-beginners.html [Less]
Posted almost 10 years ago
The recent Leanpub publication NetBeans Platform for Beginners: Modular Application Development for the Java Desktop by Jason Wexbridge and Walter Nyla Preview Text:  Although I've used Java and NetBeans IDE for years, my experience with the NetBeans Platform has been minimal, making a book focused on...
Posted about 10 years ago
Ken Fogel is the Program Coordinator and Chairperson of the Computer Science Technology program at Dawson College in Montreal, Canada. He is also a Program Consultant to and part-time instructor in the Computer Institute of Concordia University's ... [More] School of Extended Learning. Preview Text:  Ken Fogel, the Program Coordinator and Chairperson of the... [Less]
Posted about 10 years ago
Sometime ago a training course for the NetBeans Platform was held in Leipzig, Germany. Excellently organized by Benno Markiewicz (he reports on this event here), who won the NetBeans community award last year for the many patches he provided, as well ... [More] as the many issue reports, and his work in the NetCAT project, the course was held at the company where he works, ECG Erdgas Consult GmbH.  The group was from a variety of different places, including the Laboratory for Machine Tools and Production Engineering at RWTH Aachen University (where some great work is being done with the NetBeans Platform) and the Frauenhofer Institute for Technology in Kaiserslautern. As always, it was a great time, focused on modules, TopComponents, Nodes, Lookup, and all the other NetBeans APIs, with many exercises and hands on work, with the view from the front of the room on the group being more or less like this: A full report on the training course can be found here: http://blog.nigjo.de/netbeans/2014/04/netbeans-training-2014-in-leipzig/ I like this part of the report especially: Zum Abschluss kann man sagen, dass sich der Kurs hinsichtlich Kenntnisse über NetBeans und dem Kennenlernen einer wunderschönen Stadt mehr als gelohnt hat. Wir möchten die Erfahrungen nicht mehr missen, denn auch unsere Gruppendynamik hat sich dadurch sehr verbessert. Two plugins have already been created by participants on the course: "ImportantFiles 4 JavaSE" (get it here in the Plugin Portal), by Daniel Koll, shows all the files in the 'nbproject' folder of a Java SE application in a new logical node in the Projects window. "TabSwitch" (get it here in the Plugin Portal), by Michael Koppen, which lets you switch the editor tabs in the NetBeans IDE the way Google Chrome and XtraFinder do. More info on this here in Michael's blog and the sources are here. As always, the highlight of the days spent in Leipzig were the informal chats and hanging out with beers, sushi, and similar items, in interesting places. Again, it was excellently organized by Benno, as I am sure everyone will agree, and here's a final pic, showing Benno, me, Reinhard (who joined the course from Luxemburg, to make stock trading software), and Toni: After the course, HTWK Leipzig, which is the Leipzig University of Applied Science, hosted a NetBeans Platform session entitled "Lessons Learned in Software Development at Boeing, NASA, and Other Large Organizations", where the focus was on modularity and loose coupling and the other features provided out of the box by the NetBeans Platform. Many thanks to Prof. Karsten Weicker and, again, Benno for organizing this interesting session. Are there other groups out there interested in learning about the NetBeans APIs that constitute NetBeans IDE and any other modular application that makes use of the NetBeans Platform? [Less]
Posted about 10 years ago
import java.util.StringJoiner; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; public class StringJoinerTest { @Test public void join() { String expected = "duke,java"; ... [More] StringJoiner sj = new StringJoiner(","); sj.add("duke").add("java"); String actual = sj.toString(); assertThat(actual, is(expected)); } @Test public void shortCut() { String expected = "duke,java"; String actual = String.join(",", "duke", "java"); assertThat(actual, is(expected)); } } Thanks to @gschmidl for the idea: @AdamBien or just String.join(",", list);— Gunther Schmidl (@gschmidl) April 15, 2014 See you at Java EE Workshops at MUC Airport or on demand and in a location very near you: airhacks.io! Real World Java EE Workshops [Airport Munich]> [Less]