日期:2014-05-17  浏览次数:20707 次

刚学shh2,页面老是显示的样式不正确,各位大侠们帮帮我吧!!55555555~

我的struts2.xml中配置了struts.ui.theme的属性:
<struts>
<constant name="struts.ui.theme" value="simple" />
<constant name="struts.i18n.encoding" value="UTF-8" />
<constant name="struts.action.extension" value="do" />
<constant name="struts.serve.static.browserCache" value="false" />
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<package name="student" namespace="/student"
extends="struts-default">
<action name="std_*" class="StdAction" method="{1}">
<result name="add">/pages/list.jsp</result>
<result name="list">/pages/list.jsp</result>
</action>
</package>
</struts>

我的jsp中:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>添加页面</title>
</head>
<body>
<s:form action="/student/std_add.do">
姓 名:<s:textfield id="name"/><br>
性 别:<s:textfield id="gender"/><br>
入学日期:<s:textfield id="startDate"/><br>
<input type="submit" value="提交">
</s:form>
</body>
</html>


求教各位侠客们,我的是什么原因??? ~~~~(>_<)~~~~ 555

------解决方案--------------------
不要用struts 的主题
------解决方案--------------------
<s:textfield name="user.username" label="用户名" />

<s:form action="/student/std_add.do">
<s:textfield id="name" label="姓 名" />
<s:textfield id="gender" label="性 别" />
<s:textfield id="startDate"label="入学日期" /> 
<input type="submit" value="提交">
</s:form>