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.
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.
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
I have a search engine which is implemented in Java. It's very complicated. I want to use a dynamic interface for the client so I guess I should go with AJAX. I absolutely don't know NOTHING about PHP, nor AJAX and this is my first web project but I have to do it ASAP and I'm seeking to learn how to do it as fast as possible. I want my page to send the query to the Java engine, and after processing the Java code should return the result to the page.
Thank you for your help.
GWT (Google Web Toolkit) is probably the fastest way for a non-UI Java guy to build a complex, ajax-enabled, dynamic UI.
As it seems you are already familiar with Java, why don't you use Java Server Pages (JSP) to build the web project? Here is a guide to getting up and running.
I am new in programming and this question may really be stupid but I still want to ask because I don't know what practices are possible and what are not. You see, right now I am studying basic J2EE. Our assignment is to make a web-based application using JSP and servlets. One of my problems is doing the forms.
I know that HTML is the best practice in making the forms in JSP because almost all people are using it(based on the examples on the books/internet). But Java also have its own forms which is the Swing, AWT and it all worked by using the events. If i don't want to use HTML, can I use Java's Swing/AWT or is it for the desktop applications only? Aside from what I've mentioned, what else can I use?
What you are talking about is called Rich Internet Applications RIA. These are web applications that make your web pages look like desktop applications. You can achieve this with Grails and Flex, GWT and JavaFX. There is a number of very interesting and great environments you can use like Vaadin, Open Laszlo, based on GWT. GWT and the frameworks based on it generate JavaScript and produce separate output for every browser environment.
These are the tools for the future. I do not really understand why these technologies are not mainstream yet.
Here is a list of the various RIAs frameworks available. Expect to welcome newcomers in SourceForge in the near future.
But Java also have its own forms which
is the JSwing, Swing, AWT and it all
worked by using the events.
Yes java has many Components in Swing and AWT.
And both Swing and AWT Components support Event Handling.
But I never have heard of JSwing.
If I don't want to use HTML, can I use
Java's JSwing/Swing/AWT or is it for
the desktop applications only?
Swing and AWT are for the desktop application only.
But as Orbit said
In Appletz? – Orbit
You can definetly use Swing components on an applet and then embed the applet on your JSP page.
I know that HTML is the best practice
in making the forms in JSP
Using HTML will be a lot easier than using Applet to make a form
As Andrew said
Applets are a PITA to develop and
deploy, and most users prefer pure
HTML (or dynamic HTML, using
JavaScript) to applets.
You can try out Wicket - seems like transfer your desktop expirence to web
Perhaps you need to think about what is running where, and how those programs communicate. When you develop a web application, you are co-ordinating a conversation between (at least) two separate machines.
On one side, you are running a web server, that serves up static content (simple files that are just sent out with no changes) and dynamic content (essentially files that are constructed only when needed, and that will change according to their situation - for instance a welcome page that displays the user's name). Plain HTML is static content, JSP and servlets provide dynamic content.
On the other side, you are running a browser. The browser can display static content, run javascript programs built into those pages, and embed specific types of applications. Examples of embedded applications are Flash and Applets.
So you can be clear, JSP and Servlets are NOT running on the client machine, they just deliver different content for the browser to display. A J2EE program is not delivered to the client, it just sits on the server carrying out one side of the conversation with the browser carrying out the other side.
A web form is just a lump of HTML that tells the browser to display text fields, buttons and other controls. The browser knows all about these things, and you don't need to write a program to tell it what to do to display a form and send the content back to the server. A simple form doesn't need to be dynamic - you're asking the same questions every time - so you can write it in pure html.
When the user submits the form, the data is transmitted to the server and you will need to write a program to receive that data and do something with it. That is the role of the servlet, which can receive data and respond - with another web page, probably using JSP to display dynamic content (ie. the answer to the form submission).
If that all sounds complicated, it certainly can be. There are various frameworks (Wicket, Struts and so on) that try to make it easier to develop web applications by hiding some of the details of the conversation, and carrying out common tasks automatically. However, the underlying mechanism is still the same - content from the server is displayed on the browser, which can send back messages such as form contents, or requests for different pages. Understanding the basic mechanism allows you to make informed choices about how you can do more powerful things.
Embedded applications allow you to run more complex software on the client - so you can display animations or custom controls. However, the software is ONLY running on the client, and still needs to communicate data back to the server. The server still needs to be running it's own software to receive that data and do something with it. As such, embedded applications don't make your job any easier, but do allow you more control over how things work on the client. However, a modern web browser gives you a lot of control over how forms are displayed and handled, so you need a good reason to ditch that and use something like Flash or an applet.
For websites, always use HTML (and Javascript, for things like input corrections, alerts and such). The less you use Java and Flash, the better.
Keep in mind that websites must be fast and efficient, users don't want to wait minutes until the Java applet loads.
I would recommend you to do in HTML. Because HTML can do wonnders and you can split your web apps sematically using HTML. And i recommend you to use Wicket(its an framework), where all are been splited. That is, web designing can be done separately using HTML, presentation can be done via CSS and the event handling all can be done via JAVA. And wicket takes care of all these connections too. So have a look on Wicket. And hope it helps you.!
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.