1

xhtml的代码如下:

    <h:form enctype="multipart/form-data" id="importForm">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>
                    <t:inputFileUpload id="upFile"
                        title="#{messages['global.label.import.browse']}"
                        value="#{attachmentAction.upFile}" storage="file"
                        maxlength="1000000">
                    </t:inputFileUpload>
                </td>
            </tr>
            <tr>
                <td>
                    <h:commandButton action="#{attachmentAction.upload}" value="#{messages['button.upload']}" 
                        styleClass="btnCla" onclick="return checkSelectFile();" type="submit">
                    </h:commandButton>
                </td>
            </tr>
        </table>
    </h:form>

Action方法的代码如下。我只是想从客户那里得到一个excel。

public void upload(){
    try {
        jxl.Workbook wb = Workbook.getWorkbook(upFile.getInputStream());// Here , I always got Null for the value of upFile! Why?
        wb.getSheet(0);
    } catch (Exception e) {

    }
}

对于 upFile 的值,我总是得到 Null!为什么?


Cassandra Hector:给定行键和二级索引的 IndexedSliceQuery

赫克托:赫克托核心1.0-5 Cassandra-1.1.2

我需要在 Hector 中建模一个查询,例如:

select * from table1 where rowkey='x' and secondary_indexed_column='y'

如果我使用将 setStartKey 设置为 rowKey 'x' 的 IndexedSliceQuery,我仍然会得到所有包含 secondary_indexed_column='y' 的行。如果我在 addEqualsExpression("row_key",'x') 中添加 row_key 字段,则会出现以下异常:

org.apache.thrift.protocol.TProtocolException: Required field 'value' was not present! Struct: IndexExpression(column_name:64 65 76 69 63 65 5F 69 64, op:EQ, value:null)
    at org.apache.cassandra.thrift.IndexExpression.validate(IndexExpression.java:562)
    at org.apache.cassandra.thrift.IndexExpression.write(IndexExpression.java:499)
    at org.apache.cassandra.thrift.IndexClause.write(IndexClause.java:521)
    at org.apache.cassandra.thrift.Cassandra$get_indexed_slices_args.write(Cassandra.java:13469)
    at org.apache.cassandra.thrift.Cassandra$Client.send_get_indexed_slices(Cassandra.java:793)
    at org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:781)
    at me.prettyprint.cassandra.service.KeyspaceServiceImpl$19.execute(KeyspaceServiceImpl.java:732)

那么,如何限制我的 indexedSliceQuery 只返回给定行键的结果?

4

0 回答 0