seam

Forcing a transaction to rollback on validation errors in Seam

谁说胖子不能爱 提交于 2019-11-30 14:14:24
Quick version: We're looking for a way to force a transaction to rollback when specific situations occur during the execution of a method on a backing bean but we'd like the rollback to happen without having to show the user a generic 500 error page. Instead, we'd like the user to see the form she just submitted and a FacesMessage that indicates what the problem was. Long version: We've got a few backing beans that use components to perform a few related operations in the database (using JPA/Hibernate). During the process, an error can occur after some of the database operations have happened.

checks for constraint violation before persisting an entity

耗尽温柔 提交于 2019-11-30 11:28:07
What is the best mechanism for preventing constraint violation checks before creation | modification of an entity? Suppose if the 'User' entity has 'loginid' as the unique constraint, would it be wise to check if there is an user entry already with this loginid name before creation or modification. OR Would you let the database throw an ConstraintViolationException and handle this message appropriately in the UI layer. Where should such checks be enforced in the jboss seam framework. Note: Currently no such checks are enforced on the seam-gen code. We currently use Seam 2.2, Richfaces with

java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator Seam weblogic 10.3

微笑、不失礼 提交于 2019-11-30 04:49:26
I have a big problem with Hibernate (use with seam) on weblogic 10.3. When I publish my application, I get this error: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager) I read on the web that this error can come from compatibily between hibernate jar. But, I read the matrix and I have the good jar with good version (hibernate-validator 3.1, hibernate-search 3.1, hibernate core 3.3.0) I haven't idea to

How do I prevent form resubmission in Seam?

家住魔仙堡 提交于 2019-11-30 04:48:28
问题 I have a simple form that I don't want accidentally submitted multiple times. I can easily block the user from multiple clicks when they first see the page, but I have no control over them hitting the back button. So, having worked with Struts, I decided that a form submit token was the way to go. Is there an easier way? Is this functionality already in Seam? If there isn't, how should I go about building this functionality into Seam? // EDIT // Just a clarification here, I do NOT need

JPA Entiy on synonym instead of table

白昼怎懂夜的黑 提交于 2019-11-30 03:49:11
问题 I have a Seam 2.2 based Java EE 5 web application with a bunch of tables mapped to JPA 1.0 Entities via Hibernate 3.3.3. During development it's running on a Tomcat 6, Oracle 10 XE and Windows 7. Now, we had the request by operations department to split the data model into one schema being the owner of all database objects ( myschema ) and one schema acting as the application's database user ( myschema_app ). So I did the following: create schema myschema_app grant object rights on all

Spring vs Jboss

蹲街弑〆低调 提交于 2019-11-29 21:55:26
What are the advantages and disadvantages for Spring vs. Jboss for an enterprise web application. As already said, but let me just restate the point. JBoss is an application server. Some Java application servers include Websphere Glassfish JBoss Spring is a framework. A rather large framework which offers quite a bit but for me one of the main features is MVC. MVC is a design pattern where you separate your Model from View from your Contoller. The model is the representation of the data. This can be backed by things like database or XML files. The view is what is used to view the model. This

Forcing a transaction to rollback on validation errors in Seam

匆匆过客 提交于 2019-11-29 20:02:25
问题 Quick version: We're looking for a way to force a transaction to rollback when specific situations occur during the execution of a method on a backing bean but we'd like the rollback to happen without having to show the user a generic 500 error page. Instead, we'd like the user to see the form she just submitted and a FacesMessage that indicates what the problem was. Long version: We've got a few backing beans that use components to perform a few related operations in the database (using JPA

Should I start my Seam project from scratch or from a seam-gen generated project?

北城余情 提交于 2019-11-29 15:00:55
I have been using Seam-gen with a small sample database to help me learn the Seam framework. Now I am going to build a more complex application. Are there disadvantages or things that I should watch out for if I decide to start from a seam-gen project? Are there disadvantages or things that I should watch out for if I decide to start from a seam-gen project ? No. A Seam-gen generated project can be opened without any restriction in NetBeans (like another project) If you use Eclipse, some settings are needed. Seam-gen takes care includes all libraries It creates by default, production and

How do I send JSon as BODY In a POST request to server from an Android application?

為{幸葍}努か 提交于 2019-11-29 09:22:08
I am working on my first Android Application. What I am trying to do is a POST request to a REST service I want the BODY of this request to be a JSON String. I am using google's GSON to generate the JSON that is sent to the server. Here is the code doing POST request: HttpPost requisicao = new HttpPost(); requisicao.setURI(new URI(uri)); requisicao.setHeader("User-Agent", sUserAgent); requisicao.setHeader("Content-type", "application/json"); HttpResponse resposta = null; //I can see the json correctly print on log with the following entry. Log.d(TAG, "JSon String to send as body in this

How to use regular expressions with Hibernate/Oracle

末鹿安然 提交于 2019-11-29 08:02:00
I'm trying to implement a web service which accepts a list of strings, each of which is a regular expression. These need to be compared against six columns of a database, and any rows which match need to be returned. I believe Oracle has a regexp_like() function which I might be able to use, but I'm looking for the best way to do this using Hibernate, so I'm not working against the persistence engine. I started with something like this, in which the participants collection contains the regular expressions: List<Message> messages = new ArrayList<Message>(); List<Message> m1 = ((Session)