如何设置从1001开始的MySQL表中"id"列的初始值?
我想做一个插入 "INSERT INTO users (name, email) VALUES ('{$name}', '{$email}')";
不指定id列的初始值.
我有一个相当简单的Maven项目:
<project>
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
但是,我在m2eclipse中收到以下错误:
Description Resource Path Location Type
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /jasperreports-test line 60 Maven Project Build Lifecycle Mapping Problem
Run Code Online (Sandbox Code Playgroud)
为什么我关心m2eclipse是否"支持"这项任务?Maven确实如此,这就是我真正关心的.如何才能在我的项目中出现此错误消失?
我有一个textarea,它包含在div中,因为我有jquery提示,并希望在不更改边框的情况下使用不透明度.有一个可见的垂直滚动条,当我在文本字段中输入并且超出容器时,我只想显示它.我试过溢出:auto; 但不起作用.
文本域:
<label>
<div id="name">
<textarea name="message" type="text" id="message"
title="Enter Message Here"
rows=9 cols=60 maxlength="2000"></textarea>
</div>
</label>
Run Code Online (Sandbox Code Playgroud)
样式:
#name {
border: 1px solid #c810ca;
width: 270px;
height:159px;
overflow: hidden;
position: relative;
}
#message {
height: 400px;
width: 235px;
overflow: hidden;
position: absolute;
}
Run Code Online (Sandbox Code Playgroud) 我的应用程序完成后,我想关闭spring上下文.
相关代码有ApplicationContext参考,但我找不到close方法.
根据doc,calendar set()是:
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29
set(int year, int month, int date)
Sets the values for the calendar fields YEAR, MONTH, and DAY_OF_MONTH.
Run Code Online (Sandbox Code Playgroud)
码:
Calendar c1 = GregorianCalendar.getInstance();
c1.set(2000, 1, 30); //January 30th 2000
Date sDate = c1.getTime();
System.out.println(sDate);
Run Code Online (Sandbox Code Playgroud)
输出:
Wed Mar 01 19:32:21 JST 2000
Run Code Online (Sandbox Code Playgroud)
为什么不是1月30日???
我正在开发项目,其中包括服务器(JavaEE app)和客户端(Android app)的通信.XML作为HTTP请求的POST参数之一发送(名为"xml").我传递给服务器的其他POST参数也很少,但在下面的功能中,为了简单起见,我删除了它们.出现的问题是某些字母未正确传送到服务器 - 例如字符?(请注意,这不是德语Ü,顺便说一下,它是正确传送的).发送代码如下:
private String postSyncXML(String XML) {
String url = "http://10.0.2.2:8080/DebugServlet/DebugServlet";
HttpClient httpclient = new DefaultHttpClient();
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("xml",XML));
UrlEncodedFormEntity form;
try {
form = new UrlEncodedFormEntity(nameValuePairs);
form.setContentEncoding(HTTP.UTF_8);
HttpPost httppost = new HttpPost(url);
httppost.setEntity(form);
HttpResponse response = (HttpResponse) httpclient .execute(httppost);
HttpEntity resEntity = response.getEntity();
String resp = EntityUtils.toString(resEntity);
Log.i(TAG,"postSyncXML srv response:"+resp);
return resp;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) …Run Code Online (Sandbox Code Playgroud) 我需要将用户角色和权限系统添加到使用PHP/MySQL构建的Web应用程序中.我想要这个功能:
我需要系统足够灵活,以便为内容分配新的角色和权限.
我有一个users存储组密钥的表以及其他信息.目前我使用两个精密组件中的每个内容表即createdBy和CreatedByGroup,并使用某一个用户的点是否有权限.但它不够灵活,因为对于每一个新内容,我都必须通过所有数据更新和权限更新.请通过讨论架构设计的最佳实践来帮助我.
我正在尝试将数据库名称设置为spring security登录页面中的请求输入参数.目前我只获得使用spring security检索的用户名SecurityContextHolder.getContext().getAuthentication().
如何访问登录页面上设置的附加字段?
我试图在我的spring启动应用程序中设置2个过滤器的执行顺序,它们具有相同的url映射.我尝试在我的主Application类中使用2个过滤器注册bean,如下所示,但是没有用.我希望authorizationFilter先被击中validationFilter.但是,只有validationFilter在两者都配置好的时候它总是会命中.如果我发表评论validationFilter,它就会命中authorizationFilter.
@Bean
public FilterRegistrationBean authorizationFilter(){
FilterRegistrationBean filterRegBean = new FilterRegistrationBean();
filterRegBean.setFilter(authorizationFilter);
List<String> urlPatterns = new ArrayList<String>();
urlPatterns.add("/v1/*");
filterRegBean.setUrlPatterns(urlPatterns);
return filterRegBean;
}
@Bean
public FilterRegistrationBean validationFilter(){
FilterRegistrationBean filterRegBean = new FilterRegistrationBean();
filterRegBean.setFilter(validationFilter);
List<String> urlPatterns = new ArrayList<String>();
urlPatterns.add("/v1/*");
filterRegBean.setUrlPatterns(urlPatterns);
return filterRegBean;
}
Run Code Online (Sandbox Code Playgroud)
我也试过web.xml将可执行jar 引入并转换为war文件.
<web-app>
<filter>
<filter-name>authorizationFilter</filter-name>
<filter-class>com.security.filter.AuthorizationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>authorizationFilter</filter-name>
<url-pattern>/v1/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>validationFilter</filter-name>
<filter-class>com.security.validation.ValidationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>validationFilter</filter-name>
<url-pattern>/v1/*</url-pattern>
</filter-mapping>
</web-app>
Run Code Online (Sandbox Code Playgroud)
但是应用程序似乎没有识别web.xml,因为它只使用上面的配置命中验证过滤器.我很感激解决这个问题的任何意见.谢谢
我的pom.xml中有三个配置文件用于我们的应用程序...
当我们运行maven构建时,所有三个配置文件都输出一个具有相同名称的war文件.我想输出$profilename-somearbitraryname.war
有任何想法吗?