
Blog's
Febrero 10, 2010
17:47
Somehow, in my meanderings yesterday, I came upon Darryl K. Taft's presentation on eWeek, titled Application Development: 15 Ways Oracle Can Make Java Better (and Improve Its Stance with Developers). The first slide from this presentation that came up on my browser was the last, Slide 16, which is titled "Really Treat Java as 'One of the Crown Jewels'." When I went back and reviewed the entire presentation, I saw a lot very good points. The question I have is: do we really want the solutions to Java's problems to come directly from Oracle? Or, would we prefer Oracle to take a more hands-off approach than Sun did, and instead stimulate change through supporting a vibrant community?
Of course, on can ask: can an independent community really address big issues? Isn't a benevolent dictatorship much more efficient? I'd say that Linux is evidence that you don't need a benevolent dictatorship in order to advance an open source technology.
It's very early on in the history of the merged Sun-Oracle. So, it's not clear what direction Oracle will ultimately take. Overall, it seems to me that Darryl advocates the benevolent dictatorship approach. But I think in this case that approach has a risk of backfiring, because many in the Java community distrust the slick and powerful corporate giant. So, the arguments that impeded Java's progress today (what should and shouldn't be in Java 7, etc.) -- if Oracle simply dictates the decisions, even if the decisions are well thought out and make perfect sense for Java's future -- that's going to turn off a lot of the Java community. So, largely for this reason, I don't know if the overall approach Darryl advocates is the right one, for Oracle or for Java -- despite the seriousness of some of the issues Darryl documents in the first 15 slides of his presentation.
Getting back to the concluding Slide 16 ("Really Treat Java as 'One of the Crown Jewels'") -- here's the opening statement to Oracle:
Overall, make up your mind and communicate clearly about your strategy for Java's future.
OK, yes, that's a good thing. But, isn't the essence of openness to say "nothing changes immediately, we want the Java community to continue to be the primary force behind the future of Java"? Thus far, Oracle has taken great care to not step into Java with a corporate-centric vision. Is this not a good thing?
The next statement in the slide confirms that Oracle has indeed been quite "hands-off" thus far:
For good or bad, Oracle did not do much to prune anything significant from Sun's many software strategies (some of which were flawed).
Again, my question is: who do we want to do the pruning? Who's to decide what should be pruned? Clearly, the author believes he knows which software strategies were flawed and should have been pruned by Sun. But will everyone in the Java community agree with his -- or Oracle's -- assessments? Would the to-be-pruned project communities agree? Again, my question: do we really want the corporate entity Oracle to start making these decisions?
Moving on in the slide:
The notion of supporting three IDEs is confusing. It didn't really work for BEA and while it sort of sounds good here, it's messy.
A few months ago, I created a poll that asked Which IDE do you use? In that poll, I neglected to include IntelliJ IDEA (because most of my communications as java.net editor were with NetBeans and Eclipse users). I'll tell you, the push-back from that exclusion was immense. The poll was boycotted by many IntelliJ IDEA users.
Even if it's "messy" for Oracle to support three IDEs (JDeveloper, Eclipse, and NetBeans, I assume), I don't see how that's a problem. From the developer community point of view, I think it's great, actually. As for "confusing" -- when you go to a grocery store, do you find it confusing to see many different varieties of vegetables and fruits? Even if it is confusing, don't we enjoy the opportunity to choose!?
Onward:
It's not possible to focus equally on every one of the many initiatives, which means that some things get starved and perhaps die in a year anyway.
That's how marketplaces work. In a great many areas, Oracle is saying "we're going to keep our hands off" and let market reality take its course. 80% of open source projects fail. 90% or more of new businesses fail within their first five years. 95% of people who try out futures/derivatives trading end up losing money and quitting. This is how the marketplace works. That some initiatives starve and die is normal. It would be abnormal for all or most of them to succeed. Oracle is just taking a hands-off approach, letting the nature of the marketplace make the final decisions. IMO, anyway...
Finally:
As Oracle EVP Thomas Kurian said, "Java is one of the crown jewels" Oracle got in the Sun acquisition. Treat it as such.
From what I see so far, Oracle is doing exactly that: it's treating Java as a crown jewel so valuable that it doesn't want to tamper with Java as an independent organism. I see Oracle as having listened to many unofficial messages from Sun, and from the Java community, during the nine months of acquisition wait time, stating that with respect to Java, Oracle wasn't acquiring a "product" -- rather, it was acquiring an opportunity to invest in a vibrant, open technology, that still has immense growth potential going forward, if only it is allowed to proceed within the organic, multi-faceted realm that has hitherto fostered its growth. Thus far, I see that message as having been heard by Oracle.
No dictatorial statement of Oracle's "strategy for Java's future"? That's exactly what I myself was hoping for, post-acquistion. Let's let the Java community itself make the decisions on Java's future. The best thing Oracle can do, in my view, is set Java even more free of corporate guardianship than was the case under Sun. This means supporting the Java community, but not dictating the result.
Hopefully, the community will ultimately find the right solutions to most of the problems Philip delineates in his presentation -- solutions to the problems the community decides most urgently need solving, that is. Yes, set the JCP free (as Philip says in Slide 7) and provide Apache an unrestricted Java TCK (as Philip says in Slide 3). Doing these things frees Java further into the hands of the community.
Progress may be slower when it is led by a diverse, fractious community. But, the community stays interested and more involved that way. That's a healthy situation for Oracle to try to promote, in my view.
In Java Today, the JCP Program Office has announced the Results of the ME Special Election:
Yesterday the ballot closed. Cablelabs is the new ME EC member. Detailed results follow below: * Cablelabs (Jon Courtney) with 48 votes (30%)...
Arun Gupta has posted TOTD #121: JDBC resource for MySQL and Oracle sample database in GlassFish v3:
This blog clearly explains how to configure the MySQL sample database (sakila) with GlassFish. Even though the instructions use a specific database but should work for other databases (such as Oracle, JavaDB, PostgreSQL, and others) as well. The second half of the blog provide specific syntax for the Oracle sample database...
Adam Bien provides code and explanation for the Simplest Possible EJB 3.1 Timer:
A timer doesn't have to be a singleton - it can be a @Stateless and even a @Stateful bean. The method doWork() will be invoked every second. There is no registration or configuration needed...
In today's Weblogs, Santiago Pericas-Geertsen is Exploring Hypermedia Support in Jersey:
During the last few weeks, Marc H., Paul S. and myself have been exploring some ideas to support Hypermedia in Jersey. The outcome of this investigation is an experimental implementation that is available in Jersey's trunk (module version 1.2-SNAPSHOT). Exactly what it means to support hypermedia is still an area of research, and some other implementations of JAX-RS (notably RESTfulie) have also proposed APIs for it. The REST architectural style, as defined by Roy Fielding in his thesis, is characterized by four constraints...
Juliano Viana posted his first java.net blog, Making Apache Wicket even more designer friendly :
Hi, my name is Juliano Viana, I'm a software consultant and developer based in Brazil, and I've been honored with the opportunity to blog in Java.net! Hope I can contribute something to this great community resource. For my first blog post at Java.net I've choosen to write about my web framework of choice, Apache Wicket. A designer and developer friendly framework Wicket is a great web framework - it allows the creation of complex web interfaces, complete with fancy ajax effects, in a simple and straigthforward way...
John Ferguson Smart asks you to Have pity on your system administrator: tips for using Hudson with complex Maven build jobs:
A new Java Power Tools Newsletter is out! This month, we will be taking a look at some of the ways you can make life easier for your system administrator, when you are using Hudson for large Maven projects. Check it out...
In the Forums,
morrisford is working on Portal issues involving Wonderland: Maggie and I were experimenting with 'portaling' between three servers and encountered several issues. These things seem to happen every time that multiple jumps are done, ie, from world1 to world2 to world3 to world1, etc...
In the GlassFish forum, Eve Pokua is seeing a javax.persistence.PersistenceException: Hello everyone, I have the following error. I am trying to bind data from my DB into a Jtable using the following tutorial. When it's not bind it runs ok. But binding it causes the following errors...
In the LWUIT forum, digitalsol has S60 devices performance problems: Hello, I've tested my app on Nokia N97 and 5800 and the performance is terrible in comparison to Nokia E71 for example. Can someone give me more info if this is a known problem, are there ways to improve the performance, etc...
Our current Spotlight is the Oracle announcement about Kenai.com: "Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community. We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects..."
This week's java.net Poll asks Does your company use an enterprise repository manager for development? Voting will be open for the next week.
Our latest java.net Feature Article is Maven Repository Managers for the Enterprise, by John Smart. We're also featuring Jeff Friesen's Reading Newsfeeds in JavaFX with FeedRead, in which Jeff demonstrates how to apply JavaFX's RSS and Atom newsfeed capabilities to create a snazzy little JavaFX app that can run stand-alone or in a browser.
The latest Java Mobility Podcast is Java Mobile Podcast 92: MIDP 3.0 in Depth: Tutorials and Demonstrations: Excerpts from the JavaOne 2009 MIDP 3.0 In Depth: Tutorials and Demonstrations session with Roger Riggs, Lakshmi Dontamsetti and Stan Kao.
Current and upcoming Java Events:
- February 22-27: Java Training Philippines
- March 8-13: JavaEE Training Philippines
- March 17-19: TheServerSide Java Symposium 2010
- March 25-26: Agile Testing for Java Developers
Source: Blog java.net
Categorías: Blog's
17:04
14:05
Content available at: http://blogs.sun.com/arungupta/entry/totd_122_creating_a_jpa
Source: Blog java.net
Categorías: Blog's
Febrero 9, 2010
16:20
During the last few weeks, Marc H., Paul S. and myself have been exploring some ideas to support Hypermedia in Jersey. The outcome of this investigation is an experimental implementation that is available in Jersey's trunk (module version 1.2-SNAPSHOT). Exactly what it means to support hypermedia is still an area of research, and some other implementations of JAX-RS (notably RESTfulie) have also proposed APIs for it.
The REST architectural style, as defined by Roy Fielding in his thesis, is characterized by four constraints: (i) identification of resources (ii) manipulation of resources through representations (iii) self-descriptive messages and (iv) hypermedia as the engine of application state. It is constraint (iv), hypermedia as the engine of application state or HATEOAS for short, that is the least understood and the focus of our investigation.
It has been identified by other authors that there are actions that cannot be easily mapped to read or write operations on resources. These operations are inherently more complex and their details are rarely of interest to clients. In our work, we introduce the concept of action resources. An action resource is a sub-resource defined for the purpose of exposing workflow-related operations on parent resources. As sub-resources, action resources are identified by URIs that are relative to their parent. For instance, the following are examples of action resources:
http://.../orders/1/review
http://.../orders/1/pay
http://.../orders/1/ship
for purchase order “1” identified by http://.../orders/1.
A set of action resources defines—via their link relationships—a contract with clients that has the potential to evolve over time depending on the application’s state. For instance, assuming purchase orders are only reviewed once, the review action will become unavailable and the pay action will become available after an order is reviewed.
The notion of action resources naturally leads to discussions about improved client APIs to support them. Given that action resources are identified by URIs, no additional API is really necessary, but the use of client-side proxies and method invocations to trigger these actions seems quite natural. Additionally, the use of client proxies introduces a level of indirection that enables better support for server evolution, i.e. the ability of a server’s contract to support certain changes without breaking existing clients.
The Jersey extensions that we implemented were influenced by the following (inter-related) requirements:
- HATEOAS: Support for actions and contextual action sets as first-class citizens.
- Ease of use: Annotation-driven model for both client APIs and server APIs.
- Server Evolution: Various degrees of client and server coupling, ranging from static contracts to contextual contracts.
Source: Blog java.net
Categorías: Blog's
14:00
Hi, my name is Juliano Viana, I'm a software consultant and developer based in Brazil, and I've been honored with the opportunity to blog in Java.net! Hope I can contribute something to this great community resource.
For my first blog post at Java.net I've choosen to write about my web framework of choice, Apache Wicket.
A designer and developer friendly framework
Wicket is a great web framework - it allows the creation of complex web interfaces, complete with fancy ajax effects, in a simple and straigthforward way. The best Apache Wicket feature is in my oppinion the total separation between markup and business logic.A Web Designer working in an Apache Wicket project will probably never see a line of Java code, and the Developers can work on mock interfaces and be certain that when the time comes to make it look great the designers will be able to style it without any hassle.
Another feature I find extremely useful in Wicket is the page markup inheritance concept. In Wicket every page is a Java class that extends org.apache.wicket.Page. Each page has also an associated HTML file containing the page markup.Wicket allows one to create base pages that contain your web site main markup and common funcionality (such as heder, footer, CSS files , analytics scripts, login area, search area, language selection box etc.). One can then create specialized pages that inherit this common layout from the base page and provides just the specialized content.
A Wicket Base Page usually looks like :
Your Title...
Common header goes here...
Common footer goes here...
The wicket:child tag is used to mark where you want specialized content to be placed. A Wicket page extending this base page will then contain only the following HTML:
Page content goes here....
At run time Wicket will combine both markups in order to produce the final rendered page.
(for a complete description of how markup inheritance works in Wicket, see http://wicket.apache.org/examplemarkupinheritance.html).
What designers wanted
Recently I have started a new web project and (not surprisingly) decided to use Wicket as the main web framework. This project is not just a web application, but an entire web site. A website doesn't contain only application pages - it will have lots if informational pages like help, about, contact, news etc.
Once the designers decide the basic look and feel of the web site, this look and feel can then be moved to the Base Page and be automatically applied to all application pages.
This is great, but what if a designer wants to just create an informational page that still inherits the default web site content and behavior?
Here is the problem: since in Wicket each page is equal parts HTML and Java code, the designer needs to ask a developer to create a corresponding Java class for each page she wants to create, even if this page has pretty much the same behavior as the base page.
Wouldn't it be great if one could just place a HTML file into the web app content directory and have it automatically inherit all the features of a Wicket page?
The idea is to have a special page class (I've called it DynamicPage for the lack of a more appropriate name) that gets associated with any "orphan" HTML file in the web application (meaning a file not already associated with a Wicket page ).
DynamicPage should extend the application's BasePage and hence inherit all the common funcionality and layout.
This is a big departure from the way Wicket usually works, but would make our life much easier.
Customizing Wicket behavior
Thanks to the vision of the Apache Wicket creators one can customize almost everything in Wicket without having to resort to patching the code. After reading Wicket's code for a while I realized that I needed to implement a custom IRequestCycleProcessor. As the name implies an IRequestCycleProcessor is responsible for processing a web request, and among other things it routes the request to an appropriate RequestTarget (which in Wicket can be a Page or a component inside a Page, among other possibilities).
I've created a new IRequestCycleProcessor by extending WebRequestCycleProcessor (the default implementation) and overriding the method:
public IRequestTarget resolve(RequestCycle cycle, RequestParameters parameters) {
.....
}
My implementation first calls the superclass implementation to try to resolve the request in the traditional way. If the super implementation cannot find a Wicket target for the request, and the request is for an existing HTML file, it then returns an instance of BookmarkablePageRequestTarget which has DynamicPage as the Java class counterpart.
The next step is to make DynamicPage render the correct HTML markup file based on the request URL. This is accompished by making DynamicPage implement two interfaces: IMarkupResourceStreamProvider and IMarkupCacheKeyProvider. These interfaces tell Wicket that this page class is responsible for locating and loading its own markup.
A couple of aditional classes are required in order to make sure that Wicket is able to create page URLs for these dynamic pages correctly: DynamicWebRequestCodingStrategy and DynamicwebRequestTargetURLCodingStrategy. These classes are sligthly modifiied versions of the standard Wicket implementations and they help make the implementation complete: components inside these dynamic pages behave exactly as in "normal"pages, for traditional requests and also for Ajax requests.
Location, location, location...
Now that the designers can just create Wicket pages on the fly just by creating HTML files, they would also like to be able to place these HTML files in a separate folder from the Java source files. Wicket by default expects HTML files to be on the same directory as Java source files, and that is something that sometimes causes problems as designers don't feel very comfortable messing around with Java source code.
It is easy to change that by implementing a ResourceStreamLocator that tells Wicket where it should get the HTML markup files from. I have impemented a WebAppResourceStreamLocator which just loads the HTML files from the standard web context ( by calling ServetContext.getResource ). This implementation also allows one to strip common directories from the file name. This is useful if you use a deep Java package structure for your Wicket pages and still want your web app directory to look "natural". For example, Wicket will by default look for the HTML file for com.mycompany.web.MyPage under "com/company/web/MyPage.html". With WebAppResourceStreamLocator one can configure it to look for just "MyPage.html".
Pushing the component model further
Now that we have come all this way, wouldn't it be nice if we could improve things further by allowing designers to include Wicket panels inside these dynamic pages without the need for developer intervention?
Why does that make sense? Well, suppose your developers create a cool product search panel which, being a component, can be placed in any page. The designers would probably benefit from the freedom to move this component around and even place it inside arbitrary pages with little effort.
I've solved this problem by registering a new Wicket tag "wicket:dynamic" which can instantiate and add components to dynamic pages on the fly. This tag looks a lot like the standard "wicket:component" tag, but unlike wicket:component it adds the components at page construction time (not on page rendering time). I have chosen to implement it because wicket:component is not a fully supported Wicket tag acording to the documentation ( some Wicket developers believe it goes againt the core Wicket philosophy), and because some components don't work well if added at page rendering time.
Putting it all together
In order to make it easy to use these customizations in any Wicket application I have created a class library called LogicWicket (library and source can be downloaded here).
In order to use LogicWicket to make your applications more designer friendly, all you have to do is:
- Include the LogicWicket jar file in your web application
- Implement a Dynamic Page class. This class should extend your application's Base page and implement a few methods that delegate to LogicWicket's DynamicPageSupport class (see the example DynamicPage provided).
- In your Wicket Application class init method, register the custom resource stream locator: getResourceSettings().setResourceStreamLocator(new WebAppResourceStreamLocator(getServletContext(),"com/mypackage/web"));
- In tour Wicket Application class, override the method newRequestCycleProcessor like this:
Source: Blog java.net
Categorías: Blog's
13:50
Content available at: http://blogs.sun.com/arungupta/entry/ttd_121_jdbc_resource_for
Source: Blog java.net
Categorías: Blog's
13:49
The Hudson team has launched Continuous Blog, the official Hudson weblog. R. Tyler Ballance introduced the blog in his Welcome to Continuous Blog! inaugural message:
Hello and welcome to "Continuous Blog", the official Hudson weblog! If you don't mind me saying so, I think its arrival is long overdue. Since Hudson started in November of 2006, there hasn't been a central "voice" for the project. In just a few short years Hudson has grown into a substantial project with hundreds of plugins and thousands of users around the world. Kohsuke's nice Java-based extensible continuous integration server has grown up into fantastic tool with a great community around it...
The next few entries discuss new translations of Hudson in the Hudson 1.344 release, the 1.344 release, and the hotfix 1.345 release.
The plans for the Continuous Blog are broad. In his welcome post, Tyler says readers can expect to see:
Overviews of the latest releases of Hudson and its plugins, interviews and discussions with the developers who have contributed to Hudson over the years, guest posts by power-users on how Hudson fits into their workflow and much much more (really).
In an email, Tyler told me the blog will also feature Hudson tutorials, spotlights on companies the use Hudson, and articles. In other words, the Continuous Blog is intended to be a centerpiece for the Hudson community, more like a community site, or information center, than simply a collection of blog posts.
Note that you can also follow Hudson on Twitter (@hudsonci) -- that's actually where I first found that the Continuous Blog was about to happen. Hudson is also on Facebook and ohloh. Ohloh's current estimates for the Hudson project are that the code base has 625,800 lines, contributed by 169 developers, at an equivalent cost of $9,200,000 (US).
In other Java Today stories,
Peligri provides an update on GlassFish Support, HA, Clustering and More:
The Sun-Oracle
Strategy WebCast
and subsequent
Webcasts and Docs
generated multiple comments and discussions threads in the Web
from which I want to highlight a few comments in here.
Please check the original posts for context, clarification and
caveats...
On Twitter, Intel's Aaron Tersteeg pointed his followers to today's Parallel Programming Talk on Intel Software Network TV. The title of today's broadcast is "Refactoring (Parallelizing) Java Applications with Professor Danny Dig (University of Illinois U-C)." You can watch it Live on ISN TV at 8:00 AM Pacific Time (U.S.), Tuesday, February 9. If you can't see it live, just revisit the Parallel Programming Talk on Intel Software Network TV site later, and you'll be able to watch the recorded show.
In today's Weblogs, Jim Driscoll is studying HTML5 Semantic Tags:
Over the weekend, I was reading Mark Pilgrim's great book on HTML5 - and when I got to the part about the semantic tags, I thought it might be worth a quick mention. In case you've missed out on HTML5 in general (and don't want to take the time to read that book I linked above), the idea behind semantic tags is that many sites use div blocks to mark out the same kinds of content, over and over. Content like headers, footers, and nav bars...
Fabrizio Giudici has a message for Young speakers, remember Jazoon deadline is Apr 4:
Yesterday I made my proposal submissions for Jazoon 2010 - as usual at the last minute, as now the call for paper is closed. Young speakers (under 26) wishing to make their first experience should recall they have got still time until April 4. The three selected speakers will have the opportunity of going to Zurich with no expenses for the conference as well as flight and hotel...
Markus Karg asks Like to use XSLT 2.0? Move to Saxon!:
For many years I am using XSLT now for a lot of tasks in both, development and runtime environments: Source generation, creating HTML from XML data, or even rendering SVG vector graphics from XML finance data. But what really bothered me was that the XSLT transformer contained in Java (even in Java 6's latest release) was just able to do XSLT 1.0 but not XSLT 2.0. XSLT (and XPath) 2.0 comes with such a plethora of features that makes coding so much easier, like calling XSLT-written functions from XPath, "real" loops (instead of recursive calls) or dealing with sequences and many more. I couldn't wait any longer to get it, so the question was: What to do? ...
In the Forums, mmo18 is seeking a SOAP stack that can run inside an applet?: Hi - I hope this is the right forum to ask this question. If not, please advise! I am seeking a simple SOAP stack that can run as part of an applet. The SOAP stacks I tried so far (Apache, Java 6's built-in SOAP stack) cause security...
In the ME Interest forum, rapiz has questions about Setting default network connection for j2me apps: Hi, In my application i use socket connection to my server. my problem is, that some mobile phone (e.g. samsung) is configured to use WAP as default for j2me apps. and it blocks my socket. If i want to change it, i...
In the GlassFish WebTier forum, eheb is seeking a demo of JSF2 ui components library ?: I am looking for web demo and its source codes about JSF2 ui components library : mojarra or myfaces implementation ... Best regards.
Our current Spotlight is the Oracle announcement about Kenai.com: "Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community. We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects..."
This week's java.net Poll asks Does your company use an enterprise repository manager for development? Voting will be open for the next week.
Our latest java.net Feature Article is Maven Repository Managers for the Enterprise, by John Smart. We're also featuring Jeff Friesen's Reading Newsfeeds in JavaFX with FeedRead, in which Jeff demonstrates how to apply JavaFX's RSS and Atom newsfeed capabilities to create a snazzy little JavaFX app that can run stand-alone or in a browser.
The latest Java Mobility Podcast is Java Mobile Podcast 92: MIDP 3.0 in Depth: Tutorials and Demonstrations: Excerpts from the JavaOne 2009 MIDP 3.0 In Depth: Tutorials and Demonstrations session with Roger Riggs, Lakshmi Dontamsetti and Stan Kao.
Current and upcoming Java Events:
- February 22-27: Java Training Philippines
- March 8-13: JavaEE Training Philippines
- March 17-19: TheServerSide Java Symposium 2010
- March 25-26: Agile Testing for Java Developers
Source: Blog java.net
Categorías: Blog's
07:48
A new Java Power Tools Newsletter is out! This month, we will be taking a look at some of the ways you can make life easier for your system administrator, when you are using Hudson for large Maven projects. Check it out here.
Source: Blog java.net
Categorías: Blog's
02:06
Over the weekend, I was reading Mark Pilgrim's great book on HTML5 - and when I got to the part about the semantic tags, I thought it might be worth a quick mention.
In case you've missed out on HTML5 in general (and don't want to take the time to read that book I linked above), the idea behind semantic tags is that many sites use div blocks to mark out the same kinds of content, over and over. Content like headers, footers, and nav bars. Changing straight tags to tags like , , and is granting these tags semantic meaning, hence the name - semantic tags.
Semantic tags are a great idea. They offer a lot advantages over plain vanilla divs, especially for screen readers... but support in IE is pretty broken... The essential problem is this: unlike all other major browsers, IE doesn't know how to style unknown tags. So the following code won't work:
.border {
border: solid black;
}
...
test3
Ah, I hear the more informed folks in the audience say, there exists a library to fix this problem: the HTML5 Shiv. You can use it like so:
This simple script will allow styles to be placed on unknown tags in IE... So, that's a good start, but there are a few problems with it. For one thing, it relies on JavaScript, so if JavaScript is disabled, your styling will fail catastrophically. Similarly, applying print styles may not work, since JavaScript won't necessarily be run as part of the print process (note: I haven't tested this fully, but that's sure what it looks like in brief testing). There are reports that nesting seems to mess stuff up applying styles correctly, but my testing hasn't found anything broken in this way that isn't already broken in IE's CSS support.
Of course, there is a way around even that: If you are running JSF or some other server side processing on your backend, you could do User Agent detection, and emit 's to IE and the semantic tags to all other browsers. Then, by styling the tags solely with classes and ID's, it should be possible to make something that gets around the client side issues. Here's a section from a component that does just that.
@FacesComponent(value = "navtag")
public class NavTag extends UIComponentBase {
@Override
public void encodeBegin(FacesContext context) throws IOException {
boolean isIE = false;
UIComponent component = getCurrentComponent(context);
String style = (String) component.getAttributes().get("style");
String styleClass = (String) component.getAttributes().get("styleClass");
ResponseWriter responseWriter = context.getResponseWriter();
String ua = context.getExternalContext().getRequestHeaderMap().get("User-Agent");
if (ua != null && ua.contains("MSIE") && !ua.contains("Opera")) {
isIE = true;
}
if (isIE) {
responseWriter.startElement("div", null);
} else {
responseWriter.startElement("nav", null);
}
responseWriter.writeAttribute("id", getClientId(context), "id");
responseWriter.writeAttribute("name", getClientId(context), "clientId");
if (styleClass != null) {
responseWriter.writeAttribute("class", styleClass, "styleClass");
}
if (style != null) {
responseWriter.writeAttribute("style", style, "style");
}
}
Should JSF add these tags to JSF 2.1? I'd love to hear your comments, below...
Source: Blog java.net
Categorías: Blog's
Febrero 8, 2010
17:47
Our java.net spotlight this week is the announcement by Oracle's Ted Farrell about the future of Kenai.com and its infrastructure. Prior to Ted's announcement, all that was known publicly was that Kenai was going to be closed down. It turns out that, while that's true with respect to the domain name, it's not true that the Kenai infrastructure and project contents will be eliminated.
Here's Ted's complete message:
Gentlepeople,
In an effort to get information out to the Kenai community quickly, while trying to manage the integration of our two companies, I think we did a poor job at communicating our plans for Kenai.com to you. I would like to remedy that now. Our strategy is simple. We don't believe it makes sense to continue investing in multiple hosted development sites that are basically doing the same thing. Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community. We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects. So in the meantime I suggest that you stay put on kenai.com and let us work through the details and get back to you later this month.
Thanks for your feedback and patience.
Ted Farrell
Oracle Corporation
Overall, the news was greeted enthusiastically by the community. For example, on the Kenai blog, prior to the announcement, the comments posted by people universally expressed displeasure and disappointment, because the earliest news from Oracle about Kenai talked of a simple close-down of the site. After Ted's announcement, there were comments like "Great, great, great! :-)" (by Fabrizio Giudici, who has multiple projects on Kenai) and "YESSSSSSSSSSSSSSSSSSSSSS!" (by Chuk).
However, the "poor job of communicating" that Ted Farrell acknowledges did have an impact. While most people are pleased that the Kenai infrastructure will remain intact, just under a different domain name, a few people saw the apparent switch from "Kenai will close in 60 days" to "I suggest that you stay put on kenai.com and let us work through the details" more than unnerving, and plan to move away from Kenai regardless of the opportunity to stay.
The nine months of delay between the announcement of Oracle's acquisition of Sun and its completion provided Oracle with a lot of time for studying what they were acquiring in Sun. Still, due to the legalities associated with acquisitions, it was impossible to have the entire post-acquisition integration plan perfectly set in every detail. Despite its final market capitalization, Sun was a very big company. Its integration into Oracle will take some time, and will include some missteps.
A "poor job of communication" indeed happened with respect to Kenai. But the problem was resolved within 10 days of the completion of the acquisition. That's a pretty fast reaction time, in my view.
Some people have wondered why Kenai wasn't made a part of java.net right from the start. I don't know the answer to that question. Still, I think it's excellent that now Kenai and java.net will be integrated in some manner. I look forward to hearing the details on what the structure of this integration will ultimately be.
In Java Today, Alexis Moussine-Pouchkine talks about GlassFish , Kenai, and HotSpot under the Oracle Sun:
It's been just over a week since Oracle held its post-acquisition stategy webcast and we've already seen some fast reactions and comments from Oracle on several topics : • Projects hosted in Kenai will preserve their infrastructure and be moved to java.net (the best of both worlds if you ask me). See Ted Farrell's post for the details...
Christian Hedin posted details on setting up an environment for Continuos Integration for XCode projects:
Continuos Integration is the practice of integrating changes from many people as often as possible. Instead of merging changes once a month and spending time handling merge errors you try integrate every day, perhaps even every hour. Each integration is built and tested on a server. If there are build errors or test failures, you and your team will be notified right away. This is the second part of the blog post I wrote about TDD in XCode...
Janice Heiss pointed me to Robert Eckstein's new article, JavaFX 1.2 UI Control Components: Part 1, Layouts. Here's Robert's introduction:
JavaFX SDK 1.2 introduces a new set of user-interface (UI) control components for JavaFX programmers. Previously, JavaFX UI Components simply "borrowed" their functionality from the underlying Swing components, which prevented them from being used in anything other than the desktop profile. The JavaFX SDK 1.2 components, however, take advantage of the more powerful JavaFX scene graph, which not only increases portability, but also allows JavaFX programmers to create more compelling graphical capabilities. In this series of articles, we'll take a closer look at the new UI control components...
In today's Weblogs, Jim Driscoll talks about Progressive Enhancement with JSF:
Progressive Enhancement is a philosophy of web design - start with simple pages, and build them up based on the capabilities of the browser viewing the page. It’s related to (and in some ways, the opposite of) the idea of Graceful Degradation, starting with a nice, fancy page, and dealing with any browser faults in an elegant manner. Prehaps the simplest example to see this in action is the case of JavaScript being disabled in the browser - this is occasionally true for certain corporate clients concerned about security, and sometimes the case for very old browsers...
Markus Karg asks Like to use XSLT 2.0? Move to Saxon!:
For many years I am using XSLT now for a lot of tasks in both, development and runtime environments: Source generation, creating HTML from XML data, or even rendering SVG vector graphics from XML finance data. But what really bothered me was that the XSLT transformer contained in Java (even in Java 6's latest release) was just able to do XSLT 1.0 but not XSLT 2.0. XSLT (and XPath) 2.0 comes with such a plethora of features that makes coding so much easier, like calling XSLT-written functions from XPath, "real" loops (instead of recursive calls) or dealing with sequences and many more. I couldn't wait any longer to get it, so the question was: What to do? ...
Fabrizio Giudici asks Are you sure you know everything you need about erasure?:
Erasure is a part of the way Java 5 implements generics, so the bytecode loses all the information about the generified types, only generating the proper type casts where appropriated. It's the thing that you scream against when you try to write code such as: public abstract class CapabilitiesProviderSupport implements CapabilitiesProvider ...
In the Forums, Xavier Callejas asks What version of Woodstock components is using Glassfish V3 Admin Console GUI ?: Hi, I would like to use Woodstock in a web application deployed in Glassfish V3, I though they were incompatible with Glassfish V3. What I need to be able to use Woodsotck in Glassfish V3? Thank you...
In the Java SE forum,
sproketboy needs to Prevent Rhino scripts from accessing setters: Hi all, I'm using a script engine in my game and I'm passing to the bindings some objects which I don't want modified. For example I don't want a script to do something like this: player.name = "whatever"; So I created a...
In the LWUIT forum, alyver00 has questions regarding Intransition, Out transition,backCommand, how to use them correctly: Hi, I've some difficulties to use correctly the inTransition and outTransition setting on Form. If my application tree goes from form A to form B to form C and than i press back command from the form C till form A, I have an worst effect using...
Our current Spotlight is the Oracle announcement about Kenai.com: "Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community. We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects..."
This week's java.net Poll asks Does your company use an enterprise repository manager for development? Voting will be open for the next week.
Our latest java.net Feature Article is Maven Repository Managers for the Enterprise, by John Smart. We're also featuring Jeff Friesen's Reading Newsfeeds in JavaFX with FeedRead, in which Jeff demonstrates how to apply JavaFX's RSS and Atom newsfeed capabilities to create a snazzy little JavaFX app that can run stand-alone or in a browser.
The latest Java Mobility Podcast is Java Mobile Podcast 92: MIDP 3.0 in Depth: Tutorials and Demonstrations: Excerpts from the JavaOne 2009 MIDP 3.0 In Depth: Tutorials and Demonstrations session with Roger Riggs, Lakshmi Dontamsetti and Stan Kao.
Current and upcoming Java Events:
- February 22-27: Java Training Philippines
- March 8-13: JavaEE Training Philippines
- March 17-19: TheServerSide Java Symposium 2010
- March 25-26: Agile Testing for Java Developers
Source: Blog java.net
Categorías: Blog's




