Does anyone has experience on integrating GWT and Symfony2?
Currently I'm using Symfony2 with the frontend being JQuery + HTML.
Writing Javascript drives me crazy although JQuery has already been used.
I'd like to know if there are any successful cases? GWT can generates javascript for me.
I only need to write type-safe and OO Java.
But, there is another concern, with GWT normal practice, the HTML elements are all created dynamically. So when a page is being crawled by the search engine, there are no elements for it to crawl. Is it a serious problem affecting the SEO rank?
GWT is a powerful tool you can write your code in java and GWT will generate Cross browser supported JavaScript.
Dynamic pages are created on the fly. These pages function well for users who visit the site, but they don’t work well for search engine crawlers.
Why? Because dynamically generated pages don’t actually exist until a user selects the variable that generate them. A search engine spider can’t select variables, so the pages don’t get generated and can’t be indexed. There are different strategies available for reference check Dynamic sites SEO tips
Related
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to get started building a web browser?
I have a basic understanding of the Java language and also some knowledge about applets.
I have to develop a basic Web Browser for my college project which can display simple websites along with Javascript components.
Could anyone tell me what are the prerequisites i.e, what topics should I read before doing this and how to do it?
Really appreciate the help
Writing a web browser is a major undertaking, depending on the level of functionality you want to include.
Things that need to go into a browser:
An HTTP client that can retrieve the page content from a server. Java includes something very basic inside java.net, but if you can, use the Apache Commons HTTPClient instead. Many browsers also have support for other protocols, such as ftp:// or local files (file://).
An HTML parser, which can read the returned HTML (or XHTML) into an in-memory structure. The hard part here is that not only has HTML evolved; there is also a lot of HTML out there that does not conform to any of the multiple HTML standards. People just tend to write something, see if it can be rendered on a specific browser (say, IE), and move on -- and certain browsers can render almost anything. You can use existing parser such as JSoup for this, which also has limited support for fixing mistakes.
A rendering engine. This would be, for me, the most complex step. You would need really in-depth reading to get any sort of CSS support working (major browsers had a hard time getting it right too), and even non-css rendering such as nested tables or complex forms would imply hard work (to calculate where each page component goes on the rendered page). There are no add-on rendering libraries that I know of, but there is minimal (HTML 3.2?) HTML rendering support inside the JEditorPane - you may be able to use that (forget about advanced CSS, thouth).
Scripting support. This would interpret JavaScript, and make your pages interactive. You can use Rhino for that (maintained by the folks at Mozilla, and very powerful).
(Plus internal caching to avoid making repeated requests; support for saving pages to files; support for 3rd party plugins/extensions such as Flash; security considerations to avoid cross-site scripting attacks on your users ... there are many more components or concerns that I have not bothered to include above).
Since you have only basic understanding of Java, and any of the above components are fairly complex projects in their own right, I would suggest choosing another project or delimiting a very small subset of what a commercial web browser does to try to implement that instead.
Our website UI is build in javaScript, JQuery. Lots of task is performed by jquery. UI doing lots of filter , sorting searching , tabular display.
Now we want to make sure that web site works fine even javascript is disabled on browser?
SPRING MVC <>
can any body give me idea how can we achieve this?
Can any other technology will do over it?
can GWT will be able to achieve this ?
If your website is built using JavaScript technology itself, then unless you build it WITHOUT JavaScript, there is no way you can achieve this.
GWT is out because it basically compile some Java-ish code into javascript. With spring MVC, you can rewrite your site to use only clients view (JSP) and server side actions (MVC controllers) for sorting, ...
What you were supposed to do with your particular requirement was to build a basic site that worked without JavaScript and then use JavaScript to make it much more whizzbang(Pretty with cool effects)!! :-D But since you have already built the site the only solution I can think off the top of my head is to crate a new basic site with HTML and make it the default site. From that basic you can check if JavaScript is enabled and then redirect the user to the whizzbang site(JavaScript enabled one) with a simple JavaScript redirect!
Some sites can degrade gracefully from a faster, slicker version that uses JS, to another that does not. Unfortunately that does not seem the case with your site.
One strategy is to define a redirect in HTML (should be set for 5-10 seconds1)that points to needjs.html that explains to the user that:
Sorry, we do not have the ability to provide this site without JS.
In JS, cancel the redirect.
The majority of sites now-a-days presume there's javascript. If you want to check how your site behaves, turn off javascript in the browser. If you want content for when javascript is disabled only, put it in a <noscript> tag, but be aware GoogleBot (SEO) runs without javascript, and will hit this. How to make the site function nicely without javascript? Build some ninja html and css and do all your work server-side. But again, since most every site presumes javascript is enabled, users who disable it are already familiar with how broken they've made the web. It may just be sufficient to put a <noscript> that includes a message about how this site requires javascript.
[Note: I have modified my original post to provide some clarifications - m.e.]
Does anyone know of a way to embed a web browser within a web page, e.g. through a Java applet or similar mechanism? I have reviewed the discussion on various solutions for embedding a browser in a Java application. However, this will not work for our web-based tool, which is built on an asp.net framework. Using a Java applet is our current idea, but if you have other suggestions to address this issue, please post those as well!
This is to be used in a web-based tool that guides middle school, high school, and college students to read websites critically. The tool provides a set of guiding questions and other information along with a data-entry box surrounding the actual 3rd party web-page being viewed. The purpose of our tool is to allow teachers to choose websites for students to view and analyze - or allow students to choose the sites themselves. We (/the tool) do not control what sites or types of media are chosen.
We are currently loading the web-page in an IFrame, but that technique is limited in several ways. It does not provide full control for browser-like features we would like to provide, and is very sensitive to changes in both third party web-sites and to browser versions used by students. The most difficult issue we have pertains to anti-hijacking mechanisms used on the third-party sites. For good reasons, they use mechanisms that make them impossible to load into an iFrame -- that is, when you try to load the page into the iFrame, it will take over the entire browser window. Not only will the page not load WITHIN our frame, it will actually make our application "disappear", thereby making it impossible for students to use these sites within our tool, and potentially also causing students to lose their work.
The tool, which has take several years to develop, is currently web-based for a variety of reasons based on the needs of our users. I would appreciate any advice or insights the community may have!
Thanks.
If you have web application (ASP.NET page as you described), use web-based solutions, i.e. IFrame, etc.
Web browser controls anyway is a desktop solution.
In many JVM web frameworks survies and Indeed.com trends graphs, GWT looks to be the most (or among the top) popular JVM framework.
But AFAIK, GWT excels when the application is one page app -to some degree of course- (like GMail, Google Reader ..)
Does this mean that new developed Java webapps are one page apps mainly (not traditional request-new page response)?
Is it possible to develop SpringMVC or Struts2 style webapps with GWT? or it is not recommended?
Absolutely, it is definitely possible to build struts apps with GWT; at some level all the GWT is, is a convenient way of writing javascript (in my perl days, we called it 'syntactic sugar').
You can still use GWT-RPC, JSON, or HTML forms to communicate with the server.
You can attach to any arbitrary HTML element using RootPanel.get("id"); to add javascript widgets.
Almost every javascripty component on my employer's website is written in GWT: http://www.cohomefinder.com/ . The backend is an old fork of struts.
And here's a nice, though a bit dated, article about building 'normal' websites in GWT: http://www.canoo.com/blog/2007/03/13/building-a-regular-website-with-the-google-web-toolkit/
I'm not sure, however, that this use of GWT is where it really shines. One downside is a lot of javascript parsing on every page load. Code splitting can help with that, some.
In my opinion WWW will sooner or later come to full-blown AJAX web-sites, so that we wouldn't have
page reloads every time you click somewhere.
Now I want you to ask this.
What tools and frameworks can one use to make a Java Web-application running on Tomcat
have AJAX functionality like "in-place, with no page reloading" table sorting by
clicking on its column header, multi-tabs that enable opening at once the new screen to the user without reloading a page, saving data in the database without reloading a page, and other similar things that we do not usually see on web pages.
That's all should probably be based on AJAX.
But how to integrate this AJAX functionality with existing java web-frameworks, let's say Spring MVC?
Or maybe there are other frameworks that better suit such needs but that can be integrated with core Spring?
Your question is rather confusing--AJAX calls are all client-side, any server-side technology can return data to the client.
That being said, you may try taking a look at Google Web Toolkit.
With the GWT SDK, you write your AJAX front-end in the Java programming language which GWT then cross-compiles into optimized JavaScript that automatically works across all major browsers. During development, you can iterate quickly in the same "edit - refresh - view" cycle you're accustomed to with JavaScript, with the added benefit of being able to debug and step through your Java code line by line. When you're ready to deploy, the GWT compiler compiles your Java source code into optimized, standalone JavaScript files.
Among other things, GWT supports built-in serialization of objects for transfer to your Java servlets, allowing for crazy-easy (the technical term) integration of your GWT client and existing Java technologies.
Homebrewed/3rd-party Ajax stuff with JSF isn't that easy since you have to take its lifecycle and component tree into account. You would need to write your own ViewHandler. Rather look for what's already available. To start, JSF2 already provides builtin Ajax functionality with under each <f:ajax>. There are further also a lot of Ajaxical JSF component libraries, like RichFaces (showcase here).
No wording about Spring as I don't do it.