Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A stack of JavaEE demo projects including JDBC, JSP, Servlet, Hibernate, Spring and Struts. And small projects for micro-services.

Notifications You must be signed in to change notification settings

YUMMYER/JavaEE-stack

Repository files navigation

JavaEE-stack

A stack of JavaEE demo projects including JDBC, JSP, Servlet, Hibernate, Spring and Struts. And small project for micro-services.

  1. JDBC (Java Database Connectivity)
  2. Hibernate

Note for myself

Servlets

 To forward requests:
 - getRequestDispatcher(url).forward(request,response)
 To redirect responses:
 - response.sendRedirect(url)
  1. Context Param Elements;

<context-param> <param-name>farruhx</param-name> <param-value>hxls</param-value> </context-param> .getServletContext().getInitParameter()

  1. Specific one inside servlet <init-param> </init-param> .getServletConfig().getInitParameter()
 To use EL
 - ${attribute.property}
 <%@ %> directive - To set conditions that apply to the entire JSP.
 <% %> scriplet - To insert a block of java statement.
 <%= %> expression - To display the string value of an expression.
 
 To use Session
 - HTTP is stateless protocol
 - FTP is stateful protocol
 
 To get the session
 - HttpSession session = request.getSession();
 session.setAttribute("product",product);
 
 To remove an object
 - session.removeAttribute("code")
 
 General methods of session object
 -getAttributeNames();
 -getId();
 -isNew();
 -setMaxInactiveInterval(in seconds);
 -invalidate();
 
 Thread safe
 -final Object lock = request.getSession().getId().intern();
 synchronized(lock){
 cart = (Cart) session.getAttribute("cart");
 }
 
 To create cookie
 - Cookie(name, value);
 - setMaxAge(seconds);
 - setPath(path)
 - getName();
 - setName();
 - addCookie(cookie);
 - getCookies();
 ex. response.addCookie(c);
 
 To disable EL for single page
 <%a page isELIgnored = "true" %>
 
 For the entire application(web.xml file)
 
 
 
 *.jsp
 true
 
 
 
 To disable scripting
 
 
 
 *.jsp
 true
 
 

About

A stack of JavaEE demo projects including JDBC, JSP, Servlet, Hibernate, Spring and Struts. And small projects for micro-services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /