bboss mvc控制器方法跳转地址设置方法介绍
1.直接指定跳转地址
public String showlistjsp(ModelMap model) {
List<ListBean> beans = null;
try {
beans = (List<ListBean>) SQLExecutor.queryList(ListBean.class,
"select * from LISTBEAN");
model.addAttribute("datas", beans);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "/databind/table.jsp";
}
2.指定跳转地址别名
地址别名以path:前缀开头,别名对应的地址在mvc控制器配置文件中指定
public String showlist(ModelMap model) {
List<ListBean> beans = null;
try {
beans = (List<ListBean>) SQLExecutor.queryList(ListBean.class,
"select * from LISTBEAN");
model.addAttribute("datas", beans);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// return "/databind/table.jsp";
return "path:showlist-ok";//返回地址别名
}
在mvc控制器中配置别名path:showlist-ok对应的实际页面地址:
<property name="/pathalias/*.htm"
path:showlist-ok="/databind/table.jsp"
class="org.frameworkset.spi.mvc.PathController"/>
3.设置地址跳转的方式-forward和redirect
可以在跳转地址中指定跳转的两种模式:
forward 直接指向到目标页面,forward是默认方式,与来源请求是一个请求
redirect 重定向到目标页面,重新发出http请求
两种方式的使用示例:
redirect:
public String showlistjsp(ModelMap model) {
List<ListBean> beans = null;
try {
beans = (List<ListBean>) SQLExecutor.queryList(ListBean.class,
"select * from LISTBEAN");
model.addAttribute("datas", beans);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "redirect:/databind/table.jsp";
}
forward:
public String showlistjsp(ModelMap model) {
List<ListBean> beans = null;
try {
beans = (List<ListBean>) SQLExecutor.queryList(ListBean.class,
"select * from LISTBEAN");
model.addAttribute("datas", beans);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "forward:/databind/table.jsp";
}
在地址别名中设置forward和redirect
path:showlist-ok="forward:/databind/table.jsp"
path:showlist-ok="redirect:/databind/table.jsp"
4.从一个地址别名跳转到其他地址别名
可以从一个地址别名跳转到其他地址别名,设置方法:
<property name="/pathalias/*.htm"
path:showlist-ok="/databind/table.jsp"
path:delete-ok="path:showlist-ok"
path:deletebatch-ok="path:showlist-ok"
path:update-ok="path:showlist-ok"
path:updatebatch-ok="path:showlist-ok"
path:listbean-ok="path:showlist-ok"
class="org.frameworkset.spi.mvc.PathController"/>
分享到:
相关推荐
NULL 博文链接:https://yin-bp.iteye.com/blog/926166
NULL 博文链接:https://yin-bp.iteye.com/blog/1131637
NULL 博文链接:https://yin-bp.iteye.com/blog/1528721
bboss es特点请访问: https://www.oschina.net/p/bboss-elastic
官方版本,亲测可用
NULL 博文链接:https://yin-bp.iteye.com/blog/1449900
Elasticsearch rest client bboss介绍-Elastic2018中国开发者大会演讲稿
1.mvc控制器 2.业务组件 3.实体类 4.jsp文件可以定制不同风格的界面模板,目前提供了平台的基础ui风格 5.cxf webservice服务类文件 6.hessian服务类文件 7.sql配置文件 8.ioc / mvc组件装配部署和服务发布配置文件。...
bboss会话共享培训文档,学习bboss不可多得的资料,值得拥有。
NULL 博文链接:https://yin-bp.iteye.com/blog/2174863
企业级 J2EE 开源框架:bboss
bboss+es基本操作示例,elasticsearch,bboss,java使用demo
bboss版本重建方法 gradle安装 开发工程生成方法: dle蚀 Gradle的想法 亦可以直接通过idea或eclipse gradle插件将下载的bboss源码工程导入eclipse或者idea bboss原始码 github托管地址: svn下载地址 bboss会话...
springboot集成ElasticsearchBboss调用Elasticsearch的案例分享
官方版本,亲测可用
资源目录: 项目源码(eshelloword.rar) bboss elasticsearch开发入门教程.wmv 搭建bboss elasticsearch开发环境.wmv 说明.txt
NULL 博文链接:https://yin-bp.iteye.com/blog/2177475