narentera / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

some error about json request with struts2 #79

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
the error response is

HTTP Status 404 - No result defined for action 
zzbz_online.struts.action.application.BookInfoAction and result input

--------------------------------------------------------------------------------

type Status report

message No result defined for action 
zzbz_online.struts.action.application.BookInfoAction and result input

description The requested resource (No result defined for action 
zzbz_online.struts.action.application.BookInfoAction and result input) is not 
available.

when i use flexgrid 

$("#flex1").flexigrid
({
    url: '../application/recommendList',
    dataType: 'json',
    mehtod:'post',
    colModel: [
    { display: 'ISBN', name: 'isbn', width: 130, align: 'center' },
    { display: 'title', name: 'title', width: 130, align: 'center' },
    { display: 'aujthor', name: 'author', width: 130, align: 'center' },
    { display: 'publisher', name: 'publisher', width: 120, align: 'center' },
    { display: 'date', name: 'date', width: 105, align: 'center' },
    { display: 'status', name: 'status', width: 40, align: 'center' },
    { display: 'detail', name: 'status', width: 40, align: 'center' }
    ],
    sortname: "isbn",
    sortorder: "asc",
    usepager: true,
    striped: true,
    useRp: false,
    rp: 10,
    width: '778',
    height: 255,
    onError: function(XMLHttpRequest, textStatus, errorThrown){
    alert(textStatus)
        alert(XMLHttpRequest.responseText)
    }
});

the flexigrid.pack.js
$.ajax( {
type : p.method,
url : p.url,
data : param,
dataType : p.dataType,
success : function(data) {
g.addData(data)
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
try {
if (p.onError)
p.onError(XMLHttpRequest, textStatus,errorThrown)
} catch (e) {
}
}
})

when i delete the param data : param, everthing is ok

maybe there is something about data
in other word, is there some null param in the data param

Original issue reported on code.google.com by StarSeek...@gmail.com on 7 Oct 2011 at 7:20

GoogleCodeExporter commented 8 years ago
If you use json plugin for struts you may define the result type 'input' in 
your strutx.xml

Ex.:

<action name="yourActionUrl"
            class="your.full.classPath" >
            <result type="json" name="input">
                            .... your params ....
            </result>
            <result type="json">
                            .... your params ....
            </result>
        </action>

Original comment by yurii.bo...@gmail.com on 18 Apr 2012 at 7:25