我现在在我的一个应用程序中使用ZK Framework.ZK Framework支持MVC以及MVVM设计模式.现在我想用一个新项目来使用JSF.JSF是支持设计模式还是仅支持MVC?
我想在主页中添加一个scrollbardiv id="kryesore",当我尝试它时不起作用。你能告诉我我能做什么,我该如何解决它?
下面 2 个屏幕截图它的样子:l
我有以下代码
public static void main(String[] args) {
List<Integer> list = new ArrayList<>();
list.add(1, 555);
}
Run Code Online (Sandbox Code Playgroud)
它用10个元素初始化,但我得到例外
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.rangeCheckForAdd(ArrayList.java:612)
at java.util.ArrayList.add(ArrayList.java:426)
at ListTest.main(ListTest.java:9)
Run Code Online (Sandbox Code Playgroud)
虽然下面的代码工作正常
public static void main(String[] args) {
List<Integer> list = new ArrayList<>();
list.add(0, 555);
}
Run Code Online (Sandbox Code Playgroud)
为什么有人可以解释我?以及如何解决问题我想在我的代码中将项目放在第1,第2或第5位?
在属性文件中有人定义path =./../someName/somename1..这是./../ 什么意思?
我是新手,spring MVC我在春季发送电子邮件时遇到了问题.没有例外,但邮件不发送.
我的applicationContext.xml
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.gmail.com" />
<property name="username" value="uname" />
<property name="password" value="pass" />
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.socketFactory.port">465</prop>
<prop key="mail.smtp.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.smtp.port">465</prop>
</props>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
我的控制器类
@Controller
public class WebController {
// System.out.println("suceees");
@Autowired
private JavaMailSender mailSender;
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String index() {
return "index";
}
@RequestMapping(value = "/redirect", method = RequestMethod.GET)
public String redirect() {
sendMail();
return "redirect:finalPage";
}
@RequestMapping(value = "/finalPage", method = RequestMethod.GET)
public …Run Code Online (Sandbox Code Playgroud) 我们创建jar了我们项目的文件。Jar文件名是stock.jar,在dist文件夹中:lib文件夹,一个stock.jar,stock.sqlite。
现在我们要创建.exe数据库和lib文件夹 jars。
我正在使用Oracle XE数据库和注释驱动的映射。我应该为BigIntegerHibernate中的值映射选择哪种列类型?
我正在使用Eclipse Kepler,我在Jboss EAP 6.1中运行Java Web应用程序.今天早上我注意到在部署和运行我的Web应用程序后,没有控制台输出.
但控制台输出显示我何时启动Jboss并显示所有应用程序部署的所有内容等.但之后没有任何东西在控制台中打印.
可以有人请公会我可能是什么原因我尝试了在Stackoverflow中发布的不同-2问题中提到的大量事情.
更新: -
我试过下面的代码
public class test {
public static void main(String arg[]){
System.out.println("hariom");
}
}
Run Code Online (Sandbox Code Playgroud)
并且它的结果在控制台中打印但是当我部署和运行Web应用程序时,它只是没有显示任何内容.
我有5个复选框,我已将选择限制为仅3.每个所选复选框的列表值将存储到数据库中,如果列表少于3个,则用零填充列表.如何用零填充列表?
List < Integer > preferences = new ArrayList < Integer > ();
if (chckbxLei.isSelected()) {
preferences.add(Integer.valueOf(chckbxLei.getName()));
}
if (chckbxAdv.isSelected()) {
preferences.add(Integer.valueOf(chckbxAdv.getName()));
}
if (chckbxHis.isSelected()) {
preferences.add(Integer.valueOf(chckbxHis.getName()));
}
if (chckbxOut.isSelected()) {
preferences.add(Integer.valueOf(chckbxOut.getName()));
}
if (chckbxFAK.isSelected()) {
preferences.add(Integer.valueOf(chckbxFAK.getName()));
}
if (preferences.size() > 3) {
JOptionPane.showMessageDialog(frame,
"Please Select Only 3! ");
return;
}
Place place = new Place();
try {
place.addPre(preferences);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
Place.java
public void addPre(List < Integer > preferences) throws …Run Code Online (Sandbox Code Playgroud) 我创建了一个使用 SpringBoot 的项目,项目打包类型是,jar并且我还在项目中添加了 jetty 依赖项,当我尝试使用 构建项目时mvn jetty:run,构建成功,但我收到这样的消息
[INFO] 跳过 keycloak-springboot-demo :不支持打包类型 [jar]
下面是我的 pom.xml 文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dasniko</groupId>
<artifactId>keycloak-springboot-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>keycloak-springboot-demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<keycloak.version>3.2.0.Final</keycloak.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-spring-boot-starter</artifactId>
<version>${keycloak.version}</version> …Run Code Online (Sandbox Code Playgroud)