I hate Vue seriously!
Love Vue.js, seriously!
Vue.js is absolutely amazing. Everything is so natural and so simple and do exactly what I want. Want to filter some content grab a bunch of radio buttons, make a value for them and use v-model, assign to a data function and pfff done.
@jlrdw each to their own I guess ;)
But I LOVE Jquery.
I love react, but I actually work with mostly server rendered app where I need a little bit js to work with. In this case react feels overwhelmed, where vue feels more natural to me. If I create a full blown SPA the I will definitely use react but otherwise I will use vue.
Vue is the best thing ever.
I agree. ^
Best thing ever
I agree laravel is as far as PHP frameworks go, you can write a complete database application just using laravel and a little Jquery to help, such as a pop-up calendar. Laravel can stand on its own but vue cannot. But unfortunately none of the PHP technologies even come close to Java Beans, servlets, and JSP. But they are closer now than a decade ago.
@jrdw It would be great for us PHP developers if you could share some of your own experiences using Servlets compared to PHP. What is JSP? Isn't that JAVA's JavaScript bridge I have heard about? I have always read JAVA is slow and hard to learn.
I love AngularJS
I for the moment like polymer. Vue is great, but I think web components are better.
@LoveAndHappiness I never used Polymer. How is that different from Vue's components?
To each his/her own for sure. I love vue for simple use case as it's light weight and easy to use. Use it with or with out jquery and of course use JavaScript code.
The other frameworks definitely have there place and use cases too.
Maybe my noobness but ran into an issue with ie (not edge) that I couldn't resolve with vue but used jquery in the vue ready function. On click for a checkbox. It just wouldn't work with computed using v-model and vue's click event.
Also vue as a client side works to fast for the server to catch up and had to add delays (loading circle thing) to some elements. If you post a comment, then edit right away, then post the edit it can fail sometimes as the update might fire (if the user is fast) before the comment has been fully created.
@jimmck No, JSF stands for Java Server Faces and JSP is Java Server Pages, something like Blade in laravel but with more abilities. Servlets by the way are a Java program that extends the capabilities of a server. Although servlets can respond to any types of requests, they most commonly implement applications hosted on Web servers. @jlrdw There are plenty of reasons why I passed from J2E (JSF, Maven, Tomcat) to PHP (Easier, larger communities). Main reason for my case was the fact that most clients would prefer buying a simple hosting for the app I'll sell rather than managing a whole tomcat based VPS (more cost, more knowledge requested).
@bluepenlabs Thanks. Can I write CLI servlets like I can in PHP?
Vue is simply the best :(.
No it's not.
@jimmck
Haven't done java technology for 9 years now but wipped up example quick, not a complete program.
Servlet code getting a list from a bean class:
package pdao;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;*/
import java.io.*;
import java.sql.SQLException;
import java.util.List;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author jimwin7a
*/
public class petdisplayserv extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
/*
section not used part of generated servlet.
*/
} finally {
out.close();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
pdao.PetDAO petDAO = new pdao.PetDAO();
String t1;
t1 = request.getParameter("t1");
petDAO.sett1(t1);
try {
List<Pet> pets = petDAO.list();
request.setAttribute("pets", pets);
request.getRequestDispatcher("petlist.jsp").forward(request, response);
//above line sends data to view
} catch (SQLException e) {
throw new ServletException("error msg here", e);
}
}
/////rest of servlet unused
Bean code
package pdao;
import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.List;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author jimwin7a
*/
public class PetDAO {
String t1;
int offset = 0;
int rowsperpage = 0;
public void sett1(String t1)
{
this.t1 = t1;
}
public String gett1()
{
return (this.t1);
}
public List<Pet> list() throws SQLException {
Connection connection = null;
PreparedStatement st = null;
ResultSet resultSet = null;
List<Pet> pets = new ArrayList<Pet>();
try {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(PetDAO.class.getName()).log(Level.SEVERE, null, ex);
}
offset = 5;
rowsperpage = 5;
connection = (Connection) DriverManager.getConnection("jdbc:mysql:///petback2", "root", "secret");
st = connection.prepareStatement("select * from pets where petname like ? LIMIT "+ offset + ", " + rowsperpage);
st.setString(1, this.t1 + "%");
resultSet = st.executeQuery();
while (resultSet.next()) {
Pet pet = new Pet();
pet.setpetid(resultSet.getString("petid"));
pet.setpetname(resultSet.getString("petname"));
pets.add(pet);
}
} finally {
if (resultSet != null) try { resultSet.close(); } catch (SQLException ignore) {}
if (st != null) try { st.close(); } catch (SQLException ignore) {}
if (connection != null) try { connection.close(); } catch (SQLException ignore) {}
}
return pets;
}
}//end
view the jsp page
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page language="java" import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>Pet List</title>
<script type="text/javascript" src="include/jquery.js"></script>
<script type="text/javascript" src="include/myjq.js"></script>
</head>
<body>
<div style="height:300px; width:700px; max-height: 400px; display:block; overflow:scroll; border:crimson solid; ">
<table id="myTable" border="1" width="600">
<tr>
<td width="119"><b>ID</b></td>
<td width="168"><b>name</b></td>
</tr>
<c:forEach items="${pets}" var="pet" >
<tr>
<td width="100">${pet.petid}</td>
<td width="168">${pet.petname}</td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
A real site would have connection pooling, pagination links in view, login, etc
Edit: You mentioned a comparison, a long story short, to auto fill fields and since we were on an intranet (secure and only for dispatchers at trucking co. ) I didn't use AJAX to auto fill some form fields, I actually got the fields from child lookup table using only getElementById. Kinda a no no, but I would never get secure data that way.
Tomcat is a nightmare to setup. Setting up the server we left to a professional company. I finally got tomcat setup on
a local server. But now there's Glassfish, much easier.
Java Server Faces and Facelets doesn't like jquery, at least I never got the two working. So I stuck with
Java Server Pages, Servlets, And Beans.
There were alot of files and servlets in application all hand written.
Towards the end I learned how to use jquery to lookup data. Like this example - hit play.
https://onedrive.live.com/redir?resid=72C2FB003E9E7860!118&authkey=!AJK71sIpP45kMVA&ithint=video%2cwmv
Example is php, but jquery works same with jsp as php, no different.
If php was what is is today, back then, I would probably use php. At the time, I had to use java. Both can do the same things.
Hey! Why would one choose React over Vue for a complex SPA? I am planning on making one. But with Vue... should i not do it?
I know basic React, not enough to know this answer.
Vue is great, you:
- Don't need to store your data in "data-value" any more, your data is invisible, very data-driven way
- Think about the logic of your app, not dealing with those DOM
- It just the view, can be easy integrate with any other framework, library or vue ecosystem as well
At one time it seemed this was mostly a laravel forum, why all the stuff on client side viewing which has nothing at all to do with a database management system, which is what laravel is. What is the big deal with the client side viewing, there are hundreds of ways to accomplish that. And That Vue thing is still just javascript period, so matter how you rosie it up. A pig sprayed with perfume is still a pig.
@jlrdw Can you make a house with just bricks? No, you need steel, mortar, dry wall, tiles, paint, wiring and a whole lot more.... I like learning everything on this site... if this was just laravel laravel... won't be fun and won't be useful...
@notanerddev You are missing the point, you could write an entire database managed website with laravel and no javascript. You cannot write a database managed website with Vue, it's client side code. And it's still just javascript. I guess I am one sided that way because all I ever delt in is database management / programming. I was programming dbase 3 in DOS before windows even existed.
I agree it would be hard to accomplish some things without javascript, such as a nice popup calander, so a user can choose a date. But besides AJAX, javascript has nothing to do with database management. People learn laravel to write dynamic (data driven) web sites.
I had to create a form that had a dynamic number of inputs. Each order can have many units. Each unit can have many parts. Using Vue.js simplified that process 100-fold, and it made the user experience much, much better. Using jQuery would have been a huge pain. Using no JS would have been a huge pain.
In this scenario, was it necessary to use Vue.js? Nope. But did it make everyone's life better? Yes. So I'm not understanding why you have such a problem with it.
Well a simple example, Jeffrey could have paginated with some javascript library, but regular pagination is used here so when you go from page 1 to page 2 on post its regular. Now my user experience, feelings, or whatever is just fine with that. My point is a page reload does not hurt anybody and does not take away anything from us. I haven't seen one complaint yet concerning Ajax not being used for pagination. And no matter what you say too much JavaScript on a page makes it a herky jerky site to navigate. A little is fine for enhancements.
@jlrdw For a website, sure, it's about displaying contente and saving some of it through a couple of forms. For a web application, it's all about the UX and interactivity. Also, letting the client perform the heavy presentation logic, makes an infinitely scalable app. Believe me, we have customers every day complaining about lack of intuitiveness, unnecessary page loads and clicks. UX and simplicity are the main attraction points for customers.
I totally agree with @JeffreyWay . :)
@jirdw @JeffreyWay Completely off topic:
@jlrdw - But since you bring up pagination I'm going to point out again that theres a bug with it. I reported it here before
https://laracasts.com/discuss/channels/site-improvements/issue-with-pagination
I'll predict that when this thread gets to 30 posts, and you click on the "Last Upated" link it'll take you to page 3 where there wont be any post.
Jeffrey - Please fix it and spare my ocd
regards
l.
Vue.js is the best +1
Please or to participate in this conversation.