- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我也发布了有关可怕的“当前请求不是多部分请求”消息的信息。
我正在使用最新的 Spring 及其 sibling ,并具有以下配置:
@Configuration
@EnableWebMvc
@EnableSpringDataWebSupport
@ComponentScan(basePackages = { "com.....project.rest" })
@Import({JsonConfiguration.class})
public class WebConfiguration extends WebMvcConfigurerAdapter {
@Bean
public MultipartResolver multipartResolver() {
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
multipartResolver.setMaxUploadSize(1024000);
return multipartResolver;
}
}
我还有一个 Controller 处理程序:
@Controller
@RequestMapping(RESTConstants.SLASH + RESTConstants.BTS)
public class BTSUploadController {
@RequestMapping(value = RESTConstants.SLASH + RESTConstants.UPLOAD, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public String handleFileUpload(@RequestPart(value = "json") JsonPojo pojo, @RequestParam(value = "random") String random, @RequestParam(value = "data", required = false) List<MultipartFile> uploadedFiles, BindingResult result) {
}
}
使用常量:
public static final String SLASH = "/";
public static final String BTS = "bts";
public static final String UPLOAD = "upload";
最后是测试:
@Before
public void setup() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.webApplicationContext).addFilters(this.springSecurityFilterChain).build();
}
@Before
public void beforeAnyTest() throws Exception {
httpHeaders = Common.createAuthenticationHeaders("stephane" + ":" + PASSWORD);
}
@Test
public void test() throws Exception {
MockMultipartFile firstFile = new MockMultipartFile("data", "filename.txt", "text/plain", "some xml".getBytes());
MockMultipartFile secondFile = new MockMultipartFile("data", "other-file-name.data", "text/plain", "some other type".getBytes());
MockMultipartFile jsonFile = new MockMultipartFile("json", "", "application/json", "{\"json\": \"someValue\"}".getBytes());
MvcResult mvcResult = this.mockMvc.perform(
fileUpload(RESTConstants.SLASH + RESTConstants.BTS + RESTConstants.SLASH + RESTConstants.UPLOAD)
.file(firstFile)
.file(secondFile)
.file(jsonFile)
.headers(httpHeaders)
.param("random", "4")
)
.andExpect(status().isOk())
.andExpect(content().string("success"))
.andReturn();
String value = deserialize(mvcResult, String.class);
assertEquals(value, "success");
}
但是 Maven 构建给了我以下消息:
org.springframework.web.multipart.MultipartException: The current request is not a multipart request
有什么线索吗?
我已经在谷歌上搜索了一个小时了......
编辑:完整的堆栈跟踪
2014-09-26 18:52:13,163 ERROR [ExceptionsHandler] There was an RTE error.
2014-09-26 18:52:13,182 DEBUG [ExceptionsHandler] org.springframework.web.multipart.MultipartException: The current request is not a multipart request
at org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver.assertIsMultipartRequest(RequestPartMethodArgumentResolver.java:178)
at org.springframework.web.servlet.mvc.method.annotation.RequestPartMethodArgumentResolver.resolveArgument(RequestPartMethodArgumentResolver.java:116)
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79)
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:170)
at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137)
at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:145)
at com.nsn.nitro.project.rest.controller.BTSUploadControllerTest.test(BTSUploadControllerTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:72)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:81)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
编辑:更多配置
public class WebInit implements WebApplicationInitializer {
private static Logger logger = LoggerFactory.getLogger(WebInit.class);
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
registerListener(servletContext);
registerDispatcherServlet(servletContext);
registerJspServlet(servletContext);
}
private void registerListener(ServletContext servletContext) {
// Create the root application context
AnnotationConfigWebApplicationContext appContext = createContext(ApplicationConfiguration.class, WebSecurityConfiguration.class);
// Set the application display name
appContext.setDisplayName("NI");
// Create the Spring Container shared by all servlets and filters
servletContext.addListener(new ContextLoaderListener(appContext));
}
private void registerDispatcherServlet(ServletContext servletContext) {
AnnotationConfigWebApplicationContext webApplicationContext = createContext(WebConfiguration.class);
ServletRegistration.Dynamic dynamic = servletContext.addServlet("dispatcher", new DispatcherServlet(webApplicationContext));
dynamic.setLoadOnStartup(1);
Set<String> mappingConflicts = dynamic.addMapping("/");
if (!mappingConflicts.isEmpty()) {
for (String mappingConflict : mappingConflicts) {
logger.error("Mapping conflict: " + mappingConflict);
}
throw new IllegalStateException(
"The servlet cannot be mapped to '/'");
}
// dynamic.setMultipartConfig(webApplicationContext.getBean(MultipartConfigElement.class));
}
private void registerJspServlet(ServletContext servletContext) {
}
private AnnotationConfigWebApplicationContext createContext(final Class... modules) {
AnnotationConfigWebApplicationContext appContext = new AnnotationConfigWebApplicationContext();
appContext.register(modules);
return appContext;
}
@Configuration
@Import({ ApplicationContext.class })
public class ApplicationConfiguration extends WebMvcConfigurerAdapter {
// Declare "application" scope beans here, that is, beans that are not only used by the web context
}
@Configuration
@Import({ DatabaseProperties.class, JpaService.class, Log4j.class })
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = { "com....project.data.jpa" }, repositoryFactoryBeanClass = com.nsn.nitro.project.data.jpa.repository.GenericRepositoryFactoryBean.class)
public class ApplicationContext {
@Autowired
private DatabaseProperties databaseProperties;
@Bean
public DataSource dataSource() throws PropertyVetoException {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
dataSource.setDriverClass(databaseProperties.getHibernateDriverClassName());
dataSource.setJdbcUrl(databaseProperties.getDataSourceUrl());
dataSource.setUser(databaseProperties.getDataSourceUsername());
dataSource.setPassword(databaseProperties.getDataSourcePassword());
dataSource.setAcquireIncrement(5);
dataSource.setMaxStatementsPerConnection(20);
dataSource.setMaxStatements(100);
dataSource.setMinPoolSize(2);
dataSource.setMaxPoolSize(5);
return dataSource;
}
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws PropertyVetoException {
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setDatabasePlatform(databaseProperties.getHibernateDialect());
jpaVendorAdapter.setShowSql(true);
jpaVendorAdapter.setGenerateDdl(false);
Map<String, String> jpaPropertiesMap = new HashMap<String, String>();
jpaPropertiesMap.put("hibernate.dialect", databaseProperties.getHibernateDialect());
jpaPropertiesMap.put("hibernate.show_sql", "true");
jpaPropertiesMap.put("hibernate.format_sql", "true");
// http://stackoverflow.com/questions/25932976/foreign-key-data-integrity-violation-on-oracle-x-10g
// jpaPropertiesMap.put("hibernate.connection.autocommit", "true");
// jpaPropertiesMap.put("hibernate.cache.use_query_cache", "false");
// jpaPropertiesMap.put("hibernate.cache.use_second_level_cache", "false");
jpaPropertiesMap.put("hibernate.hbm2ddl.auto", databaseProperties.getHibernateHbm2ddlAuto());
jpaPropertiesMap.put("hibernate.transaction.factory_class", "org.hibernate.transaction.JDBCTransactionFactory");
jpaPropertiesMap.put("hibernate.ejb.naming_strategy", "org.hibernate.cfg.ImprovedNamingStrategy");
jpaPropertiesMap.put("hibernate.c3p0.min_size", "5");
jpaPropertiesMap.put("hibernate.c3p0.max_size", "20");
jpaPropertiesMap.put("hibernate.c3p0.timeout", "1000");
jpaPropertiesMap.put("hibernate.c3p0.max_statements", "50");
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setJpaVendorAdapter(jpaVendorAdapter);
factoryBean.setPackagesToScan("com.....project.data.jpa.domain");
factoryBean.setJpaPropertyMap(jpaPropertiesMap);
String[] mappingsResources = new String[] {"custom/typedef.hbm.xml"};
factoryBean.setMappingResources(mappingsResources);
factoryBean.setDataSource(dataSource());
return factoryBean;
}
@Bean
public JpaTransactionManager transactionManager() {
JpaTransactionManager transactionManager = new JpaTransactionManager();
try {
transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
} catch (Exception x) {
throw new RuntimeException(x);
}
return transactionManager;
}
@Bean
public HibernateExceptionTranslator hibernateExceptionTranslator(){
return new HibernateExceptionTranslator();
}
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
}
一些 Maven 依赖项是:
<org.springframework.version>4.1.0.RELEASE</org.springframework.version>
...
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${org.springframework.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${org.springframework.security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.16.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
最佳答案
我遇到了同样的问题。我意识到我的请求中有无效的 header ,例如
content-type : application/json
删除此 header 后,错误消失。
关于spring - MockMultipartFile 测试中当前请求不是多部分请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26049386/
我试图通过这段代码读取未知数量的整数: while (1) { int c = getchar (); if (c == EOF) break;
我正试图找到一个类似于谷歌分析日期选择器的日期选择器: 知道 jQuery 是否提供了类似的东西吗? 最佳答案 这个 Twitter Bootstrap 风格的日期范围选择器非常接近。 https:/
我正在使用 javascript。如何获取当前 URL 的路径并将其分配给我的代码?这是我的代码: $(document).ready(function() { $(".share").hides
如何获得今天的Julian day number (JDN)相等的?或任何日期? 我看了又看,但只发现了一些产生“year-dayOfYear”的函数,而不是:2457854。 最佳答案 在 bash
我有相当简单的 UDP 服务器写在 c 上。 有时我需要知道在套接字中排队的所有 udp 数据包(字节)的当前长度。 据我了解,getsockopt 没有得到这样的信息。 欢迎使用 Linux 和 F
我一直在寻找几个小时来找到一个可以在图像中添加诸如“填充:5px”之类的东西的插件。每个人都通过纯 html 做到这一点吗?我们的客户需要一种方法来简单地使用按钮或右键单击上下文菜单来添加它。有什么建
是否有可能获得当前正在执行的 TCL 脚本的完整路径? 在 PHP 中,它将是:__FILE__ 最佳答案 根据“当前正在执行的 TCL 脚本”的含义,您实际上可能会寻找 info script ,甚
我最近从直接使用 ISession 转向了包装的 ISession,即工作单元类型模式。 我曾经使用 SQL Lite(内存中)对此进行测试。我有一个简单的帮助器类,它配置我的 SessionFact
我按照步骤操作 here在 WebStorm 中配置代码完成和其他内容,但我仍然收到以下语法错误。 我该如何解决这个问题? 最佳答案 通过相应地将“JavaScript 语言版本”(Settings/
我可以为我团队的 TFS 当前 Sprint 任务板添加书签吗?我们有两周的冲刺,因此 URL 每两周更改一次。 默认 URL 的形式为: http://[Server]/tfs/[Project]/
是否有 Subversion 命令可以显示当前版本号? 在svn checkout之后,我想启动一个脚本并需要变量中的修订号。如果有像 svn info get_revision_number 这样的
我正在编写表单的一个组件 首次安装组件时,sources={{}} ,一本空字典。由于该组件包装了现有的 Javascript 库,因此我正在实现一个自定义比较函数。为了让这个 diffing 函数
无论系统时间设置为多少以及机器所在的时区,我都需要正确的 UTC 时间。 (即使我必须打电话到互联网才能同步......) 是否有一些库或其他方法可以优雅地做到这一点? 最佳答案 如果您想获得准确可靠
我一边编码,一边拿出一些我和 friend 建立的旧网站来重新开始工作。我已经有一段时间没有做过任何 AJAX 了,当我试图找出我的代码失败的地方时,我发现没有显示很多资源。我猜这是因为我使用的是旧方
由于对性能的巨大影响,我从不怀疑我现在的桌面CPU是否有分支预测。当然可以。但各种 ARM 产品又如何呢? iPhone或Android手机有分支预测吗?较旧的任天堂 DS?基于 PowerPC 的
我有一个具有以下有效负载的 JWT: { "id": "394a71988caa6cc30601e43f5b6569d52cd7f6df", "jti": "394a71988caa6cc30
从其他一些帖子中,我能够通过以下方式获取当前 URI: 但是以下方法不起作用: 我很好奇为什么上面的方法不起作用,以及如何将当前 URI 分配给字符串。 最佳答案 每the javadocs ,g
我在表格 View 中有几个单元格。现在在任何给定的时间点,我想计算 View 中单元格的当前高度,即如果它是 View 的 3/4,它应该返回 (cellheight)*3/4 高度。 我通过以下方
这是网站的身份验证脚本。这安全吗?是最近的节目吗?它已经过时了吗?是否有“更好更安全的方法”我很新,但我没有看到太多地方使用 header 授权。 如有任何帮助,我们将不胜感激!这是我制作的第一个登录
我已经在其他 stackoverflow 线程上检查过这个错误,但在我的代码中没有发现任何错误。也许我累了,但我觉得还好。 网站.urls.py: from django.conf.urls impo
我是一名优秀的程序员,十分优秀!