[JBoss Seam] - How To Cancel Update in Home Object
by gzoller
Hello,
If I override update() in a Home object, how can I stop the update from happening and roll back changes the user has made? Even better: Is there a way to have access to the old and new fields values?
What I'd like to be able to do is know what the original value was so I can manually set it back in update(). Something like this:
| @Override
| public String update() {
| if( getInstance().getFavoriteColor().equals("Red") ) {
| MyHome mh = new MyHome();
| mh.setId( getInstance().getId() );
| mh.find(); // desired: mh now holds original pre-update() persisted state
| getInstance().setFavoriteColor(mh.getFavoriteColor());
| return null;
| }
| return super.update();
| }
|
The problem is that the database lookup returns the new value not the original value I'm looking for. I've also tried using a query rather than find()--same result. This is puzzling to me! update() hasn't yet successfully completed, so why is the find() returning the new rather than the old value?
Anybody know how I can get access to both the original and new field values inside update()?
Thanks!
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039058#4039058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039058
19 years
[Installation, Configuration & Deployment] - packaging a war file with struts 1.3.8 for jboss 4.0.4
by tb44
hello,
i try to port a web application from jboss 3.2.0 to jboss4.0.4.
i have a problem with classNotFound exception for struts (see log):
23:53:26,500 INFO [EJBDeployer] Deployed: file:/home/baudouin/site/binaires/jboss-4.0.4.GA/server/default/deploy/siloDonnees.jar
23:53:26,890 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
23:53:30,301 ERROR [MainDeployer] Could not create deployment: file:/home/baudouin/site/binaires/jboss-4.0.4.GA/server/default/deploy/siteweb.war
java.lang.NoClassDefFoundError: org/apache/struts/action/ActionServlet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
i respect configuration and packaging for struts (http://struts.apache.org/1.3.8/userGuide/configuration.html#dd_config_mod...),
it say top copy struts jar files in WEB-INF/lib of my web application.
i do this but jboss don't find class.
I have forgotten something in web.xml, jboss-web.xml ?
Do you have a idea ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039051#4039051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039051
19 years