From: <fg...@us...> - 2008-01-14 12:01:07
|
Revision: 527 http://openutils.svn.sourceforge.net/openutils/?rev=527&view=rev Author: fgiust Date: 2008-01-14 04:01:09 -0800 (Mon, 14 Jan 2008) Log Message: ----------- cleanup and email service draft Modified Paths: -------------- trunk/openutils-spring/pom.xml trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextHolder.java trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextListener.java trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java trunk/openutils-spring/src/main/java/it/openutils/spring/validation/hibernate/AnnotationValidator.java trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java trunk/openutils-spring/src/main/java/it/openutils/web/spring/EasyDoubleCustomEditor.java trunk/openutils-spring/src/main/java/it/openutils/web/spring/MultiController.java trunk/openutils-spring/src/main/java/it/openutils/web/spring/ParamNameUrlHandlerMapping.java trunk/openutils-spring/src/main/java/it/openutils/web/spring/SimpleController.java trunk/openutils-spring/src/main/java/it/openutils/web/util/MessageUtils.java Added Paths: ----------- trunk/openutils-spring/src/main/java/it/openutils/spring/email/ trunk/openutils-spring/src/main/java/it/openutils/spring/email/FileMessageStore.java trunk/openutils-spring/src/main/java/it/openutils/spring/email/MessageStore.java trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSender.java trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSenderImpl.java Modified: trunk/openutils-spring/pom.xml =================================================================== --- trunk/openutils-spring/pom.xml 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/pom.xml 2008-01-14 12:01:09 UTC (rev 527) @@ -9,7 +9,7 @@ </parent> <artifactId>openutils-spring</artifactId> <name>openutils spring tools</name> - <version>1.0.5-SNAPSHOT</version> + <version>2.0-SNAPSHOT</version> <description /> <dependencies> <dependency> @@ -53,6 +53,7 @@ <artifactId>json-lib</artifactId> <version>1.1</version> <classifier>jdk15</classifier> + <optional>true</optional> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -108,6 +109,23 @@ <version>2.1_3</version> </dependency> <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3.1</version> + </dependency> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.freemarker</groupId> + <artifactId>freemarker</artifactId> + <version>2.3.11</version> + <optional>true</optional> + </dependency> + <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextHolder.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextHolder.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextHolder.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.context; import org.springframework.web.context.WebApplicationContext; Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextListener.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextListener.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/context/WebApplicationContextListener.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.context; import javax.servlet.ServletRequestEvent; Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSetPropertyEditor.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.editors; import java.beans.PropertyEditorSupport; @@ -128,7 +143,8 @@ parameters[0] = new Long(id); } - T value = (T) MethodUtils.invokeMethod(dao, "load", parameters, new Class[]{this.propertyType}); + T value = (T) MethodUtils + .invokeMethod(dao, "load", parameters, new Class[]{this.propertyType }); set.add(value); } catch (Throwable e) Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/editors/GenericSinglePropertyEditor.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.editors; import java.beans.PropertyEditorSupport; Added: trunk/openutils-spring/src/main/java/it/openutils/spring/email/FileMessageStore.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/email/FileMessageStore.java (rev 0) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/email/FileMessageStore.java 2008-01-14 12:01:09 UTC (rev 527) @@ -0,0 +1,100 @@ +package it.openutils.spring.email; + +import java.io.File; +import java.io.IOException; + +import javax.mail.MessagingException; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMessage.RecipientType; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang.StringEscapeUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class FileMessageStore implements MessageStore +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(FileMessageStore.class); + + private String outputDirectory; + + /** + * Sets the outputDirectory. + * @param outputDirectory the outputDirectory to set + */ + public void setOutputDirectory(String outputDirectory) + { + this.outputDirectory = outputDirectory; + } + + /** + * {@inheritDoc} + */ + public void saveMessage(MimeMessage message, String template) + { + File dir = new File(outputDirectory); + dir.mkdirs(); + File file = new File(dir, template + "." + System.currentTimeMillis() + ".html"); + + StringBuffer buffer = new StringBuffer(); + + try + { + buffer.append("From: "); + buffer.append(StringEscapeUtils.escapeXml(ArrayUtils.toString(message.getFrom()))); + buffer.append("\n"); + + if (message.getReplyTo() != null) + { + buffer.append("Reply-to: "); + buffer.append(StringEscapeUtils.escapeXml(ArrayUtils.toString(message.getReplyTo()))); + buffer.append("\n"); + } + + buffer.append("To: "); + buffer.append(StringEscapeUtils.escapeXml(ArrayUtils.toString(message.getRecipients(RecipientType.TO)))); + buffer.append("\n"); + + if (message.getRecipients(RecipientType.CC) != null) + { + buffer.append("CC: "); + buffer + .append(StringEscapeUtils.escapeXml(ArrayUtils.toString(message.getRecipients(RecipientType.CC)))); + buffer.append("\n"); + } + + if (message.getRecipients(RecipientType.BCC) != null) + { + buffer.append("BCC: "); + buffer.append(StringEscapeUtils + .escapeXml(ArrayUtils.toString(message.getRecipients(RecipientType.BCC)))); + buffer.append("\n"); + } + buffer.append("\n"); + + buffer.append(ObjectUtils.toString(message.getContent())); + + FileUtils.writeStringToFile(file, buffer.toString()); + } + catch (MessagingException e) + { + log.error(e.getMessage(), e); + } + catch (IOException e) + { + log.error(e.getMessage(), e); + } + } + +} Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/email/FileMessageStore.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-spring/src/main/java/it/openutils/spring/email/MessageStore.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/email/MessageStore.java (rev 0) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/email/MessageStore.java 2008-01-14 12:01:09 UTC (rev 527) @@ -0,0 +1,14 @@ +package it.openutils.spring.email; + +import javax.mail.internet.MimeMessage; + + +/** + * @author fgiust + * @version $Id: $ + */ +public interface MessageStore +{ + + void saveMessage(MimeMessage message, String template); +} Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/email/MessageStore.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSender.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSender.java (rev 0) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSender.java 2008-01-14 12:01:09 UTC (rev 527) @@ -0,0 +1,45 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.spring.email; + +import java.io.File; +import java.util.List; +import java.util.Map; + + +/** + * @author fgiust + * @version $Id: $ + */ +public interface TemplatedMailSender +{ + + /** + * Compiles the freemarker template with the model data and send it to the given addresses, adding a cc to the given + * addresses. + * @param templateFile Freemarker template file name + * @param model Map merged into template + * @param from Mail that will result as sender of the compiled mail. + * @param to mail to list + * @param cc mail cc list + * @param replyto TODO + * @param async send mail asynchrounisly (if allowed in configuration) + * @param attachments list of attachments + */ + void prepareAndSendMail(final String templateFile, final Map<String, Object> model, final String from, + final String[] to, final String[] cc, final String[] bcc, String replyto, boolean async, List<File> attachments); + +} Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSender.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSenderImpl.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSenderImpl.java (rev 0) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSenderImpl.java 2008-01-14 12:01:09 UTC (rev 527) @@ -0,0 +1,216 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package it.openutils.spring.email; + +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import javax.mail.internet.MimeMessage; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.exception.NestableRuntimeException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.io.InputStreamSource; +import org.springframework.mail.MailException; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.mail.javamail.MimeMessagePreparator; +import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; + + +/** + * @author fgiust + * @version $Id: $ + */ +public class TemplatedMailSenderImpl implements TemplatedMailSender +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(TemplatedMailSenderImpl.class); + + /** + * Spring mail sender. + */ + private JavaMailSender mailSender; + + private Configuration freemarkerConfiguration; + + private MessageStore store; + + /** + * Allow async delivery. + */ + private boolean allowAsync; + + /** + * Sets the mailSender. + * @param mailSender the mailSender to set + */ + public void setMailSender(JavaMailSender mailSender) + { + this.mailSender = mailSender; + } + + /** + * Sets the freemarkerConfiguration. + * @param freemarkerConfiguration the freemarkerConfiguration to set + */ + public void setFreemarkerConfiguration(Configuration freemarkerConfiguration) + { + this.freemarkerConfiguration = freemarkerConfiguration; + } + + /** + * Sets the allowAsync. + * @param allowAsync the allowAsync to set + */ + public void setAllowAsync(boolean allowAsync) + { + this.allowAsync = allowAsync; + } + + /** + * Sets the store. + * @param store the store to set + */ + public void setStore(MessageStore store) + { + this.store = store; + } + + /** + * {@inheritDoc} + */ + public void prepareAndSendMail(final String template, final Map<String, Object> model, final String from, + final String[] to, final String[] cc, final String[] bcc, final String replyto, boolean async, + final List<File> attachments) + { + + String errorMessageTmp = "Error sending mail to " + ArrayUtils.toString(to); + String infoMsg = "Mail is sent to " + ArrayUtils.toString(to); + String infoPrepareMsg = "Preparing to send mail to " + ArrayUtils.toString(to); + + StringBuffer infoBuf = new StringBuffer(); + StringBuffer prepareBuf = new StringBuffer(); + + final String infoMessage = infoMsg + infoBuf.toString(); + final String infoPrepareMessage = infoPrepareMsg + prepareBuf.toString(); + final String errorMessage = errorMessageTmp; + + if (StringUtils.isEmpty(from)) + { + log.error(errorMessage + "sender not set", new Exception("Stacktrace added for debug only")); + return; + } + + log.info(infoPrepareMessage); + + Thread sendmailThread = new Thread() + { + + @Override + public void run() + { + MimeMessagePreparator preparator = new MimeMessagePreparator() + { + + public void prepare(MimeMessage mimeMessage) throws Exception + { + MimeMessageHelper message = new MimeMessageHelper(mimeMessage, attachments != null + && !attachments.isEmpty()); + message.setFrom(from); + message.setTo(to); + if (StringUtils.isNotEmpty(replyto)) + { + message.setReplyTo(replyto); + } + if (cc != null && cc.length > 0) + { + message.setCc(cc); + } + if (bcc != null && bcc.length > 0) + { + message.setBcc(bcc); + } + String text; + try + { + Template freemarkerTemplate = freemarkerConfiguration.getTemplate(template, "UTF-8"); + text = FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerTemplate, model); + } + catch (IOException e) + { + throw new NestableRuntimeException(e); + } + catch (TemplateException e) + { + throw new NestableRuntimeException(e); + } + String subject = StringUtils.trim(StringUtils.substringBefore(text, "\n")); + + message.setSubject(subject); + message.setText(StringUtils.substringAfter(text, "\n"), true); + if (attachments != null && !attachments.isEmpty()) + { + for (File file : attachments) + { + InputStreamSource attachment = new FileSystemResource(file); + message.addAttachment(file.getName(), attachment); + } + } + + if (store != null) + { + store.saveMessage(mimeMessage, template); + } + } + }; + try + { + mailSender.send(preparator); + log.info(infoMessage); + } + catch (MailException me) + { + log.error(errorMessage, me); + throw me; + } + } + }; + + if (async && allowAsync) + { + sendmailThread.start(); + } + else + { + sendmailThread.run(); + } + + } + +} Property changes on: trunk/openutils-spring/src/main/java/it/openutils/spring/email/TemplatedMailSenderImpl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/remoting/exporters/JSONServiceExporter.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.remoting.exporters; import java.beans.BeanInfo; Modified: trunk/openutils-spring/src/main/java/it/openutils/spring/validation/hibernate/AnnotationValidator.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/spring/validation/hibernate/AnnotationValidator.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/spring/validation/hibernate/AnnotationValidator.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.spring.validation.hibernate; import java.util.Enumeration; Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/BaseFormController.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.spring; import it.openutils.web.util.MessageUtils; Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/EasyDoubleCustomEditor.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/EasyDoubleCustomEditor.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/EasyDoubleCustomEditor.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.spring; import java.text.NumberFormat; Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/MultiController.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/MultiController.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/MultiController.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.spring; import it.openutils.web.util.MessageUtils; Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/ParamNameUrlHandlerMapping.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/ParamNameUrlHandlerMapping.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/ParamNameUrlHandlerMapping.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.spring; import java.util.HashMap; Modified: trunk/openutils-spring/src/main/java/it/openutils/web/spring/SimpleController.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/spring/SimpleController.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/spring/SimpleController.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.spring; import it.openutils.web.util.MessageUtils; @@ -71,7 +86,7 @@ */ public String getText(String msgKey, Object arg) { - return getText(msgKey, new Object[]{arg}); + return getText(msgKey, new Object[]{arg }); } public void saveMessage(HttpServletRequest request, String message) Modified: trunk/openutils-spring/src/main/java/it/openutils/web/util/MessageUtils.java =================================================================== --- trunk/openutils-spring/src/main/java/it/openutils/web/util/MessageUtils.java 2008-01-14 12:00:28 UTC (rev 526) +++ trunk/openutils-spring/src/main/java/it/openutils/web/util/MessageUtils.java 2008-01-14 12:01:09 UTC (rev 527) @@ -1,3 +1,18 @@ +/* + * Copyright Openmind http://www.openmindonline.it + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package it.openutils.web.util; import java.util.ArrayList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |