All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web.examples.file-upload.xml Maven / Gradle / Ivy

There is a newer version: 8.1.5
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE aspectran PUBLIC "-//ASPECTRAN//DTD Aspectran 8.0//EN"
        "http://aspectran.github.io/dtd/aspectran-8.dtd">
<aspectran>

    <settings>
        <setting name="transletNamePrefix" value="/examples/file-upload"/>
    </settings>

    <aspect id="transletSettingsForFileUpload">
        <description>
            Specifies the environment variables used during request and response processing.
        </description>
        <joinpoint>
            methods: [
                POST
            ]
            pointcut: {
                +: /examples/file-upload/files
            }
        </joinpoint>
        <settings>
            <setting name="multipartFormDataParser" value="imageFileUploader"/>
        </settings>
    </aspect>

    <bean id="imageFileUploader" class="com.aspectran.web.support.multipart.inmemory.InMemoryMultipartFormDataParserFactoryBean">
        <description>
            Required to handle multi-part form data.
        </description>
        <properties>
            <item name="maxRequestSize" value="6M"/>
            <item name="maxFileSize" value="5M"/>
            <item name="allowedFileExtensions" value="jpg,jpeg,png,gif"/>
        </properties>
    </bean>

    <bean class="com.aspectran.demo.examples.upload.SimpleFileUploadActivity">
        <properties>
            <item name="maxFiles" valueType="int">12</item>
        </properties>
    </bean>

    <translet name="/">
        <action id="files" bean="class:com.aspectran.demo.examples.upload.SimpleFileUploadActivity" method="list"/>
        <echo id="page">
            <item name="headline">Uploading Files</item>
            <item name="teaser">This guide walks you through the process of creating a server application that can receive HTTP multi-part file uploads.</item>
            <item name="include">examples/file-upload</item>
            <item name="style">plate</item>
            <item name="maxFiles">#{class:com.aspectran.demo.examples.upload.SimpleFileUploadActivity^maxFiles}</item>
        </echo>
        <dispatch name="templates/default"/>
    </translet>

</aspectran>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy