定义View Params之间有什么区别:
<f:metadata>
<f:viewParam name="id" value="#{someBean.id}"/>
</f:metadata>
Run Code Online (Sandbox Code Playgroud)
并在ManagedBean中定义属性,如下所示:
@ManagedProperty(value = "#{param.id}")
private Integer id;
Run Code Online (Sandbox Code Playgroud) 我正在使用Java,我想在我的应用程序中保持servlet不断运行,但我不知道怎么做.我的servlet有一个方法,它每天从数据库中提供用户的计数以及整个数据库中用户的总数.所以我想保持servlet不断运行.
multithreading servlets background-process java-ee scheduledexecutorservice
我用spring + hibernate创建了一个应用程序,但我总是遇到这个错误.这是我第一次使用hibernate的应用程序,我读了一些指南,但我无法解决这个问题.我哪里做错了?
这是我的应用程序的代码
ott 05, 2014 4:03:06 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
Informazioni: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1eab16b: startup date [Sun Oct 05 16:03:06 CEST 2014]; root of context hierarchy
ott 05, 2014 4:03:06 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
Informazioni: Loading XML bean definitions from class path resource [springConfig.xml]
ott 05, 2014 4:03:08 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
ott 05, 2014 4:03:08 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.6.Final}
ott 05, 2014 4:03:08 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found …Run Code Online (Sandbox Code Playgroud) 策略模式和依赖注入都允许我们在运行时设置/注入对象.策略模式和依赖注入之间有什么区别?
在spring MVC应用程序中,我使用以下方法初始化其中一个服务类中的变量:
ApplicationContext context =
new ClassPathXmlApplicationContext("META-INF/userLibrary.xml");
service = context.getBean(UserLibrary.class);
Run Code Online (Sandbox Code Playgroud)
UserLibrary是我在我的应用程序中使用的第三方实用程序.上面的代码为'context'变量生成警告.警告如下所示:
Resource leak: 'context' is never closed
Run Code Online (Sandbox Code Playgroud)
我不明白这个警告.由于应用程序是一个Spring MVC应用程序,因此当我在应用程序运行时引用该服务时,我无法真正关闭/销毁上下文.试图告诉我的警告究竟是什么?
抛出此方法
java.lang.IllegalStateException:在提交响应后无法转发
我无法发现问题.有帮助吗?
int noOfRows = Integer.parseInt(request.getParameter("noOfRows"));
String chkboxVal = "";
// String FormatId=null;
Vector vRow = new Vector();
Vector vRow1 = new Vector();
String GroupId = "";
String GroupDesc = "";
for (int i = 0; i < noOfRows; i++) {
if ((request.getParameter("chk_select" + i)) == null) {
chkboxVal = "notticked";
} else {
chkboxVal = request.getParameter("chk_select" + i);
if (chkboxVal.equals("ticked")) {
fwdurl = "true";
Statement st1 = con.createStatement();
GroupId = request.getParameter("GroupId" + i);
GroupDesc = request.getParameter("GroupDesc" + i); …Run Code Online (Sandbox Code Playgroud) servlets response forward illegalstateexception requestdispatcher
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.library.controller.*"%>
<%@ page import="com.library.dao.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.Date" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Return Page</title>
</head>
<body bgcolor="#aabcde">
<div align="right"><a href="Login.jsp">Logout</a></div>
<table align="center" border="2" cellspacing="3" cellpadding="3">
<tr><th>BookID</th><th>BookName</th><th>Issuedate</th><th>returndate</th></tr>
<c:forEach var="element" items="${list}">
<tr>
<td>${element.getBookid}</td><td>${element.getBookname()}</td>
<td>${element.getIssuedate()}</td><td>${element.getReturndate()}</td>
</tr>
</c:forEach>
Run Code Online (Sandbox Code Playgroud)
Eclipse IDE显示红色下划线,当我关注它时,标记是:找不到http://java.sun.com/jsp/jstl/core的库描述符
我有一个domainPrice设置为BigDecimal数据类型的域类.现在我正在尝试创建一个比较价格的方法,但似乎我不能在BigDecimal数据类型中有比较运算符.我是否必须更改数据类型或是否有其他方法?
在JSF 2对注释的大力支持之后,我想知道我将使用它faces-config.xml.它现在的重要性是什么?
换句话说,只能faces-config.xml通过注释而不是通过注释完成哪些配置?
现在我用它的所有东西都是声明Spring的EL解析器.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>
Run Code Online (Sandbox Code Playgroud) 我正在开发一个Java EE Web项目.当我尝试添加依赖项时,会出现此错误消息.我使用Eclipse Kepler.
在"正在更新Maven项目"期间发生内部错误.显示java.lang.NullPointerException
你可以帮帮我吗?谢谢.

java ×3
spring ×3
eclipse ×2
java-ee ×2
jsf ×2
jsf-2 ×2
servlets ×2
spring-mvc ×2
bigdecimal ×1
faces-config ×1
forward ×1
hibernate ×1
jsp ×1
jstl ×1
m2eclipse ×1
managed-bean ×1
maven ×1
response ×1
spring-orm ×1
viewparams ×1