1, hibernatequeryexception exception:
HQL statement: "From manager as model where model." + propertyname + "=?", the database table named Manager, so that the same as SQL to write the surface directly, in fact, Hibernate has mapped the table to an
Find (String queryString, object[] values);
The argument for this method must be an array, not a list.
In the project, to query the database inside the user name and password match, to pass two parameters to go in. As follows:
String hql= "from
The following two error exceptions are often encountered during the course of learning SSH
1.Servlet action is not available
This exception is typically a configuration file error
can refer to Http://blog.csdn.net/yangshoubo/archive/2009/09/05/452
Document directory
Remove the offending SSH key
Remove the offending SSH key
Following error will be displayed when the remote host key changes (after you 've connected earlier with a valid remote host key ).
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Commons-logging-1.0.4.jar
You do not need to import Struts2 after it is added.
Log4j-1.2.15.jar
Hibernate does not need to be imported after it is added.
Jar file: The red is the correct jar package.
Operate the database jar
Mysql-connector-java-
I suddenly learned this thing and found this book.
Struts 2.21 spring 2.5.6 configure IOC or something through annotation.
1. Struts basic configuration, also remember to add struts2-spring-plugin-2.2.1.1.jar this package
2. Spring requires
thread
And then
Resource resource=new Classpathresource ("/web-inf/applicationcontext.xml");
Beanfactory factory=new xmlbeanfactory (Resource);
Sessionfactory sessionfactory = (sessionfactory) factory.getbean ("Sessionfactory");
You can get it.
The
First I guarantee that the code will work well before AOP is implemented.Then learn SSH uses AOP to add permission control before the action method, which is to log the error message.
Explain AOP with XML annotations first
At first the
Http://wenwen.soso.com/z/q171226418.htm
Solve garbled several small points:
1. Configure the filter, you can choose to write yourself, since you use the SSH framework is simpler, directly with spring filter, web.xml configuration can be.
2.JSP
SSH integration in the versions are: Struts2, Hibernate4, Spring4
In the integration, the Opensessioninviewfilter filter is added to the Web.xml, as follows:
struts2
1, error message: Java.lang.IllegalStateException:BeanFactory not initialized or already closed-call ' refresh ' before accessing is Ans via the ApplicationContext
Probably look at the error message: Beanfactory is not instantiated or has been
First, the collection cache1. Do not use the collection cache:2. Use the collection cache:1) Configuration Hibernate.cfg.xml2) Test:
Second, supplemental level two cache, collection cache configuration
Third, query cacheList () is only cached by
First, the reason for this error: When using Hibernate, you can sometimes encounter this exception: Java.lang.IllegalArgumentException:id to load are required for loading, This is because the passed-in ID is null when using a query similar to
For the SSH framework, the core is spring.
1Struts is only responsible for intercepting requests on the browser side (which can be understood to get request requests, that is, to get the request object.) The Request object contains information
As we all know, spring function is very powerful ~ mainly in two aspects: one is the IOC control inversion, and the other is AOP oriented aspect thinking.
Spring can host hibernate as well as transactions, and it also provides
I wonder if you have ever encountered this problem: using SSH to connect to the server, when compiling a program (such as LNMP one-key installation package), the network is abnormal or other factors cause a sudden disconnection, the remote command
Yesterday, I saw two articles about ssh: remote logon, remote operations, and port forwarding. Although I have been using ssh, I only need to use it to remotely log on to Linux. After reading these two articles, I realized that there was such a fun
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.