I was reading asp.net webpart technology which gives users some personalization abilities under some rules and tools of webparts.
are there something like webpart technology lib under java ?
There's always the ill-fated Portlet.
I don't know of any JSF or JSP implementations of this, and I don't think they even exist.
It is, however, possible to create such a thing with GWT from Google and GWT-Dnd .
These let you create javascript webapplications, but you write them in Java.
Here's an example created with GWT-DND: http://www.wibokr.com
You can use the following stuff:
JSP
JSF (or any other implementation - Icefaces, Richfaces, MyFaces, etc)
Google Web Toolkit
Spring MVC
Template-based solution (Freemarker or Velocity)
Haven't seen any frameworks which would directly support such functionality beyond the very basics, but there's a lot of frameworks which enable you to develop such a system if you want to. From other answers only the GWT and Portlet ones are actually valid so far.
If you want to find something compatible, you should start searching for web frameworks which support either of the Portlet API specifications (1.0 is JSR-168, 2.0 is JSR-286). Otherwise you just may as well roll out your own based on the web framework you find most comfortable to work with, whether that's GWT, Seam, Wicket, Tapestry, Vaadin...
Related
I have been using PHP (OOP) with various Frameworks for all my webdevelopment projects for the last few years. Next year I'll have to learn Java as part of CS university course, so I thought it may be a good idea to switch to Java for some of my smaller webdevelopment projects, so that I can get to know Java in advance.
What do I need to use Java for backend web development? What IDE/Server software/etc. should I use? What frameworks are available and which documentations could one recommend?
I know this is strictly not a Stackoverflow question, but I'd really like to hear the opinion of the very professional community here at Stackoverflow!
The web development component of Java is called Java EE. You should look into that.
As IDE you can use Eclipse, Netbeans, etc. (you can download versions that are specifically aimed at Java EE development, with bundled servers like GlassFish or Tomcat).
Use all of these technologies and learn what the terms mean: Servlet, JSP, JSTL, Filter, Tag library (create your own).
A very popular framework is Spring. Spring Core and Spring MVC has recreated most of the Java EE components but in a way that is easier to use.
The DWR library makes AJAX very easy.
Learn how to use Spring ORM, Hibernate or JPA.
I also just want to add my own answere to show what I choose in the end to work with:
IDE: NetBeans
Framework Play! Framework
I have to create a search engine front end for my IR project. I know java very well but I'm not using it for web applications yet. So, I need to choose what to learn to achieve my goal.
I found that java has many technologies such as : jsf , jsp , spring , gwt ... So what of these technologies suite my needs and which ones can I learn fast?
edit :
My web app should have two pages (first to submit a search query, and second to display the search results).
Since you know Java but not the plethora of web app frameworks, I would stick with GWT. While it does have a learning curve to be sophisticated with it, in fact you can build a working default app with one click in Eclipse. That will be enough to get you started.
Next you need a search engine. Lucene is the premier Java search engine application and is well-documented. However, it's large. You may get there faster using the VectorClassifier in Classifier4J. This will is simple enough that you can actually understand the whole thing in a limited amount of time (which would lead to a higher grade if I were grading this project).
Starting with the GWT Hello World "greeting" start app, instead of sending your name you send your search terms. Then in the servlet, you'd match the search terms to your documents with Classifier4J, which gives you scores. You'd return the scores in the greetService RPC call and show them with the document titles in your page.
Being the standard web framework in Java, I suggest looking at JSF first. It's relatively easy to learn and there are a lot of components available for it from third parties (e.g. PrimeFaces). Do make sure you start using a recent version of JSF (e.g. 2.0 or 2.1) as older versions (1.1, 1.2) are somewhat limiting.
Wicket and GWT are quite nice too, although GTW has a little bit of a learning curve. Then again, most every technology has such a curve and this really shouldn't stop a professional developer. Those two however are alternatives to JSF, you don't use them in addition to JSF.
I would not really suggest going with JSP and Servlets. Those are representatives of 2000-era technology that have little place in today's development landscape (Servlets definitely still have their use, but for specialized cases, not as a primary component for UI elements).
If you are not limited to page-oriented approach, I recommend you to take a look at Vaadin. It is based on GWT, but much easier to learn for a Java developer. I think the the functionality you need can be implemented in one or two Java classes.
I've the same use-case as you. Underneath I use Lucene as my search engine. The beauty of using IR libraries is that the search input screen is simplified. I have just 1 text-field on my web page (like www.google.com).
I'd suggest you stick to the basic web technologies of Java EE for this and those are Servlet and JSP. You describe the UI in JSP and have it POST it to Servlet and then Servlet will use a service layer for application logic.
I suggest if you don't have experience with Java Web app development, go for Servlet/JSP model. It's simple and intuitive. Also, JSPs can have Java code.
GWT is a bit complicated, so is Spring.
JSF
Wicket
JSP/Servlet
Servlet(JSP)||JSF & Elasticsearch||Solr
Yes jsf is the newer technologie but you didnt need something big for this project..
here is a nice example project https://github.com/scrutmydocs/scrutmydocs
Is any such frameworks we can build on ?
It should includes good-looking user-interface.
One framework to build a complete application.
i used Vaadin that is nice and easy
https://vaadin.com/home
There are plenty and all have some good parts people love about. Here your main concerns seems to build a nice UI. Then, I suppose, you need something like jQuery-UI/ZK/YUI or something in that area. The popular Java Web Frameworks will do little help in that regards.
After deciding on any of the UI frameworks, you can choose any popular web framework, consult your team/developers here. And look at this thread about Most Common Java Web Frameworks.
GWT, Icefaces, Richfaces, JavaServer Faces. There are many more you can search on the internet.
Using one framework to build the complete application depends on the type of application you are building. I will suggest the use of Java Server Faces (JSF).
I'm looking for what view technology would be considered the best approach for Spring MVC 3.0 which is flexible, maintainable and allows multiple rendering technologies such as HTML, PDF etc...
We're looking to develop our next web application using Spring MVC 3.0 and have settled on Hibernate for persistence but are still trying to decide which is the most appropriate view technology.
We will require support for PDF reports but would most likely write these using iText.
Are there any maven archtypes which would setup a recommended application complete with persistence and view technology?
The spring samples use a bunch of different technologies from JSTL to Apache Tiles, we've only ever used JSP in the past since we moved to .NET in 2003 and are moving back to Java now.
There's really nothing wrong with using JSP, if you use the most recent version. You can certainly choose Freemarker, Velocity and other cool viewer, but if your entire team is already comfortable dealing with JSP, you need to take account of your project deadline and all the learning curves when taking on a new technology. If it makes sense, sure, it doesn't hurt to learn another new thing.
In my case, I use JSP with Sitemesh as my template. I used JSP/Strut Tiles combo for quite awhile but I find the template to be too intrusive, Sitemesh seems to be more seamless to me because it doesn't clutter my actual JSP files with some Tile specific custom tags.
Below are a few.
Freemarker
Apache velocity
JSP (the new 2.1 alright with improvements like functions, simplified custom tags, etc.) with apache tiles
Here is a doc that talks about integration with view technologies
We are currently using Jsp 2.1 with spring webmvc 3.0x with apache tiles on google appengine and it servers our purpose quite well.
How about Apache Velocity
That's the most popular template engine I know of. Would like to get more suggestions though.
Update:
Freemarker is another
Source
If I were you, I would stick with jsps for now. You can mix and match your views in Spring if you decide certain flows will require something else. For example, you will need to use different view types if you plan to use any ajax style processing.
JSP : easy to use and maintain.
Other are Apache Velocity, Freemarker.
I personally would recommend JSP
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking to start developing for the web using Java - I have some basic Java knowledge, so that's not a problem, but I'm at a loss when it comes to deciphering the various technologies for use in web applications.
What options are available to me? How do they work? Are there any frameworks similar to Django/Ruby on Rails which I could use to simplify things?
Any links which could help with understanding what's available would be much appreciated.
Java frameworks come in two basic flavors. One is called the "Action" Framework, the other the "Component" Framework.
Action frameworks specialize on mapping HTTP requests to Java code (actions), and binding HTTP Requests to Java objects. Servlets is the most basic of the Action Frameworks, and is the basic upon all of the others are built.
Struts is the most popular Action framework, but I can't in good conscience recommend it to anyone. Struts 2 and Stripes are more modern, and very similar to each other. Both are light on the configuration and easy to use out of the box, providing very good binding functionality.
Component Frameworks focus on the UI and tend to promote a more event driven architecture based on high level UI components (buttons, list boxes, etc.). The frameworks tend to hide that actual HTTP request from the coder under several layers. They make developing the more advanced UIs much easier. .NET is a component framework for Windows. On Java, the popular component frameworks are JSF (a standard) and Wicket.
As a rule, if you're creating a "web site". that is something more akin to presenting information (like a blog, or a community site), the Action frameworks work better. These sites tend to be simpler, get bookmarked often, require "pretty URLs" etc. This is generally easier to do with an Action framework.
Component frameworks are much better for things like back office applications with lots of UI elements and complicated workflows. You'll find, particularly with tooling, that these style of apps will go together faster using a component framework. But component frameworks have more complicated request workflow, sometimes relying on hidden state, lots of POST actions, etc. Many have "horrible" URLs, and sometimes create pages that are difficult to bookmark.
Both frameworks can be used for both tasks, just some are more suited to the task than others.
None of these frameworks directly address persistence, but many have extension modules or idioms that work tightly with JPA/EJB3 or Hibernate.
Your basic java web technology is servlets. Servlets let you write Java code that responds to various HTTP events (doGet, doPost, doPut, etc). They're generally used for controllers in the MVC architecture.
Link: http://java.sun.com/products/servlet/
JSP lets you write HTML with embedded Java instead of the other way around (in servlets). JSP has been extended via JSF to incorporate more recent architectural advances. This is in the same line as PHP and ASP. This is the view portion of the MVC architecture.
Link: http://java.sun.com/developer/technicalArticles/GUI/JavaServerFaces/
A lot of more complex applications utilize Enterprise Java Beans (EJB) for session management, clustering, etc. This isn't a web technology, per se, but you see it go hand-in-hand when dealing with more complex webapps. Alternatives include frameworks such as Spring.
EJB: http://docs.jboss.org/ejb3/app-server/tutorial/
Spring: http://www.springframework.org/
Also, you'll want to familiarize yourself with ORM technology (after servlets and JSP/JSF). The leading ORM framework is currently Hibernate. This lets you map SQL tables to java objects and interact with them accordingly. This is more advanced stuff so save it for when you're trying to get your head around EJB/Spring, etc.
Link: http://www.hibernate.org/
edit: I forgot to define ORM. It stands for Object Relational Mapping/Mapper (whatever version of "Map" you feel like using :)
Start with JSP backed by logic in Java classes. Or use servlets.
The advantage of using JSP and Servlets is that you gain knowledge of what all the frameworks do under the hood. And that understanding is crucial to figure out how to do X in that particular framework.
Furthermore, JSP is very easy. You can easily see what you're doing and very easily see it when you mess up the view with business logic.
And quite a lot of frameworks (Struts, Spring MVC) use JSP as their view technology. It's a natural first step in web development using Java.
I don't know if there's anything quite as nice as Django for Java, but Spring has a light-weight web framework built on J2EE
http://www.springframework.org/about
A flexible MVC web application
framework, built on core Spring
functionality. This framework is
highly configurable via strategy
interfaces, and accommodates multiple
view technologies like JSP, Velocity,
Tiles, iText, and POI. Note that a
Spring middle tier can easily be
combined with a web tier based on any
other web MVC framework, like Struts,
WebWork, or Tapestry.
something like grails ?
there is also the projects from spring
You'll need to start with servlets and JSP. There are many web frameworks in Java and all of them are based on these two technologies.
You could try Jboss Seam : http://www.seamframework.org/Documentation/GettingStarted
If you are using Eclipe as your IDE there is good integration via Jboss Tools or you can use the Seam-Gen tool that comes with Seam. This allows you to define a database table (or tables) and with a few easy commands, build an entire runnable web project from it. It's a nice way to get the ball rolling.
Also Java Server Faces
http://en.wikipedia.org/wiki/Java_Server_Faces
This is a very open-ended question. The short answer is "yes" there are frameworks, libraries and standards to do everything from writing things at the HTTP request level up to content management systems in Java.
You can also use other languages (e.g. Python, Ruby, etc) on the JVM for that matter.
For some of the Java-only technologies, investigate JSP/Servlets, Struts, Struts2 (which is the updated version of Webwork), Spring MVC, Tapestry, web4j, Wicket.
There are other frameworks built on the JVM but use languages other than Java such as Grails.
To get started I would download Eclipse (latest version) and Tomcat. Create a new web application in Eclipse. There are guides that can get you started.
Start with learning how JSPs and Servlets work, these are a bit low level and aren't really a framework, but will let you get up and running quickly. From there investigate and choose your framework.
Spring MVC is pretty easy to get set up and going. I'm certain there are others.
If you already know Ruby On Rails, you can use it with JRuby and deploy to a Java server (like Tomcat) with Warbler.
In pure Java, Wicket has a good approach and is getting quite popular.
Before studying those frameworks, why not study first where it all started? Try programming with servlets first, so you could a peek at the core of most of those java web frameworks. It would help you understand J2EE better.
J2EE is the standard. You can use this to build apps with Java Server Pages, Servlets and EJBs.
Struts is also a very popular framework that uses JSPs and Servlets. Its a bit tricky to get setup but it is a very good option for mid size sites.
http://en.wikipedia.org/wiki/Struts
In general Java is more component-based, i.e. you don't have frameworks that do it all for you (you'll probably have to pick a database access framework yourself, for example). For Data Access I'd recommend Hibernate or iBATIS.
For the front-end there are literally hundreds of frameworks around. Investigate JSF, Wicket, Struts 2, Stripes - whichever one you use depends on your specific needs as they all have different strengths.
And for a business layer I'd recommend the Spring Framework, which is very comprehensive and has a great reference guide / tutorial :)
I learned Java in college back when it was in version 1.1.5. I recently started trying to program for the web, but it didn't make sense until I read Head First Servlets and JSP. There are way more things involved in web development with Java than I ever realized, and without this book, I would have quit and just used PHP.