当前位置:首页 > 在线留言 >

ModernDriven 获得表单数据

作者:曲靖市宁江木业有限公司 来源:www.ynnjmy.com 发布时间:2017-09-06 09:25:45

ModernDriven 获得表单数据



package com.cola.struts;
import com.cola.bean.Book;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
@SuppressWarnings("all")
public class UserAction extends ActionSupport implements ModelDriven<Book> {
private Book book;
/*
* public String list(){ System.out.println(
* "User's list-------------------->"); return "success"; }
*/
public String execute() {
System.out.println(book);
return null;
}
public Book getBook() {
return book;
}
@Override
public Book getModel() {
if (book == null) {
book = new Book();
}
return book;
}
public void setBook(Book book) {
this.book = book;
}
}
< form action= "user" method = "get">
bookname: < input name= "bookname" /><br />
bookauthor:< input name= "bookauthor" /><br />
bookprice: < input name= "bookprice" /><br />
<input type = "submit" value= "add"/>< br/>
</ form>

企业建站2800元起,携手武汉肥猫科技,做一个有见地的颜值派!更多优惠请戳:黄石SEO http://huangshi.4567w.com

  • 上一篇:父亲节前夜,一个菜鸟站长的喜悦与经验分享
  • 下一篇:最后一页