[JBossCache] - Re: uninitialized nodes
by genman
"manik.surtani(a)jboss.com" wrote :
| "genman" wrote :
| | There really should be options you can set to override loading from the cache loader, or for ignoring the return values for Node.put(key, value) or Node.remove(key) .
| |
| Yes, but then you change the behaviour of put() and remove(), which IMO should not be controlled by an option. Perahps add a putQuietly() or removeQuietly() that have return types of void, although this clutters up the API which sucks.
|
The AsyncCacheLoader has an option to allow remove() and put() (single key) operations to return null instead of the old value. This allows these operations to be queued rather than making the caller wait.
Anyway, I thought the point of the options was to send hints to the system, such as "Don't wait to put() if the node is already locked." I would think "I don't need to know the return value for this operation" would be a somewhat similar use case.
"manik.surtani(a)jboss.com" wrote :
| "genman" wrote :
| | It would be nice if there was a "disable()" method on Interceptor. Interceptor.invoke() might have been public/final and delegated to a protected abstract method ...
|
| Well, unless disabling was conditional (i.e., disable for all get() calls) you may as well yank the interceptor out of the chain.
The thing with the removal and addition of interceptors is ... the APIs are a little hokey. Working with index numbers isn't as nice as with objects.
I was thinking (and it's too late to change, but ...) Interceptors themselves have a specific dependency or ordering to them. And rather than specify the ordering explicitly, the API would be add(Interceptor). You could have a remove(Interceptor) (symmetric call) as well that scans using object identity.
I do agree that bypassing certain interceptors should be drive by options, not an API call. (It'd be nice if this was done in some generic way.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065262#4065262
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065262
18Â years, 11Â months
[JBoss Seam] - s:fileUpload woes
by chrismalan
s:fileUpload doesn't work for me. Here is what I have: Seam 1.2.1.GA, JBoss-4.2.0. I use xhtml, not jsp's.
In the ear I have jboss-seam.jar and in WEB-INF/lib jboss-seam-ui.jar, jboss-seam-debug.jar and jsf-facelets.jar.
This is what is in web.xml:
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
This is the relevant part of the xhtml file:
| <h:form enctype="multipart/formdata">
| <fieldset>
| <legend>Add an Image to <h:outputText value="#{hotelSessionBean.hotel.name}" /></legend>
| <div>
| <h:outputLabel for="hotelimage">Image File to Load</h:outputLabel><br />
| <s:fileUpload id="hotelimage" data="#{hotelSessionBean.imageData}" contentType="#{hotelSessionBean.contentType}" fileName="#{hotelSessionBean.filename}" />
| </div>
| <div class="buttonBox">
| <h:commandButton action="#{hotelSessionBean.addImage()}" value="Add an Image" class="button" />
| </div>
| </fieldset>
| </h:form>
|
This is the relevant part of hotelSessionBean:
| @Stateful
| @Scope(ScopeType.SESSION)
| @Name("hotelSessionBean")
| public class HotelSessionBean implements HotelSession {
|
| @In
| Identity identity;
|
| @PersistenceContext
| EntityManager em;
|
| private Hotel hotel;
| private String contentType, filename, description;
| private byte[] imageData;
|
When I test in hotelSessionBean.addImage() to see if the values (contentType, filename, imageData) arrived in the hotelSessionBean after clicking the Add an Image button, all those values are null.
When these values return null, the method returns with an error message I created. So, no exceptions are thrown. Before I tested the exeptions stated that one could not persist an Image with null values where the database stipulatd non-null values.
On logging in and going to the page from where to upload the image, I get this:
| INFO [Lifecycle] starting up: org.jboss.seam.security.identity
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/seam-ui.taglib.xml
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
| ERROR [STDERR] 18/07/2007 14:38:08 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
| INFO: Added Library from: jar:file:/C:/JBoss/jboss-4.2.0.GA/server/default/tmp/deploy/tmp50450bookings.ear-contents/bookings-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
| *** logging in up to here
| INFO [STDOUT] Hibernate: select principal0_.username as username7_, principal0_.name as name7_, principal0_.password as password7_, principal0_.hotel_hotelID as hotel7_7_, principal0_.email as email7_, principal0_.surname as surname7_, principal0_.created as created7_ from Principal principal0_ where principal0_.username=? and principal0_.password=?
| INFO [STDOUT] Hibernate: select hotel0_.hotelID as hotelID5_1_, hotel0_.name as name5_1_, hotel0_.state as state5_1_, hotel0_.country as country5_1_, hotel0_.description as descript4_5_1_, hotel0_.city as city5_1_, hotel0_.stars as stars5_1_, hotel0_.street as street5_1_, hotel0_.suburb as suburb5_1_, country1_.ID as ID2_0_, country1_.country as country2_0_ from Hotel hotel0_ inner join Country country1_ on hotel0_.country=country1_.ID where hotel0_.hotelID=?
| INFO [STDOUT] Hibernate: select principalr0_.ID as ID8_, principalr0_.principal as principal8_, principalr0_.user_role as user3_8_ from PrincipalRole principalr0_ where principalr0_.principal=?
| INFO [STDOUT] Hibernate: select role0_.name as name9_0_, role0_.description as descript2_9_0_ from Role role0_ where role0_.name=?
| INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
|
Note that the page find the right hotel for the logged in user to upload the image to the right hotel.
Where is my mistake?
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065259#4065259
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065259
18Â years, 11Â months