propriedade: hibernate.show_sql = true
Adicionar esta configuração no log4j:
log4j.logger.org.hibernate=DEBUG, SQL_APPENDER log4j.logger.org.hibernate.type=DEBUG, SQL_APPENDERretirado de http://www.javalobby.org/java/forums/t44119.html
propriedade: hibernate.show_sql = true
Adicionar esta configuração no log4j:
log4j.logger.org.hibernate=DEBUG, SQL_APPENDER log4j.logger.org.hibernate.type=DEBUG, SQL_APPENDERretirado de http://www.javalobby.org/java/forums/t44119.html
Postado por
Francisco Calaça Xavier - BLOG
às
04:44
1 comentários
Erro:
SEVERE: Exception sending context destroyed event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "javax/el/ExpressionFactory" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)Solução: Existe uma classe, provavelmente as que controlam a integracao das expressoes de linguagem com as expressoes de ligacao duplicadas. ocorre quando utiliza .jar's destas classes no tomcat 6 que já possui esta integracao
Postado por
Francisco Calaça Xavier - BLOG
às
14:36
0
comentários
java.util.MissingResourceException: Can't find bundle for base name com.sun.el.Messages,
solução:
crie o arquivo com.sun.el.Messages.properties
Postado por
Francisco Calaça Xavier - BLOG
às
14:13
1 comentários
Default Action for a JSF Form
The current JSF-RI implementation does not allow to you to define the default action in case the user submits the form by pressing the Enter key instead of clicking the action button explicitly. As a result, the form action becomes undefined and the current page is just reloaded. Developers have to write additional javascript code to prevent such undesirable behavior.
The j4j:defaultAction custom component included in the j4j tag libraries allows you to define the default action for a form by adding as a child tag to the commandButton tag.
PS: This component was writen before even first version fo Firefox is released. This is a code that works also in FireFox. function trapEnter(evt) { var keycode; if (evt) ; else if (window.event) evt = window.event; else if (event) evt = event; else return true; if (evt.charCode) keycode = evt.charCode; else if (evt.keyCode) keycode = evt.keyCode; else if (evt.which) keycode = evt.which; else keycode = 0; if (keycode == 13) { document.getElementById('form:save').click(); return false; } else return true; }
Download the compiled code using this URL: j4j.jar (4 K)
1. Put the j4j.jar file in the WEB-INF/lib folder of your project.
2. Add the following declaration at the top of the page:
... taglib uri="http://javascript4jsf.dev.java.net/" prefix="j4j" ...
3. Add the j4j:defaultAction component as an empty child element of the commandButton that you want to make a default button.
Here is the part of the library structure in j4j.jar that relates to this component:
The boldfaced code shows how to insert a reference to the proxy component in the faces-config.xml file:
org.j4j.defaultAction org.j4j.components.UIDefaultAction
Here is the content of the j4j.tld file:
retirados de http://www.jsftutorials.net/defaultActionTag.html
Postado por
Francisco Calaça Xavier - BLOG
às
16:53
0
comentários
Marcadores: jsf
When you unzip the Eclipse SDK, it creates a base install directory called eclipse. The directory layout looks something like this:
eclipse/
features/ ''the directory containing Eclipse features''
plugins/ ''the directory containing Eclipse plugins''
eclipse.exe ''platform executable''
eclipse.ini
eclipsec.exe ''(windows only) console executable''
epl-v10.html ''the EPL license''
eclipse.ini
jre/ ''the JRE to run Eclipse with''
notice.html
readme
You can start Eclipse by running eclipse.exe on Windows or eclipse on other platforms. This small launcher essentially finds and loads the JVM that is on your PATH. On Windows, the eclipsec.exe console executable can be used for improved command line behaviour.
Alternatively, you can launch Eclipse by directly invoking the JVM as follows:
java -jar eclipse/plugins/org.eclipse.equinox.launcher_1.0.0.v20070606.jar
NOTE: The version of org.eclipse.equinox.launcher in the above command must match the version actually shipped with Eclipse. For more details on launching Eclipse using Java (not eclipse.exe) with the 3.3 launcher, see Starting Eclipse Commandline With Equinox Launcher.
Postado por
Francisco Calaça Xavier - BLOG
às
10:59
0
comentários
retirados de: http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=sf_ajsfwebxml_html
Part of a JSF application's configuration is determined by the contents of its J2EE application deployment descriptor, WEB-INF/web.xml . JDeveloper automatically creates the web.xml file when you create a JSF page or document, and initializes the JSF configuration to default settings. You can then modify these settings for your particular application.
For more information about the web.xml file, see About Web Module Runtime Configuration. For information about configuring web.xml for ADF Faces, see About Configuring web.xml for ADF Faces.
Three web.xml elements contain JSF-related configuration settings:
<context-param> - sets parameters for the JSF application <servlet> - maps the JSF servlet to a symbolic name <servlet-mapping> - maps the JSF servlet symbolic name to a URL pattern
parmName
parmValue where parmName parmValue The following parameters are available in JSF:
javax.faces.CONFIG_FILES javax.faces.DEFAULT_SUFFIX .jsp .
Value: A file extension javax.faces.LIFECYCLE_ID javax.faces.lifecycle.LifecycleFactory.DEFAULT_LIFECYCLE constant.
Value: Lifecycle identifier javax.faces.STATE_SAVING_METHOD server or client. The default is server, which stores the application's view state on the server. If you select client, JSF stores the view state on the browser client. javax.faces.webapp.FacesServlet to a symbolic name.
Value: Symbolic name. For example, to use myServlet as the symbolic name, add the following to web.xml:
myServlet
javax.faces.webapp.FacesServlet
http://localhost:8080/login/faces/index.jsp
faces-servlet-name
/faces/*
http://localhost:8080/login/index.faces
faces-servlet-name
*.faces
Postado por
Francisco Calaça Xavier - BLOG
às
10:01
0
comentários
Marcadores: jsf
Passo 1:
Instale o latex:
miktex: http://www.miktex.org/
TEXLive: http://www.tug.org/texlive/
Passo 2:
Instale o gostscript e o gsViewer:
http://www.cs.wisc.edu/~ghost/index.html
Passo 3:
Instale o corretor ortográfico aspell:
programa: http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe
dicionário: http://ftp.gnu.org/gnu/aspell/w32/Aspell-pt-0.50-2-3.exe
Plugin Eclipse:
url: http://texlipse.sourceforge.net/
Postado por
Francisco Calaça Xavier - BLOG
às
19:33
2
comentários
execute o firefox com a seguinte linha de comando:
firefox.exe -ProfileManager
Postado por
Francisco Calaça Xavier - BLOG
às
19:04
0
comentários
Criar novo repositório no cvs
cvs -d repdir init
Postado por
Francisco Calaça Xavier - BLOG
às
07:09
0
comentários
Criando o Entity Bean
package teste;
|
package teste;
|
package teste;
|
import java.util.List;
|
Postado por
Francisco Calaça Xavier - BLOG
às
11:40
0
comentários
Postado por
Francisco Calaça Xavier - BLOG
às
10:49
0
comentários
DataSource
referencia a um datasource:
<jta-data-source>java:comp/env/jdbc/simenet</jta-data-source>
<non-jta-data-source>java:comp/env/jdbc/simenet</non-jta-data-source>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="default">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:."/>
<property name="hibernate.max_fetch_depth" value="3"/>
</properties>
</persistence-unit>
</persistence>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">
<persistence-unit name="default">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="toplink.ddl-generation" value="drop-and-create-tables" />
<property name="toplink.logging.level" value="FINE" />
<property name="toplink.jdbc.url" value="jdbc:mysql://localhost/myDB" />
<property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="toplink.jdbc.user" value="root" />
<property name="toplink.jdbc.password" value="" />
</properties>
</persistence-unit>
</persistence>
|
Postado por
Francisco Calaça Xavier - BLOG
às
10:44
1 comentários
Marcadores: jpa