开发者

What web programming languages are capable of making this web app?

开发者 https://www.devze.com 2023-02-02 16:12 出处:网络
I\'m exploring many technologies, but I would开发者_开发问答 like your input on which web framework would make this the easiest/ most possible.I\'m currently looking to JSP/JSF/Primefaces, but I\'m no

I'm exploring many technologies, but I would开发者_开发问答 like your input on which web framework would make this the easiest/ most possible. I'm currently looking to JSP/JSF/Primefaces, but I'm not sure if that is capable of this app.

Here's a basic description of the app:

  1. Users log in with their username and password (maybe I can somehow incorporate OPENID)?

  2. With a really nice UI, they will be presented a large list of questions specific to a certain category, for example, "Cooking". (I will manually compile this list and make it available.)

  3. When they click on any of these questions, a little input box opens up below it to allow the user to put in a link/URL.
  4. If the link they enter has the same question on that webpage the URL points to, they will be awarded one point. This question then disappears and gets added to a different page that has a list of all correctly linked questions.
  5. On the right side of the screen, there will be a leaderboard with the usernames of the people with the top ten points.

The idea is relatively simple - to be able to compile links to external websites for specific questions by allowing many people to contribute.

I know I can build the UI easily with Primefaces. [B]What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.[/B] I can do this with python easily by using urllib, but I can't use python for web GUI building (it is very difficult). What is the best approach?

Any help would be appreciated!!! Thanks!


The best approach is whatever is best for you. If Python isn't your strength but Java is, then use Java. If you're a Python expert and know little Java, use Python.

There are so many resources on the Internet supporting so many platforms that the decision really comes down to what works best for you.


For starters, forget about JSP/JSF. This is an old combination that had many problems. Please consider Facelets/JSF. Facelets is the default templating language in the current version of JSF, while JSP is there only for backwards compatibility.

What I'm not sure is if JSP/JSF gives the ability to parse HTML at a certain URL to see if it contains words.

Yes it does, although the actual fetching of data and parsing of its content will be done by plain Java code. This itself has nothing to do with the JSF APIs.

With JSF you create a Facelet containing your UI (input fields, buttons, etc). Then still using JSF you bind this to a so-called backing bean, which is primarily a normal Java class with only one or two JSF specific annotations applied to it (e.g. @ManagedBean).

When the user enters the URL and presses some button, JSF takes care of calling some action method in your Java class (backing bean). In this action method you now have access to the URL the user entered, and from here on plain Java coding starts and JSF specifics end. You can put the code that fetches the URL and does the parsing you require in a separate helper class (separation of concerns), or at your discretion directly in the backing bean. The choice is yours.

Incidentally we had a very junior programmer at our office use JSF for something not unlike what you are requesting here and he succeeded in doing it in a short time. It thus really isn't that hard ;)


No web technology does what you want. Parsing documents found at certain urls is out of the scope of building web interfaces.

However, each of Java's web technologies will give you, without limits, access to a rich and varied (if not too rich and much too varied) set of libraries and frameworks running on JVM. You could safely say that if there is a library for doing something, there will be a Java version available. Downloading and parsing a document will not require more than what is available in the standard library (unless you insist on injecting your dependencies or crosscutting your concerns), so no problems with doing your project with JSP, or JSF/Primefaces, or whatever.

Since you claim to already know Python, and since you will have to add some HTML/CSS anyway, I suggest you try Django. It's dead simple, has a set of OpenID plugins to choose from, will give you admin interface for free (so you can prime the pump with the first set of links).

0

精彩评论

暂无评论...
验证码 换一张
取 消