日期:2014-05-19 浏览次数:20743 次
<form action="workflow.do" method="post"
enctype="multipart/form-data">
<input type="hidden" name="method" value="add">
<TABLE class="tableEdit" border="0" cellspacing="1" cellpadding="0"
style="width: 580px;">
<TBODY>
<TR>
<!-- 这里是添加、编辑界面的标题 -->
<td align="center" class="tdEditTitle">
添加或更新流程信息
</TD>
</TR>
<TR>
<td>
<!-- 主输入域开始 -->
请选择上传的流程文件:
<input type="file" name="processDefinition" />
<br>
请选择上传的流程图片:
<input type="file" name="processImage" />
<br>
<input type="submit" name="submit" value="上传" />
<!-- 主输入域结束 -->
</td>
</TR>
</TBODY>
</TABLE>
</form>
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
System.err.println("hello");
WorkflowActionForm waf = (WorkflowActionForm) form;
workflowManager.deployProcessDefinition(waf.getProcessDefinition()
.getFileData(), waf.getProcessImage().getFileData());
return mapping.findForward("add_success");
}
public class UserAction extends DispatchAction {
/**
* 测试
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
System.out.println("增加");
return mapping.findForward("success");
}
}
public class UserForm {
private String fileName;
private File processDefinition;
private File processImage;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {