Hello all!
I am currently working on a project that has been dorment for a while. It uses JBoss Seam
with JBoss Portal through the MyFacesGenericPortlet.
A have updated Seam to 1.2.1 now and added a new component to test the s:fileUpload
functionality.
My problem is now that the action declared in my jsp's commandButton is never invoked
when I click it. The server just redisplays the portal page. No error message is given.
The component itself is found when the application deploys, that was ther first thing I
checked.
This obviously has to be an error on my part, but somehow, it eludes me.
Perhaps anyone of you has some insights?
My jsp looks like this:
| <%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
| <%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
| <%@ taglib
uri="http://jboss.com/products/seam/taglib"
prefix="s"%>
|
| <f:view>
| <h3>Upload</h3>
| <p>
| <h:form enctype="multipart/form-data">
| <s:fileUpload data="thedatafield"/>
| <h:messages style="color:red"/>
| <h:commandButton type="submit" value="upload"
action="#{UploadAction.load}" styleClass="portlet-form-button" />
| </h:form>
| </p>
| </f:view>
|
and my component like this (I'll omit the local interface and omit imports... nothing
fancy in there):
| @Stateful
| @Scope(SESSION)
| @Name("UploadAction")
| public class UploadActionBean implements UploadAction {
|
| private static Logger logger = Logger.getLogger(UploadActionBean.class);
|
| @PersistenceContext(type = EXTENDED)
| private EntityManager em;
|
| @In(create = true)
| @Out(required = false)
| private byte[] thedatafield;
|
| @In(create = true)
| private transient ResourceBundle resourceBundle;
|
| @In
| private transient FacesContext facesContext;
|
| @SuppressWarnings("unchecked")
| public String load() {
| System.out.println("in load()");
| if (thedatafield != null) {
| logger.info(thedatafield);
| }
| else {
| logger.info("thedatafield is null");
| }
| return Outcome.REDISPLAY;
| }
|
| public void setThedatafield(byte[] field) {
| this.thedatafield = field;
| }
|
| public byte[] getThedatafield() {
| return this.thedatafield;
| }
|
| @Remove
| @Destroy
| public void destroy() {
| // nothing to clean up here
| }
| }
|
Thanks in advance for any ideas you guys might have.
Best regards,
Phil
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035922#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...