不带自定义类,只有jsp的struts2的例子

来源:互联网 发布:淘宝订单处理的流程 编辑:程序博客网 时间:2024/05/18 03:19

这个工程多不需要struts.xml,只需配置web.xml

<%@ page language="java" contentType="text/html; charset=utf-8"pageEncoding="utf-8"%><%@taglib uri="/struts-tags" prefix="s"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>西安小升初18802930979</title></head><body><%request.setAttribute("foo", "西安Java培训");%><s:textfield name="username" label="%{#request.foo}" /><p><s:select label="选择" name="name" list="{'姓名1','姓名2','name3'}"value="%{'name2'}" /><p><s:select label="label" name="name" list="#{'高新':'姬丽源', '西东大':'杨紫媛'}" /><div><s:if test="'foo' in {'foo','bar'}">   in collection</s:if><s:else>   not in collection</s:else><s:if test="'foo' not in {'foo','bar'}">   not in collection</s:if><s:else>   in collection</s:else></div></body></html>

原文:http://www.itinpractice.com/tutorials/407/struts-2-ognl-object-graph-navigation-language.html#.UaKNHbWnz58

源代码:http://pan.baidu.com/share/link?shareid=474440&uk=3878681452

references to Action properties can omit the # marker