【发布时间】:2016-06-16 05:55:56
【问题描述】:
我的问题是我想在索引视图上预览数据而不将数据保存在数据库中。为此,我想在重定向的参数部分发送对象列表。并且在接收操作时想要使用该对象列表。但是当我包含如下内容时
def preview(){
//some code
redirect action: "index", params:[planId:params.planId, beamsInfoList: beamsInfoList]
}
我希望发生类似下面的事情。
def index() {
//some code
try{
planInfo.beamInfo = (params.beamsInfoList==null)?planInfo.beamInfo:params.beamsInfoList //beamInfo is also list
//some code
Object[] obj = GRMUtils.calculateTotalBeamsPower(planInfo.beamInfo)
totalPlanPower = (Float)obj[0];
beamPowerMap= (Map<Integer, String>)obj[1];
AmMapUtility utility=new AmMapUtility()
output = utility.generateAMmapFromBeams(planInfo.beamInfo, GRMConstants.POWER_MAP_PAGE);
if(null==output){
flash.error = message(code: 'beammap.noinfoerror.message')
}
}catch(Exception e){
log.error "Excepton occured while loading Power Map", e
}
respond beams, model:[centerLong:output.getCenterLongitude(),centerLat:output.getCenterLatitude(),amMapImageProperty:output.getMapImages(),
amMapLinesProperty:output.getMapLines(), planId:params.planId, planInfo:planInfo, powersControlCarrier: powersControlCarrier, powersTrafficCarrier:powersTrafficCarrier,satPower: planInfo.satellite.satelliteMaxPower, totalPlanPower: totalPlanPower, gatewayPower: planInfo.gateway.gatewayAggregateEIRP,fesOutputPowerLimit:fesOutputPowerLimit, beamPowerMap: beamPowerMap,powerRangeColorMap:output.getReuseColorMap()]
}
它不会重定向到 index 方法,也不会显示任何错误。两个动作都在同一个控制器中。我使用过闪存,但作为第二个请求所反映的价值,它也无济于事。我也尝试过会话,但出现错误
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
在一些数据库提取上。我被困住了。我是 grails 和 groovy 的新手。请帮忙。
编辑:我发现我的列表很大,这就是它不重定向的原因。请帮助我另一种选择,例如如果可能的话,我该如何使用请求属性?
【问题讨论】: