Changement de la méthode pour l'envoie du fichier...
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow xmlns="http://www.springframework.org/schema/webflow"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/webflow
|
||||
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
|
||||
|
||||
<start-state idref="selectFile"/>
|
||||
|
||||
<view-state id="selectFile" view="submissionArticleFile">
|
||||
<transition on="submit" to="uploadFile"/>
|
||||
</view-state>
|
||||
|
||||
<action-state id="uploadFile">
|
||||
<action bean="uploadAction"/>
|
||||
<transition on="success" to="selectFile">
|
||||
<set attribute="fileUploaded" scope="flash" value="true"/>
|
||||
</transition>
|
||||
<transition on="error" to="selectFile"/>
|
||||
</action-state>
|
||||
|
||||
</flow>
|
||||
@@ -5,13 +5,25 @@
|
||||
|
||||
<head>
|
||||
<title><fmt:message key="title" /></title>
|
||||
|
||||
<SCRIPT LANGUAGE="JavaScript">
|
||||
function Ajouter(form) {
|
||||
var o=new Option(form.mainauthor.value);
|
||||
form.liste.options[form.liste.options.length]=o;
|
||||
}
|
||||
function Ajouter2(form) {
|
||||
var o=new Option(form.secondaryauthor.value);
|
||||
form.liste.options[form.liste.options.length]=o;
|
||||
}
|
||||
</SCRIPT>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h2 align="center"><fmt:message key="submission.title" /></h2>
|
||||
|
||||
<form:form method="post" commandName="submissionArticle">
|
||||
<form:form method="post" enctype="multipart/form-data" commandName="submissionArticle">
|
||||
|
||||
|
||||
<fmt:message key="form.submission.article.title" /> <form:input path="title"/> <br/><br />
|
||||
@@ -20,12 +32,21 @@
|
||||
<hr /> <br />
|
||||
|
||||
<fmt:message key="form.submission.listauthor" /> <br /><br />
|
||||
<fmt:message key="form.submission.mainauthor" /> <form:input path="mainauthor"/> <input type="submit" name="addMain" value=<fmt:message key="button.add" />> <br/><br />
|
||||
<fmt:message key="form.submission.secondaryauthor" /> <form:input path="secondaryauthor"/> <input type="submit" name="addSecondary" value=<fmt:message key="button.add" />> <br/><br />
|
||||
<fmt:message key="form.submission.mainauthor" /> <form:input path="mainauthor" />
|
||||
<input type="button" name="addMain" onClick="Ajouter(this.form)" value=<fmt:message key="button.add" />> <br/><br />
|
||||
<fmt:message key="form.submission.secondaryauthor" /> <form:input path="secondaryauthor" />
|
||||
<input type="button" name="addSecondary" onClick="Ajouter2(this.form)" value=<fmt:message key="button.add" />> <br/><br />
|
||||
|
||||
<textarea name="AreaAuthor" rows=10 cols=40></textarea> <br />
|
||||
<form:select path="liste" size="5" itemValue="test">
|
||||
|
||||
</form:select>
|
||||
<br />
|
||||
|
||||
<hr /> <br />
|
||||
<hr />
|
||||
|
||||
File : <input type="file" name="file"/>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<input type="submit" value=<fmt:message key="button.cancel" />>
|
||||
<input type="submit" value=<fmt:message key="button.OK" />> <br/><br/>
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<%@ page contentType="text/html" %>
|
||||
<%@ page session="true" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<form name="submitForm" method="post" enctype="multipart/form-data" action="submissionArticleOK.htm">
|
||||
<table>
|
||||
<c:if test="${fileUploaded}">
|
||||
<p>File uploaded succesfully.</p>
|
||||
<c:if test="${!empty(file)}">
|
||||
<pre style="border: solid 1px;">${file}</pre>
|
||||
</c:if>
|
||||
</c:if>
|
||||
<tr>
|
||||
<td>
|
||||
File:
|
||||
</td>
|
||||
<td>
|
||||
<input type="file" name="file">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="buttonBar">
|
||||
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">
|
||||
<input type="submit" class="button" name="_eventId_submit" value="Upload">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:flow="http://www.springframework.org/schema/webflow-config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/webflow-config
|
||||
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/jee
|
||||
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
|
||||
|
||||
@@ -22,17 +19,17 @@
|
||||
<property name="commandName" value="submissionArticle" />
|
||||
<property name="commandClass" value="org.yacos.web.author.form.FormSubmission" />
|
||||
<property name="formView" value="submissionArticle" />
|
||||
<property name="successView" value="submissionArticleFile.htm?_flowId=fileupload" />
|
||||
<property name="successView" value="submissionArticleOK.htm" />
|
||||
<property name="articleManager" ref="articleManager" />
|
||||
</bean>
|
||||
|
||||
<bean name="/choosePreference.htm" class="org.yacos.web.PCmember.controller.ChoosePreferenceControl">
|
||||
<!-- <bean name="/choosePreference.htm" class="org.yacos.web.PCmember.controller.ChoosePreferenceControl">
|
||||
<property name="commandName" value="choose"/>
|
||||
<property name="commandClass" value="org.yacos.web.author.form.FormPreference" />
|
||||
<property name="formView" value="choosePreference" />
|
||||
<property name="successView" value="choosePreferenceOK" />
|
||||
<property name="articleManager" ref="articleManager" />
|
||||
</bean>
|
||||
</bean> -->
|
||||
|
||||
<bean id="viewResolver"
|
||||
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
@@ -43,28 +40,11 @@
|
||||
<property name="suffix" value=".jsp"></property>
|
||||
</bean>
|
||||
|
||||
<bean name="/submissionArticleFile.htm" class="org.springframework.webflow.executor.mvc.FlowController">
|
||||
<property name="flowExecutor" ref="flowExecutor" />
|
||||
</bean>
|
||||
|
||||
<!-- Launches new flow executions and resumes existing executions. -->
|
||||
<flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="singlekey"/>
|
||||
|
||||
<!-- Creates the registry of flow definitions for this application -->
|
||||
<flow:registry id="flowRegistry">
|
||||
<flow:location path="/WEB-INF/fileupload.xml" />
|
||||
</flow:registry>
|
||||
|
||||
<!--
|
||||
Support for multipart requests using commons file upload
|
||||
Make sure you have the commons-fileupload.jar in your classpath
|
||||
-->
|
||||
|
||||
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<!-- Limit uploads to small (5KB) files for this sample -->
|
||||
<property name="maxUploadSize" value="5120" />
|
||||
<property name="maxUploadSize" value="100000" />
|
||||
</bean>
|
||||
|
||||
<bean id="uploadAction" class="org.yacos.web.utils.FileUploadAction" />
|
||||
|
||||
|
||||
<bean id="messageSource"
|
||||
class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
|
||||
Reference in New Issue
Block a user