switch (sh.getRow(r).getCell(cell).getCellType()) {
case HSSFCell.CELL_TYPE_NUMERIC:
if (HSSFDateUtil.isCellDateFormatted(sh.getRow(r).getCell(cell))) {
Date aDate = sh.getRow(r).getCell(cell).getDateCellValue();
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
res = sdf.format(aDate);
} else {
sh.getRow(r).getCell(cell).setCellType(Cell.CELL_TYPE_STRING);
res = sh.getRow(r).getCell(cell).getStringCellValue();
}
break;
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>${project.artifactId}</finalName>
<archive>
<manifest>
<mainClass>somepackage.SomeClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
$('#id-form').submit(function() {
// заполняем value1,2,3 и т.д
$.post($('#id-form').attr('action'), {
'field1' : value1,
'field2' : value2,
'field3' : value3
// и т.д
}, function(response) {
//Выводим результат
}, 'json');
return false;
});
@RequestMapping(value = "/some_city/", method = RequestMethod.POST)
public @ResponseBody SomeCity someCity(@RequestParam(value = "somecity", required = true) String somecity) throws Exception {
Gson gson = new Gson();
SomeCity data = gson.fromJson(somecity, SomeCity.class);
return data;
}
@Bean
public ViewResolver getXmlViewResolver() {
XmlViewResolver resolver = new XmlViewResolver();
resolver.setLocation(new ServletContextResource(servletContext, "/WEB-INF/spring/views.xml"));
resolver.setOrder(1);
return resolver;
}
<bean id="excelViewSbCCDetails" class="somepackage.SbCCDetailsXlsxReport" />
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>