Struts File Upload

CSS | Prototype | SiteMesh | DisplayTag


<s:property value="lastName" />
<s:property value="#session.addressListFile" />
<s:iterator value="addresses" status="i">
		<td><s:property value="#i.getIndex()" /></td>
		<td><s:property value="addresses[#i.getIndex()]" /></td>


1. Save as UTF-8 (Most important)
Save the files in real UTF-8, use a separate text editor like notepad++ to change it if necessary!

2. If you redirect from an index.html, make sure this index.html has a also proper

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

3. JSP:

<%@ page pageEncoding="UTF-8" %> 
4. WEB-INF/classes/
5a. WEB-INF/classes/struts.xml
<constant name="struts.i18n.encoding" value="UTF-8"/> 
5b. WEB-INF/classes/
6. Use POST to submit, otherwise it is encoding again in the URL (with HTTP GET)
<form action="LinkEdit.action" method="post">	

Themes and rendering <s:xxx> tags#

Use the simple theme to suppress special rendering (for example: a form element places elements into a table):
<s:form cssClass="addrForm" action="addressList" 
    method="post" enctype="multipart/form-data"
    theme="simple" >
The tag reference will show you the attribute options.

Copying a Project in Eclipse#

Copy in Eclipse and adjust following manually:
  • <wb-module deploy-name> tag in .settings/org.eclipse.wst.common.component
  • Project properties > Web Project Settings

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-) was last changed on 28-Mär-2017 14:37 by UnbekannterAutor