Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Java Web Development

Presentation on Java web development frameworks.
by

Andreas Nilsson

on 18 April 2010

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Java Web Development

Java Web Development ...and trying to make sense of it! Andreas Nilsson Java Web can be a mess! Today we'll focus on Spring MVC GWT Struts2 Agenda A little bit of history.
A short overview of important design patterns.
Diving into Struts2.
Then onward with GWT.
Ending with Spring MVC.
...and concluding with a short summary. A history of the web In the beginning there was this... #!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach $key (keys %ENV) {
print "$key --> $ENV{$key}<br>";
} Java introduces the “servlet” concept
Essentially the Java counterpart of a CGI-script
A Java component that renders HTML A history of the web public class HelloServlet extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
PrintWriter out = resp.getWriter();
out.println("<html><body><b>Hello World!</b></body></html>");
}
} New concepts A servlet was/is a Java component that generates HTML
A JSP page is/was an HTML page that contains Java code
...still a servlet though! <%
String name = request.getParameter("name");

if (name != null) {
%>Hello <%= name %>!<%
}
%>
<form action="myjsp.jsp" method="get">
<input name="name">
<input type="submit" value="Send">
</form> JSP 2.0 & JSTL Java code in JSP pages turns out to get confusing and complex
JSP 2.0 added an “Expression Language” (EL)
Logic becomes intermixed with the standard HTML tags
JavaServer Pages Standard Tag Library (JSTL) adds tags and functions <html>
<body>
<jsp:useBean id="nameBean" class="my.NameBean" scope="session" />
<jsp:setProperty name="nameBean" property="name" />

<c:if test="${nameBean.name ne null}">
Hello <c:out value="${nameBean.name}" />!
</c:if>

<form action="test.jsp">
What's your name?
<input name="name">
<input type="submit" value="Send">
</form>
</body>
</html> JSP 2.0 & JSTL still a mess on its own! <html>
<body>
<jsp:useBean id="nameBean" class="my.NameBean" scope="session" />
<jsp:setProperty name="nameBean" property="name" />

<c:if test="${nameBean.name ne null}">
Hello <c:out value="${nameBean.name}" />!
</c:if>

<form action="test.jsp">
What's your name?
<input name="name">
<input type="submit" value="Send">
</form>
</body>
</html>
Full transcript