1.struts2 的struts.xml文件怎么配置
struts2中组件化的方式 可以将每个功能模块独立到一个xml配置文件中 然后用include节点引用 -->
2.求struts2 struts.xml文件写法
<?xml version="1.0" encoding="UTF-8"?>
downloadFile
- /{1}.jsp
5.struts2中怎样上传xml文件
public byte[] getFileAsByte(File file) throws Exception{
if(file == null) {
return null;
}
FileInputStream fis= new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream(4096);
byte[] b = new byte[4096];
int n;
while((n = fis.read(b)) >0) {
bos.write(b, 0, n);
}
bos.close();
fis.close();
return bos.toByteArray();
}
6.如何在struts2.2.1.1中配置struts.xml 文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"
<struts>
<package name="default" namespace="/hehe" extends="struts-default">
<action name="he">
<result>/Hello.jsp</result>
</action>
</package>
<package name="struts2" extends="struts-default">
<action name="he">
<result>/Hello.jsp</result>
</action>
</package>
</struts>
转载请注明出处育才学习网 » struts2xml文件怎么写