![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JEE
文章平均质量分 76
iteye_9496
这个作者很懒,什么都没留下…
展开
-
jee6 学习笔记 1 - 开发环境的配置
jee不停地折腾,好像09年推出了jee6,但我们还在用jee5。从jee5开始,jee将ejb技术进行了改良,增加了注入功能,减少配置文件,这是好事。在ejb3基础上,jee6进一步简化,推出了ejb3.1/jsf2.0从编程的角度出发,jee6还是利用annotation来简化开发。有几个显著特点:如利用@ManagedBean 来代替在“faces-config.xml”中的配置;e...原创 2012-07-03 13:29:31 · 254 阅读 · 0 评论 -
pass params to primefaces confirmation dialog box
<p:dataTable id="idStuDataTable" var="vst" value="#{ss.searchResultList}" >......<p:column><p:commandLink id="idDeleteButton" title="Delete Student" value="de2012-09-28 19:30:27 · 81 阅读 · 0 评论 -
Handle Big Dataset with Real Pagination with Primefaces 3.3 LazyDataModel
If you have millions of records in your database, you would like to use real pagination to provide viewing of the data. By "real" (or true or proper, whatever) pagination, it means that the searching...2012-09-21 13:41:40 · 191 阅读 · 0 评论 -
why Oracle sequence not working with JPA entity ID?
Suppose you have an Oracle sequence defined as following: CREATE SEQUENCE BILLING.SEQ_ACTVID START WITH 300060 INCREMENT BY 1 NOMINVALUE NOMAXVALUE NOCYCLE NOORDER CACHE 20; ...2012-09-19 08:08:18 · 67 阅读 · 0 评论 -
JEE6/JSF2.0 error messages, bean validation and i18n
With JEE6/JSF2.0, validation can be done by bean validation annotations. these annotations can be put on the JEE6 entity beans OR managed backing beans, as long as they conform to the Java Bean requi...2012-09-15 12:14:59 · 156 阅读 · 0 评论 -
configure web.xml to handle ViewExpriedException
<!-- define our error pages --> <error-page> <error-code>403</error-code> <location>/noAccess.jsf</location> </error-page> &l2012-09-07 10:19:11 · 70 阅读 · 0 评论 -
jee6 学习笔记 - 总结
"jee6 学习笔记" 系列基本告一段落了。 学习涉及到了 jee6 的多个方面, 以及 JBoss 6/7 的配置等等: 1, project 的建立2, primefaces 3.3 基本应用3, jsf2.0 参数传递4, 大数据查询的简单处理5, ejb3.1 基本特点的简单试验与理解6, i18n 多语言支持7, JAAS 的配置和应用, 以及JAAS A...2012-09-03 13:04:54 · 295 阅读 · 0 评论 -
jee6 学习笔记 12: Securing Application Component with JAAS api
In "jee6 学习笔记 11", we explored the JAAS configuration for a JSF2.0 application with JBoss7.1, so far so good. This article would explore the JAAS APIs that enable further control on application c...2012-09-03 12:17:37 · 89 阅读 · 0 评论 -
jee6 学习笔记 11: Secure JSF2 web app with JAAS and JBoss7.1
This article describes how to secure a JSF2 web application with Java Authentication and Authorization Service (JAAS) and JBoss7.1. It uses a "FORM" authentication method. Users and roles are stored...2012-09-02 16:07:50 · 129 阅读 · 0 评论 -
Owning Side and Inverse Side of JPA entity relationships
Entity relationships may be bidirectional or unidirectional. A bidirectional relationship has both an owningside and an inverse side. A unidirectional relationship has only an owning side. The own...2013-09-10 07:08:02 · 123 阅读 · 0 评论 -
java ee transaction and datasource concepts
1. What is a transaction?A transaction groups units of work and save the them all at once, or at any failure, roll back all the changes.2. What are the features of a transaction?ACID: Atomicit...2012-11-10 13:48:27 · 84 阅读 · 0 评论 -
avoid setParameter for "order by" in JPQL
you might want to create a JPQL like this:String sql = "select distinct s from Student s order by :orderByColumn asc"Query query = em.createQuery(sql);query.setParameter("orderByColumn", "name...2013-03-07 05:55:48 · 124 阅读 · 0 评论 -
JPA Path Expression, operator IN and Collection properties
If we want to select the Orders whose price is greate than 100, we can use this JPQL query: select o from Order o where o.price > 100Here "o.price" is used to refer to the property "price" ...2013-01-23 16:25:29 · 536 阅读 · 0 评论 -
与JEE6/EJB3.1相比, Spring framework 丧失了几乎所有的优势
The Spring framework was a major competitor against the ejb technologies. But with EJB3.0/3.1 picked up all the good things, such as Dependecy Injection, Configuration Over Convention etc, Spring no...2013-01-19 13:13:54 · 154 阅读 · 0 评论 -
JPA native query does not support setting list parameters
you might want to do the following highlighted code as: whereClause.append("f.id IN (:fleetIdsList)"); ..... query.setParameter("fleetIdsList", fleetIdsList); B...原创 2014-03-27 06:45:54 · 176 阅读 · 0 评论 -
Simple EasyMock tutorial
http://veerasundar.com/blog/2012/06/easymock-tutorial-getting-started/ EasyMock doc:http://www.easymock.org/EasyMock3_0_Documentation.html2012-12-20 11:57:29 · 74 阅读 · 0 评论 -
Servlet 3.0 @WebFilter and @WebServlet
Servlet 3.0 provides new annotation @WebFilter to simplify the configuration of a servlet filter. Here's a simple example and the filter will be invoked with url pattern "/student/*": package c...2012-12-04 07:09:58 · 71 阅读 · 0 评论 -
Why JSF2 @ViewScoped not working?
javax.faces.bean.ViewScoped said as long as you stay on the same view/page, the backing bean should be the same. This is useful if you want to retain some state of the backing bean, whilst avoid cachi...2012-12-03 06:55:21 · 143 阅读 · 0 评论 -
When to configure an XA datasource?
If you ever came across this warning message from JBoss, you might wonder what's wrong:[b]WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction wi...2012-11-16 12:58:33 · 141 阅读 · 0 评论 -
jee6 学习笔记 10: Internationalizing the web app
Making a web app to support multiple languages. This is achieved in JSF2 by using message properties files (resource bundles) and load the correct key/value pair from these resource files, based o...2012-08-23 10:31:07 · 141 阅读 · 0 评论 -
JSF Action/Event/ValueChange Listeners
• Action listeners– Attached to buttons, hypertext links, or image maps – Automatically submit the form- when to use: business method/handler jsf page:<h:commandButton action="#{bean.doS...2012-08-23 07:25:35 · 124 阅读 · 0 评论 -
jee6 学习笔记 4 - JSF2 Flash Scope
JSF 2 provides copule of new scopes, among which the "Flash" scope is quite interesting. (i believe the concept is borrowed from other frameworks like the "Stripes" framework)t...原创 2012-07-11 12:43:04 · 152 阅读 · 0 评论 -
jee6 学习笔记 4 - JSF2 Page Navigation
JSF2 navigation can be done in couple of ways:1. in the action bean, directly return page filename to "forward"(default) to, or "redirect"(need to define) to:[code="java"]// a "forward"(defa...原创 2012-07-11 12:23:39 · 75 阅读 · 0 评论 -
jee6 学习笔记 4 - JSF2 Ajax Basic
JSF 2 has Ajax built in, lets take a look at how it works.the tag (all attributes optional): use case: user input a message, an output field renders the message vi ajax call to server side bac...原创 2012-07-10 08:43:25 · 94 阅读 · 0 评论 -
jee6 学习笔记 4 - CRUD 2: View Details, Primefaces row selection
screenshot of view details button:[img]http://dl.iteye.com/upload/attachment/0070/4919/63bd3a10-6e66-3378-a8b8-da534e19e276.png[/img]screenshot of view details of selected row:[img]http://dl...原创 2012-07-09 12:02:33 · 117 阅读 · 0 评论 -
jee6 学习笔记 4 - CRUD 1: Primefaces datatable, sorting and paging
实现简单的搜索功能:搜索学生姓名,同时利用primefaces datatable来显示结果。screenshot: (Note, i've changed the theme from "sam" to "afterwork")[img]http://dl.iteye.com/upload/attachment/0070/4904/d336d53c-9c72-371a-8a9c-...原创 2012-07-09 11:21:12 · 138 阅读 · 0 评论 -
有关JEE6 CDI setup
简单看了一下,说是必须有一个配置文件beans.xml,但该文件可以是完全空白的。why?!如果部署到.war而没有用到ejb,则可将该文件打包到WEB-INF。如果用到了ejb,则应该放到META-INF底下。CDI 主要的annotation 有@Named, @Inject,还有些scope等。测试结果,JBOSS6.1 对@Named的支持有问题,好像表单绑定不上呵...原创 2012-07-05 10:31:43 · 83 阅读 · 0 评论 -
jee6 学习笔记 3 - an EJB3.1 DAO
DAO interface. [code="java"]package com.jxee.ejb;import javax.ejb.Local;import com.jxee.model.User;/** * although it's not required, it's good practice to define a DAO interface. * a...原创 2012-07-05 07:36:33 · 149 阅读 · 0 评论 -
jee6 学习笔记 2 - @ManagedBean
看看BackingBean(or ActionBean if you like),先上图。the login screen[img]http://dl.iteye.com/upload/attachment/0070/3005/e6a38740-00fc-3995-b89b-3795a637621b.jpg[/img]login validation 1: missing requ...原创 2012-07-04 09:02:37 · 558 阅读 · 0 评论 -
jee6 学习笔记 4 - CRUD 3 (finally): Update and Add New
Add new/Update/View Details can be combined altogether into one single screen. This results in the CRUD operations to only two screens. The search screen has the "delete" action as the last column of ...原创 2012-07-16 11:19:41 · 102 阅读 · 0 评论 -
jee6 学习笔记 5 - Struggling with JSF2 binding GET params
这题目可能有点儿吓人,但却是实事求是。我们看看JSF2有哪些方法来获取HTTP GET parameters:1. use of new JSF tag "f:viewParam". is it ugly?[code="java"] //in the page: //in the bean:...原创 2012-07-17 10:37:28 · 107 阅读 · 0 评论 -
jee6 学习笔记 9: Templating and Primefaces Menubar
Templating can reuse some common code. This example discusses the simplest JSF2 templating with facelet tags. To define a template, one can use facelet tag <ui:insert name="title"></ui:i...2012-08-22 10:27:40 · 120 阅读 · 0 评论 -
jee6 学习笔记 8: Handle big data set - without real pagination
[b]Problem:[/b]There is a problem when dealing with big data set. For instance, if we have millions of records in database to search and display, we cannot just use a @SessionScoped backing bean t...原创 2012-08-16 08:58:21 · 124 阅读 · 0 评论 -
jee6 学习笔记 7.2 - use "wsimport" to create a command line web service client
"wsimport" is a tool from the JAX-WS module. Sine from version 2.0, JAX-WS is a standard part of the JDK, it should be installed already and available to you if you have JDK1.6 installed on your box....原创 2012-08-03 13:48:11 · 144 阅读 · 0 评论 -
jee6 学习笔记 7.1 - @WebService
Exposing an EJB as web service is just a matter of a few annotations. This example exposes an ejb as standard SOAP web services. It uses default JAX-WS 2.1.6, which is part of the JDK1.6 distribut...原创 2012-08-03 13:26:22 · 148 阅读 · 0 评论 -
jee6 学习笔记 6.3 - @Asynchronous
the idea is to the EJB3.1 @Asynchronous ejbsscreen shot 1: call async ejb without receiving a result[img]http://dl.iteye.com/upload/attachment/0071/4030/41a135cf-acad-317e-b1dd-17a2ca0a972f.pn...原创 2012-07-27 11:22:32 · 135 阅读 · 0 评论 -
jee6 学习笔记 6.2 - @Schedule
This tests the ejb3.1 annotation @Schedule.The idea is to print the server time regularly, in a scheduled task method. [code="java"]package com.jxee.ejb.test.singleton;import java.util.Dat...原创 2012-07-26 08:33:25 · 133 阅读 · 0 评论 -
jee6 学习笔记 6.1 - Singleton EJB
The idea of the test is to print the instance of the singleton ejb for different requests. The singleton ejb is referenced in the request scoped backing bean. the screen shot of the test page:...原创 2012-07-20 13:39:16 · 135 阅读 · 0 评论 -
jee6 学习笔记 6 - EJB3.1 What's New
The following is a brief list of the new features of EJB3.11. no interface required[code="java"]@Statelesspublic class MyEjb { ...}[/code]2. singleton EJB: @Singleton[code="java"]@...原创 2012-07-20 05:55:44 · 76 阅读 · 0 评论 -
Simple tool to monitor jvm memory usage and garbage collection
JDK has built-in tool to monitor jvm memory usage: jstatThis is a command line tool, which runs like:$ jstat -gc 17707 5000where, -gc is the option, 17707 is process ID of the jvm process, 5000 ...原创 2016-10-13 06:06:12 · 138 阅读 · 0 评论