struts上传的问题
是没页面没显示的问题。。用的是struts的标签代码如下<body><s:formaction="fileUpload"method="POST"enctype="mul...
是没页面没显示的问题。。用的是struts的标签
代码如下
<body >
<s:form action ="fileUpload" method ="POST" enctype ="multipart/form-data" >
<s:file name ="myFile" label ="Image File" />
<s:textfield name ="caption" label ="Caption" />
<s:submit/>
</s:form >
<a>显示</a>
---------------------------------------------------------------------
FileUpload.jsp
<struts >
<package name ="fileUpload" extends ="struts-default">
<action name ="fileUpload" class ="test.FileUploadAction" >
<interceptor-ref name ="fileUploadStack"/>
<result name ="success" >/ShowUpload.jsp</result >
</action>
</package>
</struts>
-------------------------------------------------------------------------------
struts的
FileUploadAction.java位于test包下的。由于和显示不相关就不贴出来了。
项目名叫 fileUpload 展开
代码如下
<body >
<s:form action ="fileUpload" method ="POST" enctype ="multipart/form-data" >
<s:file name ="myFile" label ="Image File" />
<s:textfield name ="caption" label ="Caption" />
<s:submit/>
</s:form >
<a>显示</a>
---------------------------------------------------------------------
FileUpload.jsp
<struts >
<package name ="fileUpload" extends ="struts-default">
<action name ="fileUpload" class ="test.FileUploadAction" >
<interceptor-ref name ="fileUploadStack"/>
<result name ="success" >/ShowUpload.jsp</result >
</action>
</package>
</struts>
-------------------------------------------------------------------------------
struts的
FileUploadAction.java位于test包下的。由于和显示不相关就不贴出来了。
项目名叫 fileUpload 展开
1个回答
展开全部
你应该把FileUploadAction 贴出来 ,配置没有问题的 没有看到你的控制类 不好说什么问题
<!-- FileUploadAction.java-->
private String caption;
public void setCaption(String caption){
this.caption =caption;
}
public String getCaption(){
return caption
}
public String execute(){
这里的代码应该有问题
}
<!-- FileUploadAction.java-->
private String caption;
public void setCaption(String caption){
this.caption =caption;
}
public String getCaption(){
return caption
}
public String execute(){
这里的代码应该有问题
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询