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
Related
I have always been a front-end Java programmer, sometimes had to do C# on .NET but for the most part, Java is probably all I know about.
Just currently I have to do a small-scale website doing extremely simple thing and I really don't know where to start. My HTML skill is probably as good as I am with XML on Android, which is fair to say far less complicated than the HTML source code modern website have. I have almost no experience with PHP either, and no strong background on building or managing a database.
Is there some sort of technology that builds fully working website using mainly Java? It may have other languages I have to familiarize with but for the most part, I'd like to have little learning curve. For the backend I'm very sure I'm going to use cloud server services like Azure or Parse.
This is a very special project of me so I can't let anyone code it rather than me and myself only. Thank you and have a good day.
Use Servlets and JSPs for web development it's a start point and then java webservices as you already know XML.
I suggest you to build all your front-end using the following set of technologies: HTML5, AngularJS, JQuery, javascript, bootstrap. Your backend could exchange json with the front-end. The Bootstrap is the base for all your website and you could get a free template from the web itself, which would severely reduce your hard work at web designing. You would need just to adapt the links and calls, and the AngularJS would handle the controller and other stuffs ( have a chance to learn about ). Some JQuery components, or even AngularJS components would enhance your system usability and combined with javascript would bring most of hard work to front-end. I had the chance do start a system from zero and this is what I did, and now I have an AngularJS app working together with java by having java on the backend ( spring, hibernate, etc ) receiving and providing json data. At github you find some angularjs seed examples which you could use in your app and, again, save time and effort.
My apologies in advance, My answer is a bit broader in scope,
The Best Development Model for developing any website regardless of your language choice in Azure App Service is to take advantage two powerful features offered by Azure App Service, the Continuous Deployment feature and Deployment slots.
Start your website on a git repository and you may have node modules or bower packages, but on build your git will crunch it down to a working website with proper gulp files. Check out this blog to understand the process.
Once you have the git repo working for a simple website, your development process becomes much smoother. You can commit a change and Continuous deployment will automatically start a deployment for you to get your latest bits into your web app.. Check this blog for more details on Continuous Deployment.
You can use deployment slots to stage your changes and swap to maintain multiple versions of your web app on the cloud to easily build a production level application that has a last known good state. Check this blog for more details on Deployment slots.
The two features are the most used features while developing, deploying and servicing any project I work and I have found them very useful to understand them and use them in all their glory.
I am not a Java developer, but from the your question I can see you are looking to start on web development, the quick and powerful way (purely subjective here :D) is to use Asp.Net 5 with Angular 2 Beta. Here is an end to end tutorial on how to setup a development environment. Asp.Net 5 should be friendly toward Java developers as it is very light weight and simple to use and works great with vscode and visual studio community edition.
Let me know if the long answer helped, if you need a pure java environment that should be possible too :).
I am new to both JAVA and Google App Engine. My Interest in Java stems from its compiled nature, speed and widespread enterprise use, whereas my interest in app engine is mainly because of it's initial free nature along with scalalbility.
I have been through Google's Getting Started and FAQ, I have modified the guestbook app and generally played around with the datastore, creating a simple entry system for use at work, using database schemas similar to the guestbook app. I come from a hackish PHP background, and most of my app consists of JSP pages with HTML and scriptlets mixed, with classes for the datastore stuff.
I have read about JSP, JSTL & JSF(not much) and also the basics of appengine, it's limitations,strengths and quotas. I also understand that my current approach is flawed. I have searched for JAVA frameworks and found one too many. I have been through the Will it play in App Engine list, but I do no half of the stuff mentioned there. I understand that webapp(used in the overview) is a framework and so is GWT. I understand I have to learn core java first.
What framework should I begin with which is easy to use and also robust/secure enough to handle a financial app? The framework should also have value, if I were to host it in a pure J2EE environment independent of App Engine.
I would appreciate a word on study resources too. Currently I see this book on amazon as a resource but are there cheaper alternatives like a library with a monthly subscription from where I can peruse similar books.(and I know that Google is a real good resource.)
Are there any developers here who have apps hosted on appengine java and would like to share their personal experience of appengine java with a beginner?
I use Eclipse with the Google App Engine plugin to develop and upload my apps.
Regardless of what you want to do in Java you absolutely need to learn your way around the core language and the basic part of the runtime library.
The Java Tutorial covers this and is pretty straightforward.
Then you need to learn the Servlet API which underlies almost all Java-based web solutions today. Sun puts this in the full Java EE tutorial (which is a bit heavy) so have a look at this quick overview.
When you have gotten so far, you have a much better idea of what your basic toolbox is, and can give information allowing to give better advice on what technologies you should choose.
Sorry for the steep learning curve, but the view on top is fantastic.
If you aren't doing Java development currently, and/or haven't done much web development. I definitely wouldn't complicate things with adding frameworks.
What are you trying to accomplish that you need a framework for outside of the Google App Engine stack?
I've been developing with Java for years and only started using Spring with my Google App Engine app because I need a good security and authentication option. I wish I didn't have to use it since it's a rather steep learning curve.
You should be able to do most everything you need to for a simple app with JSP. If done correctly you can even do it in MVC if you wish.
On top of everything else people have recommended, I suggest you take a look at Objectify, a much simpler datastore API than the JDO/JPA ones included in the App Engine SDK.
This is, of course, after you've gotten familiar with the core of Java first.
I'm asking this question because I'm having some difficulty choosing a framework (or selection of technologies) that I can learn and use for developing a web-based UI for a small Java application:
For background information relating to the app I'm developing please read this question:
So, developing the Java application is going ok and now I'm in a position where I would like to develop a web-base UI for it.
The application and database (MySQL) currently run on a Debian Linux box, as such I've decided that it would sense to use Tomcat to run the Web App. The Web App is to serve the following purposes:
1. Manage the execution of the App by CRUDing data from the MYSQL database.
2. Display status information about the app (i.e. what orders it's placed, what orders are pending, etc.)
3. Produce on demand reports on stuff like the running profit and loss, historic and realtime prices and pricing analytics
So far so good now here's the problem:
There are a bewildering number of choices for how to develop the UI, to name a few I've looked at:
JSPs + Spring MVC
JSPs + Sping WebFlow
JSPs + JSF + Facelets
Wicket
JSPs + JSTL
etc, etc...
The choices seem endless. Is there's a clear industry standard for developing web based UIs using Java related technologies? If so what is it? Ideally I would like to learn a framework which I can use in the majority of real world jobs (and preferably one which can be used from Eclipse).
Thanks and Kind Regards
Personaly, I prefer another approach,
I would go for Eclipse of course, Spring (or other IOC container), Hibernate / JPA + JAX-RS or JAX-WS for the server layer, but not nessecarily JSF / JSP for UI.
For presentation layer, I would rather go with Flex, GWT, or a JQuery in an SOUI approach. (the service layer returns incremental updates in the form of XML or JSON, I swore not to mention the term AJAX)
Your service layer would serialize partial object graphs by demand from the presentation layer, which will act as a disconected client (work on an "offline" dataset , and update dirty on demand)
But that is just my wet dream, and in my current project I'm stuck with Spring MVC, and JSP + JSTL
I would give Jboss SEAM a test drive, just because Gavin King is behind it, but I think its JSF based.
I don't know why I don't see JSF as a SOFEA / SOUI approach, as JSF and AJAX go together well, but for some reason, JSF didn't win my enthusiasm as much as the above suggestions (Flex as a favorite)
See my related question: Web architecture: MVC, Lazy initialization, Data transfer Objects, Open Session In View, is there a consensus approach?
Is there's a clear industry standard for developing web based UIs using Java related technologies?
Well, Sun's Java EE standard is Java Server Faces (JSF) but the version 1.x of JSF is IMHO a kind of failure. This explains why they are so many alternative out there. But NO, there is no clear winner.
Ideally I would like to learn a framework which I can use in the majority of real world jobs (and preferably one which can be used from Eclipse).
Actually, Matt Raible has done very famous presentations on presentation frameworks that you'll find in Comparing JVM Web Frameworks Presentation (the latest version goes beyond Java frameworks only). Really, have a look at both of them, this is very, very good material (with real life metrics).
Personally, I'm a JSF 1.x skeptic so I would not go in this direction (there isn't lots of demand for JSF in my country anyway) but rather choose an alternative. I think that Struts 2, Spring MVC, Stripes (this one is my preferred one), Wicket (this one is getting more and more attention) are all decent choices, they'll all get the job done, the 2 first one being I believe more asked on the job market (but not the smartest). For the final choice, I'd follow Matt's advice: Eliminate, Don't Include. If the popularity on the jobs market is an important criteria, then I guess Stripes and Wicket will get eliminated. If configuration verbosity is a concern, Stripes wins. If you're looking for a kind of Swing experience, Wicket is your friend.
Now, I need to mention that the freshly released JSF 2 and CDI (JSR 299) should be a big improvement (according to the people who worked on it). As I said, I'm a JSF skeptic and I need to take a second look (because Gavin says so). But I still didn't so I can't say anything for now and I won't make any bet on the adoption and future market demand of this new version. But it's worth noting that JSF 2 with CDI should be a really new and different experience.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I've been doing PHP/MySQL web development for a while and I'm fairly competent in it. Lately however, I've learnt Java and fallen in love with it, and I'd really like to do more Java work now.
I've gotten my first opportunity with a client who needs a web 2.0ish web app built, and he has agreed to let me use anything I want to, including Java. However, I haven't done any web dev. in Java before, I've only went through the official Java tutorial, learnt a bit about applets and build a 2D pacman game, and have done some simple work in Google Web Toolkit.
I need to get started with this project in the next 2-3 days max, so I don't have much time to read long books about the topic. This is what I've learnt so far:
Setup a Tomcat on my dev machine to work with Eclipse
Learnt the basics of servlets, the doPost(), doGet() and init() methods, etc
Built a mini MVC app which displays a HTML page, lets you pick something from a dropdown and when you hit submit, it retrieves your submitted value through request.getParameter() in the doPost() function, and then forwards on to a JSP page which shows which value you picked.
I think these are the next few things I'd need to learn:
How to access/use databases
Sessions and Cookies
Possibly more about the syntax of JSP pages.
There seem to be hundreds of topics about Java web dev which I don't know anything about., but I don't have time to learn everything. I need someone to point out any other crucial things I'd need to learn, in order to build this web app (with perhaps 20 screens) using Java and Google Web Toolkit.
Also, I'm coming from a CodeIgniter background which is an MVC framework in PHP that makes things like form validation, sessions management (it uses database sessions), pagination, and common tasks like these very easy. If there is a similar, lightweight framework in Java that can take care of things like this, please mention it as well.
Thanks.
You should skip basic servlets and use a web framework, from Struts + Tiles (simple to get to grips with - a few hours at most) to Spring, etc. In your case I would also use Hibernate for database abstraction - you don't get up to speed with JDBC in such a short time.
There are so many different Java Enterprise technologies it's pretty hard to know where to start. As previously mentioned, the head first JSP & Servlets book is excellent. I currently work on an Enterprise app that was made years ago with just Servlets. We have migrated over to JSP's as time has gone on but we are not using any of the newer frameworks. So it is for sure a valid way to do it, although dated.
The thing about java, is that most enterprise development is a conjunction of a bunch of different technologies. For example, you could create an app using JSP's for the views with a Servlet back-end, using Hibernate for you DB connections, JDOM for your XML, JUnit for your testing framework, Log4j or AspectJ for your logging framework, Lucene for search, JBoss for deployment (and deployment can be pretty non-trivial) etc. etc. etc. You aren't going to go out and learn all of those technologies in the next 3 days.
What I would suggest is (as previously mentioned) to pick a framework, and there are many to choose from such as Tapestry, JSF, Wicket, Struts, etc. that will abstract away a lot of the underlying technologies. Any java technology you pick will have a good community behind it willing to help.
Another thing to consider, since you seem to be in a hurry to get things working, is that (in my opinion at least) Java is not a FAST language to build things in. It is very verbose and unless you grasp the nuances of good Java web design it is very easy to shoot yourself in the foot. Perhaps you should look at some of the other technologies that are available on the JVM (so that you have all the Java libs available) such as Groovy.
Groovy allows you the ability to program with Java syntax if you choose, or a dynamic Ruby-like syntax. Additionally, Grails is pretty much a Rails clone for Groovy and will let you write a web app in no time at all.
Whatever you choose to do, good luck and welcome to the wonderful world of Java Web Apps.
As a start, I would recommend you pick up Head First Servlets & JSP. It will give you a nice overview of Java web development. From their you would be better able to pick a web framework to use.
I'd recommend Matt Raible's app fuse .
It will give you a crash course in hooking your app up to a database, using a mvc framework, as well as some of the java build tools.
This App fuse demo will show how quickly he gets things rolling.
For basic simple java based web-app follow below things
Install IDE (eg. eclipse,netbeans)
Install web/application server (eg. Tomcat/Jboss)
Configure server in IDE
Create new dynamic web project with JSP/Servlet
learn/develop and run sample applications which includes advance technology like Spring,Struts,Hibernate,EJB etc.
I believe design is more important than technology, so keep learning design patterns. all major frameworks are based on different design pattern.
I would suggest that you try JSP first. JSP is simpler since you don't have to deal with the underlying server technology, not for simple applications atleast. It will get you up to speed. Later, as you gain experience, you can use servlets directly.
It will also fit well with your PHP intuitions.
It's true that starting with Java Web development is not as easy as PHP, especially with CodeIgniter, a framework that I've fallen in love with.
I'd recommend Grails, but first pick up a book on the subject. I've found that in order to get productive quickly you'll need a proper reference. Personally I used The definitive guide to Grails.
I would recommend grabbing a copy of the Servlet 2.5 Specification for reference purposes. It's a fairly nice read, and not too dry for a specification.
It explains about Sessions, Filters, Listeners, threading model, etc...
Also, take a look at the JSP Model 2 architecture (better link) which explains the best use of servlets and JSPs.
I wouldn't recommend looking at Struts or Spring if you only have a few days to get up to speed from scratch. Once you have gained familiarity with servlets and JSPs, then you could look at Spring MVC for an approach that supports easier unit testing for controllers.
You should better learn basic servlet and JSP lifecycles before you touch any framework.. that ll be better, coz you will have a good grasp of the inner workings.. Head First Servlets and JSP is the book you should go for..
I would consider using Groovy on Grails. It's a lot easier to get started and it has a lot of of things that you need built-in. GWT is available via a plugin as is JQuery.
The nice thing about Groovy is that it is basically a superset of Java with the great quick start speed of Rails.
And it will deploy as a .war to your Java EE app server.
I love the Sam's book, 'Teach yourself J2EE in 21 Days'. Awesome for concept reference and basic syntax. Should be pretty cheap by now too.
If you have a Java based web application (J2EE webapp - never mind which other underlying frameworks are being used), and you wanted to introduce a Flash based front-end, would you use Laszlo or would you rather expose a ReST-like XML interface and build and deploy a Flash application that uses that?
On one hand, Laszlo is quite amazing - doing for Flash what JSP does for HTML. It is easy to work with. It fits in very well with the rest of the web application (which is JSP based).
On the other hand it might be better to develop a complete Flash app decoupled from the server and use an XML-over-HTTP mechanism to bind the two. This would have the added advantage of being able to use the same XML interface for an AJAX front end if needed.
What would you do, and why?
I would create the contract-first services, deploy them separately, and then write the RIA client to access them.
Coming up with the schema first has the added benefit of completely decoupling the two during development. The RIA developer can create some synthetic XML streams to use for data while waiting for the services to come on-line.
I might have considered Laszlo in the past, but today, I'd stay within the Java stack and use JavaFX.
Laszlo is the product that never made it, there isn't a big enough ecosystem of developers around it.
I'd use Adobe Flex for the front end. The same benefits of using a markup language for doing flash, but it has a much larger developer base and open source projects to draw upon. For the data communication, use either REST or if you want to get clever, use BlazeDS.
OpenLaszlo is a complete RIA framework, so I'm pretty sure that you can 'compile' it to a completely standalone app that communicates with the server over HTTP. It's really very similar to Flex. The advantage Flex has is a much bigger community, a full-blown IDE, and more resources (Adobe), while OpenLaszlo is a little more innovative in that you can deploy to Flash or AJAX from one codebase.
I've actually spent some time working on a implementation similar to what you're suggesting. I had a complied Open Laszlo front end embedded in a web page with a Django (a python MVC library) REST interface on the backend and no Open Laszlo server. It works reasonably well, but there are a couple of things to watch out for. Open Laszlo only supports calls to GET and POST, so you won't be able to easily use the DELETE and PUT methods in your REST API. The other is the lack of community around Laszlo (as mentioned elsewhere). I can sometimes be frustratingly difficult to answer some basic questions when using Laszlo, particularly around the XML HTTP API and XML replication features in the framework. I personally never really looked at the Laszlo back end server seriously as I wanted an open API that could be consumed easily by other clients.
All this being said, the implementation does work and can be effective if you're willing to work around the limitations mentioned above. Plus Open Laszlo is free, which can be a really big plus if your working on a budget.