2014年1月7日星期二

About dom4j handle escape characters

My xml there are escape characters , such as ", > so on.
I dom4j for xml processing, and then re- write back .
public static void execute(/*一些参数*/) throws Exception {
    filepath = "D:\\form.xml";
    SAXReader reader = new SAXReader();
    Document doc = reader.read(new File(filepath));
        
    //......一些处理
        
    XMLWriter xmlWriter = new XMLWriter(new FileOutputStream(filepath));
    xmlWriter.write(doc);
    xmlWriter.close();
}
xml file
get inside " into a double quotation mark , > unchanged.
I want him to have the same , " or ", do not become double quotes.
Online, thank you.
------ Solution ---------------------------------------- ----
saxRead.setEncoding ("UTF-8"); specify the format you use , GB2312
------ Solution -------------- ------------------------------
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("utf-8");
XMLWriter writer = new XMLWriter(new OutputStreamWriter(new FileOutputStream(filename), "utf-8"), format);
writer.write(document);
writer.close();

------ Solution ---- ----------------------------------------
try cdata, Portal: http://www.w3school.com.cn/xml/xml_cdata.asp


<script>
<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then
  {
  return 1;
  }
else
  {
  return 0;
  }
}
]]>
</script>

------ Solution ------------------------------------- -------
that you put it up
------ Solution ------ --------------------------------------
/ / add xml file transcoding another method
OutputFormat format = OutputFormat.createPrettyPrint ();
format.setEncoding ("UTF-8");
XMLWriter writer = new XMLWriter (new FileOutputStream ("src / book.xml"), format);
writer.write (document);
writer.close ();
}
original source : http://blog.csdn.net/tianyazaiheruan/article/details/8065722
------ For reference only -------------------------------------- -


This method does not work , " into a double quotes.
------ For reference only -------------------------------------- -


This method does not work , " into a double quotes.
------ For reference only -------------------------------------- -


xml is generated by other software xml, can not change the format .
------ For reference only -------------------------------------- -


xml is generated by other software xml, can not change the format .
------ For reference only -------------------------------------- -
I try to read into the first string converted to xml document, but a problem with the byte stream will be garbled , with a character stream " or become double quotes.
------ For reference only -------------------------------------- -
who can help me ah
------ For reference only ---------------------------- -----------
I also encountered the same problem , the landlord solved?

Find ICBC Internet Banking Interface demo

What is needed now is an online payment . previously did not touch this , looked to the data bank , confusedly . Are there any demo, refer to me ! I am very grateful
------ Solution -------------------------------------- ------
http://wenku.baidu.com/view/0076bc9bdaef5ef7ba0d3c8b.html
------ Solution ---------------- ----------------------------
http://ishare.iask.sina.com.cn/f/24367170.html ? from = dl you can refer to a project Chi Chuan podcast , running is not a problem.
------ Solution ---------------------------------------- ----
I see it !
------ For reference only -------------------------------------- -

Thank you for your answer, the bank has given me to me.
I do not know where to start,
There are those crt key file does not know how to use. Hope wing
------ For reference only ----------------------------------- ----

I look down , if you do not understand , look to the wing .
------ For reference only ---------------------------------------


This is yeepay 's and ICBC's also not the same
------ For reference only -------------------- -------------------
seeking interfaces used in the jar package. I downloaded icbc.jar seems wrong !
------ For reference only ---------------------------------------
jar package has been found
http://pay.googlecode .com/svn-history/r6/trunk/payment/WebContent/WEB-INF/lib/icbc.jar

If you still do not understand the question we have to ask
------ For reference only --------------------- ------------------
now there has been such a problem
java.lang.NoClassDefFoundError: cn/com/infosec/util/base64/MyBASE64Decoder

I do not know is that the package inside , icbc.jar there is no
------ For reference only ------------------- --------------------
you how this is done ? I pray thee, help ! I also began to receive this interface , I do not know how to start

Younger newcomers , ask questions, comes this tomcatPluginV33 tomcat eclipse plugin and myeclipse What is the difference between you


tomcatPluginV33 This plugin can also debug mode debug it? What are the advantages of each , and I waited a long time searching online , the result is not found. . . So I would like to ask the god point . . . Previously been used myeclipse, suddenly the next eclipse better suited
------ Solution ---------------------------- ----------------
What V33 plug-in ? window -> preference -> add server under your locally installed tomcat on the line
------ Solution ------------- -------------------------------
tomcatPluginV33 not used. debug with eclipse does not matter whether or myeclipse , myeclipse can own tomcat, you can configure your own tomcat go , but eclipse must manually configure themselves into tomcat . The remaining debug it all the same , tomcat with debug mode is activated , then the breakpoint in the code it wants .
------ Solution ---------------------------------------- ----
Why must use V33 plug-in it, if nothing special use, to download a generic apache tomcat from above it, the landlord said the V33 plug-in, no contact .
------ Solution ---------------------------------------- ----
Baidu Baidu bar, Baidu V33 eclipse, has been using the eclipse, with respect to the myeclipse, eclipse jar package to add something, not so humane , so you need to manually do more.
------ For reference only -------------------------------------- -
ah , this plugin , I can use it in eclipse, plugin folder to copy files. . . But I do not know contrast myeclipse Advantages Disadvantages . . . . Do not know can not debug mode. . . .
------ For reference only -------------------------------------- -
but did not eclipse the v33 plugin debug mode the Start button. . . Just start tomcat , then , even if transferred to debug view , add breakpoints can not stop at the breakpoint bar. . .
------ For reference only -------------------------------------- -

I am also very messy
eclipse of the V33 does not know the ins and myeclipse than really easy , my initial testing, you can open the jsp page, you built a servlet and fewer package, I'll look up information
----- - For reference only ---------------------------------------
why not V33 plug-in to use it, if nothing special use, to download a generic apache tomcat from above it, the landlord said the V33 plug-in, no contact .   leadership required test. . . And it certainly is for the convenience of plug-ins , and I also want to know exactly what are the benefits . . . Incidentally adapt adapt eclipse. . .
------ For reference only ---------------------------------------
ah , well, I'm more than Cece , slow slow familiar with the matter, thank you for help Kazakhstan, did a lot of things yourself . . . I go yourself . . . .

Scores java reflection mechanism neighborhoods seek to understand God 's great advice ~

[size = 18px] hibernate read out the list I use , I would like to turn into a List
Get reflection by Field Object names marked with , ah to map
I know the idea but do not know how depressing to realize
[/ size]
------ Solution - -------------------------------------------

Great God set out
------ Solution --------------------------------- -----------
God out of the top big
------ Solution - -------------------------------------------
http:// blog.csdn.net/snihcel/article/details/7270502

look at this
------ Solution --------------------------------- -----------
reference I have here the most simple Lie himself wrote the line : http://blog.csdn.net/withiter/article/details/8859399
------ Solution ---------------------------------------- ----
forget to wait for the god review
------ Solution -------------------------- ------------------
hibernate return this List elements of this object [] are not necessarily inside the entity class object , If it is not an entity class object landlord sql queries, but to get a collection of some of the fields , then this object [] which is filled with an array of those queries is likely to be out of the field so that they would become [int, String , boolean, ...] so the data array.
If the landlord does query is an entity class object , then do not use any reflection , the direct use of commons-beanUtils Tools

public List<Map> reflectObjToMap(List<Object[]> list){
    List<Map> list=new ArrayList<Map>(); 
    for(Object[] object:list){
        for(Object obj:object){
            Map map=BeanUtils.describe(obj);
            list.add(map);
        }
    }
    return list;    
}

------ Solution ------------------------------------- -------

  
I see trouble code :   
  

public void reflectObjToMap(List<Object[]> list){

for(Object[] object:list){
for(Object obj:object){
Field[] fields = obj.getClass().getDeclaredFields();
for (Field field : fields) {

System.out.println(field.getName());

}
}

}
 

upstairs to say, you can print out obj look
------ Solution ----------------------- ---------------------
great God ? Seek advice code. . .  
only need to open Eclipes then copied into running it. Very simple.
In addition to my personal experience, the actual project reflex mechanism is rarely used . But a lot of that is reflective of our familiar frameworks such as Struts , with its implementation principle .
------ Solution ---------------------------------------- ----
I came to learn , somewhat difficult ah
------ For reference only ----------------------- ----------------


I see trouble code :

public void reflectObjToMap(List<Object[]> list){

for(Object[] object:list){
for(Object obj:object){
Field[] fields = obj.getClass().getDeclaredFields();
for (Field field : fields) {

System.out.println(field.getName());

}
}

}

------ For reference only ----------------------------------- ----


I am a SQL query using the hibenate 's , List returned results returned not right ~
------ For reference only -------- -------------------------------
great God ? Seek advice code. . .

How to choose the company

junior intern Now a junior brother , as well as graduation year , the company is now looking for internships , is has received some companies offer, these four do not know how to choose , and each is good , hope predecessors pointing.

Company 1: state-owned enterprises ; listed companies ( the size :500 -999 ) ; company great reputation ; engaged in government projects ( non- telecom , non-financial ) ; highest intern treatment projects ; less overtime ; calm working atmosphere , but the lack of vigor .
2
Company : Kingdee R & D department ; engaged in medical ;

Company 3 : newly listed companies ( scale: 1000 above ) ; engaged in the communications industry , with Huawei and other communications giants have cooperation ; inside individual platform greatly ; learn a lot of things will be ; but treatment generally ; overtime ; pressure very large ;

Company 4 : not listed ( scale :300- 500 headquarters in Beijing ) ; engaged in African telecommunications traffic ; inside interns care, training and treatment are very good ; company atmosphere very well , the company internal vibrant ;

note not to show off stickers ! ! I just want seniors to be able to not touch this little community of younger proposal , after all, so chose , will decide my future direction of development , I would like to choose carefully ! ! !
Also want to say is , I hope that after two years of project managers and marketing managers turn !
hope to be able to help me choose which four companies arranged for the order , and give suggestions to , thank you thank you ! ! ! Note that I am now training stage !


------ Solution ------------------------------------ --------
I think SOE is not going
------ Solution ---------------------- ----------------------
If you want to learn the real thing . State-owned enterprises will not have a personal recommendation . . After all, the most important stage of learning to the students something . As to what the treatment should not be too care about
------ Solution --------------------------------- -----------
seem outsourcing company.

lz, your own answers have been very clear , because of the various advantages and disadvantages you have written, the most visible and obvious at a glance. Like father do ?

not know the truth , just because in this mountain !
------ Solution ---------------------------------------- ----
I'd suggest you go to Internet companies, but unfortunately , it should not be more than four , right ? lz confirm .

1 or 2 can be.
see what your current needs are the main .
You currently valued internship wages, of course, to the best of treatment .
If you value whether it can learn something, then do not go to state-owned enterprises .
Also, you have a misconception that you think often work late at night is not normal ? That you're wrong . Unless you quit this line , otherwise , overtime too normal. Do not work overtime , or three years , you can scrap it . Do you really think you are doing for three years, others slaving away overtime dry years , the same? Can the same?
------ Solution ---------------------------------------- ----
internship when cheap labor is gone , but not on behalf of those went , as long as something can be learned which are the same.
------ For reference only -------------------------------------- -
programmers way to go if the proposed Kingdee, the other senses are not fleeting is not clear
------ For reference only ------------------ ---------------------

go ! ! !
------ For reference only -------------------------------------- -
Kingdee . Spent inside out looking for work on soeasy it.
3 will not have the company also listed a jb, cooperation with Huawei , if it is a good company will not be treated also generally much overtime , eight outsourcing company it is .

row a sequence bar 2 4 1 3
------ For reference only --------------------- ------------------
buddy , your statement is true? Kingdee play out looking for a job after soeasy, you have a case ? ? ?
------ For reference only -------------------------------------- -
really , really see the game better . . Because there is no how social contact , because of less experience, so I do not know which way is the best.
------ For reference only -------------------------------------- -
all speak regardless of the state-owned foreign wages high wages is king ! To chart the future of money only ! The right to the highest wages
------ For reference only ------------------------------- --------
lz very powerful ah, yes it own your own self or participated in the training ? I am also a junior this year, also want to practice, treatment as long as they live on their own on the line , the purpose is to learn something of the reach of school , you can leave a qq , would like to ask to ask
------ For reference only ---------------------------------------


state-owned enterprises , the civil service exam go after a long time on a mix of cooked -point line basically finalized Civil

retire to enjoy at least a level cadres bureau-level cadres treatment

good, you look for when you get married on Civil sister a lot of yes.




------ For reference only -------------------------------- -------
ashamed of drifting ~ ~ ~ ~ ~ ~
------ For reference only ------------------ ---------------------


agree that the key is to choose Which .
------ For reference only -------------------------------------- -
practice , it is difficult to learn things , older students who are not familiar with you , it is difficult to say.
------ For reference only -------------------------------------- -
or start their own businesses better
------ For reference only ------------------------------ ---------
finally went to the company's four , started the company's cache server , thank you for the reply.
------ For reference only -------------------------------------- -
landlord is to do what the c + + ? What is linux c + + ?
------ For reference only -------------------------------------- -
landlord which city ?

A multiple ajax request a JSP problem ACTION multiple methods

Submitted an ajax request in a JSP page in a method ACTION returned data , and then click submit ACTION ajax request in a second method , then Baocuo Neither getCity () nor it's doXxx () equivalent is defined in action class com.inspur.xxx.action.xxAction. ask how to solve . First contact. No problem there first request data is returned .
------ Solution ---------------------------------------- ----
your first time does not change action, on the request of the default action of the treatment is no problem , and then a second time to change the action of the treatment method of error bars , the two barely look at this , Last night broke a demo, but also wrong, in debugging .
------ For reference only ---------------------------------------
you are using a servlet it, you servlet which defines the getCity way? Each action request is a different approach , then it define multiple servlet to handle it.
------ For reference only -------------------------------------- -
useless SERVLET using XWORK
------ For reference only --------------------------- ------------
with js, ajax has nothing directly to individual requests test method should be no definition
------ For reference only ------- --------------------------------
is an action which defines several methods, and then go to the dynamic a request to change the approach it ?
------ For reference only -------------------------------------- -
yes. The first request is no problem , and the second on Baocuo .
------ For reference only -------------------------------------- -
Oh, no request to the second method , you throw wrong , ACTION is the same .
------ For reference only -------------------------------------- -
  The reply was deleted administrator at 2014-01-07 11:30:48

------ For reference only ---------------------------------- -----
can you put out a few ajax the url see it
------ For reference only ----------------- ----------------------
get, is my stupid , hurry , is to visit ACTION second method parameters , parameter is not SETGET . Really depressed.

A small problem on inheritance

Probably the situation is this:
a.jar there is a class a,
b.jar there is a class b, b is inherited from a
c.jar Lane used the b.

The question now is

c.jar b where b can only be used to write the method can not be called a b parent class method .

Please also help explain Thank you .

a class is public , but also public of all methods .

If super. Such a method , the compiler can too , but when running , or not able to find a class.

------ Solution ------------------------------------ --------
have cited several jar package it came in

------ Solution ------------------------------------ --------
not find a a.jar because you do not have to introduce it
------ For reference only -------------- -------------------------
do not understand , but since all public methods , you will not need to use the super bar, , , ,
------ For reference only ----------------------------------- ----
finally want to understand how it was a child.

Thanks for the two

nexus in linux build problem

Before I also had to build a Windows environment nexus is no problem, but with the latest nexus in linux install some problems today itself I was not very familiar with linux , some commands do not know how to configure anything .
I am here to build experience these problems , find some online article describes the different versions , but I did not have to successfully build according to their example. Such as : http://tech.it168.com/a2011/0712/1216/000001216832.shtml the inside says executive nexus of this file in nexus/bin/jsw/linux-x86-64 / directory , it is easy to start completed.
but I downloaded version http://221.181.104.16/videoplayer/nexus-latest-bundle.zip?ich_u_r_i=232fba36eda60cc9ee68056f81cb509a&ich_s_t_a_r_t=0&ich_e_n_d=0&ich_k_e_y=1345128928750463522426&ich_t_y_p_e=1&ich_d_i_s_k_i_d=6 & ; ich_s_e_q = 12282988 & ich_u_n_i_t = 1

In that directory there is no nexus of this file , only one wrapper binary file, but can not execute the file.
tips are as follows :

[root@Web linux-x86-64]# pwd
/usr/local/nexus-2.7.0-06/bin/jsw/linux-x86-64
[root@Web linux-x86-64]# ls
wrapper
[root@Web linux-x86-64]# wrapper start
-bash: wrapper: command not found
[root@Web linux-x86-64]# 

does have a script file called nexus under the nexus / bin directory, but still can not execute prompt command not found.

Seek expert rescue ! !
------ Solution ---------------------------------------- ----
people? People? ? ?
------ Solution ---------------------------------------- ----
in linux wrapper start of this execution is problematic .
If you are in command inside the directory , you should use the / command, for example . / nexus.sh
otherwise want to use an absolute path, such as / usr/local/nexus-2.7.0-06/bin/jsw/linux-x86-64/bin/nexus.sh
------ For reference only ---------------------------------------
wow , no man? ??
------ For reference only ------------------------------------ ---
with seeking expert rescue ! ! ! ! ! ! ! !
------ For reference only -------------------------------------- -
wow , it really is nobody
------ For reference only ------------------------??? ---------------

ah , yes . Followed by the . / Configure after it easily done . thanks!
------ For reference only -------------------------------------- -

see you downstairs like

EL expressions [ new ] Why can salvage value in the value stack

 This post last edited by the iwieijakdf on 2014-01-07 08:16:12
I have a list value of a collection of objects into a stack Map stack in the background

public String getLastVersionPD(){
ActionContext.getContext().put("pdList", this.pdManager.getLastVersonPD());
return "listAction";
}

then iteration OGNL expressions in the foreground

<s:iterator value="#pdList">
  <s:property value="name"/>
  <s:property value="version"/>
  <s:a action="pdManagerAction_delete?key=%{key}">删除</s:a>
  <a href="javascript: showProcessImage('${requestScope.deploymentId}')">查看流程图</a>
</s:iterator>

name version key deploymentId is a property of an object , the value is placed on top of the stack when the stack object iteration , in front of the name version key expression can use OGNL value stack objects in the stack take the value , why use EL expressions can also be obtained at the request scoped attribute deploymentId it
------ Solution --------------------- -----------------------
landlord this issue , why take the request scope with el things will also take it to the value of the contents of the stack . problem it is necessary to combine struts2 source , we know there is HttpServletRequest request in javaee it is all packaged inside an interface is implemented by javax.servlet.http.HttpServletRequestWrapper class . struts2 own javax.servlet.http . HttpServletRequestWrapper achieve , that is org.apache.struts2.dispatcher.StrutsRequestWrapper in struts2-core packet re getAttribute method was rewritten.
We know the value of request scope el expressions take is to call request.getAttribute (String s);
what this is struts2 getAttribute method of org.apache.struts2.dispatcher.StrutsRequestWrapper rewriting the source code for part

public Object getAttribute(String s) {
        if (s != null && s.startsWith("javax.servlet")) {
            //如果是${requestScope.javax.servlet.属性名的}就直接去request里面取值
            return super.getAttribute(s);
        }
//关键在下面,先从request里面取值取不到时就从值栈里面取值,所以就可以解释楼主这个为啥也能取到值了
        ActionContext ctx = ActionContext.getContext();
        Object attribute = super.getAttribute(s);
        if (ctx != null) {
            if (attribute == null) {
                boolean alreadyIn = false;
                Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute");
                if (b != null) {
                    alreadyIn = b.booleanValue();
                }
                if (!alreadyIn && s.indexOf("#") == -1) {
                    try {
                        // If not found, then try the ValueStack
                        ctx.put("__requestWrapper.getAttribute", Boolean.TRUE);
                        ValueStack stack = ctx.getValueStack();
                        if (stack != null) {
                            attribute = stack.findValue(s);
                        }
                    } finally {
                        ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
                    }
                }
            }
        }
        return attribute;
    }

------ For reference only ----------------------------------- ----
# non- root object is accessed , it is non- value data stack , such as ognl context and action context. # Can be understood as ActionContext.getContext ().
EL expressions, such as $ {username}, equivalent to request.getParameter (username), and then you go to understand what is meant by request it.
------ For reference only -------------------------------------- -
<s:iterator value="#pdList">
this sentence is to traverse the collection every single element in turn placed on the stack , el expression values ​​also directly from the value stack , so we get to the amount
--- --- For reference only ---------------------------------------
understand Thank

Urgent ! dwz rich client framework javasrcipt of linet chart problem

I draw a line chart , if the value of y is negative , it does not show up , only partially displayed on the screen y is a positive number , it should be how to do it . Like drawing, four quadrants can only see the first quadrant .
------ Solution ---------------------------------------- ----
this framework or do not use a lot of problems
------ Solution ---------------------- ----------------------
landlord if the words themselves will flex package a try, before drawing with are not used jfreechart you say that thing

How to control 1min method only allows access to a 100 ? How to save a long-term data ?

Recently encountered a problem, because the company has a number of systems are in xml or download a photo site , the site only allows access within 1min same IP only 100 times , traffic can not exceed one month's 2.5G, otherwise it was closed IP, and now wants to access all systems are controlled in a common web applications , we would like to use a List to store the URL to access multiple systems , but do not know how long to save the URL, and the brightest great God think? Ideas how to help the long-term preservation of this data ?
------ Solution ---------------------------------------- ----
long-term data . . Persistence . . Database. .
------ Solution ---------------------------------------- ----
saved to the database or file it
------ For reference only ------------------------- --------------
not fall ah ! Top up ! ! ! ! !

hibernate configuration mistakes most , how to do first aid ah ......


2011-6-20 14:51:11 org.hibernate.annotations.common.Version <clinit>
信息: Hibernate Commons Annotations 3.2.0.Final
2011-6-20 14:51:11 org.hibernate.cfg.Environment <clinit>
信息: Hibernate 3.6.4.Final
2011-6-20 14:51:11 org.hibernate.cfg.Environment <clinit>
信息: hibernate.properties not found
2011-6-20 14:51:11 org.hibernate.cfg.Environment buildBytecodeProvider
信息: Bytecode provider name : javassist
2011-6-20 14:51:11 org.hibernate.cfg.Environment <clinit>
信息: using JDK 1.4 java.sql.Timestamp handling
2011-6-20 14:51:11 org.hibernate.cfg.Configuration configure
信息: configuring from resource: /hibernate.cfg.xml
2011-6-20 14:51:11 org.hibernate.cfg.Configuration getConfigurationInputStream
信息: Configuration resource: /hibernate.cfg.xml
2011-6-20 14:51:11 org.hibernate.cfg.Configuration doConfigure
信息: Configured SessionFactory: null
2011-6-20 14:51:11 org.hibernate.cfg.AnnotationBinder bindClass
信息: Binding entity from annotated class: hb.learn.model.User
2011-6-20 14:51:11 org.hibernate.cfg.annotations.EntityBinder bindTable
信息: Bind entity hb.learn.model.User on table user
2011-6-20 14:51:11 org.hibernate.cfg.Configuration applyHibernateValidatorLegacyConstraintsOnDDL
信息: Hibernate Validator not found: ignoring
2011-6-20 14:51:11 org.hibernate.validator.util.Version <clinit>
信息: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
Exception in thread "main" org.hibernate.HibernateException: Unable to get the default Bean Validation factory
at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:127)
at org.hibernate.cfg.Configuration.applyBeanValidationConstraintsOnDDL(Configuration.java:1704)
at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1654)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1445)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1856)
at hb.learn.util.HibernateUtil.main(HibernateUtil.java:15)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:118)
... 5 more
Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:383)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:109)
... 10 more
Caused by: javax.validation.ValidationException: Unable to instantiate Configuration.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:272)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:380)
... 11 more
Caused by: java.lang.NullPointerException
at java.util.ResourceBundle.getBundle(ResourceBundle.java:960)
at org.hibernate.validator.engine.ResourceBundleMessageInterpolator.loadBundle(ResourceBundleMessageInterpolator.java:202)
at org.hibernate.validator.engine.ResourceBundleMessageInterpolator.getFileBasedResourceBundle(ResourceBundleMessageInterpolator.java:182)
at org.hibernate.validator.engine.ResourceBundleMessageInterpolator.<init>(ResourceBundleMessageInterpolator.java:81)
at org.hibernate.validator.engine.ResourceBundleMessageInterpolator.<init>(ResourceBundleMessageInterpolator.java:73)
at org.hibernate.validator.engine.ConfigurationImpl.<init>(ConfigurationImpl.java:57)
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:43)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
... 13 more


------ Solution ------------------------------------- -------
+1 +1 +1 +1 +1 +1
------ Solution ------------------ --------------------------
is not necessary jar package did not lead the whole ah
------ Solution --------------------------------------------
can not be instantiated Disposition . Look at the configuration posted under way . .
------ For reference only -------------------------------------- -
hibernate.cfg.xml
This is my configuration file:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/spring
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>

<!-- JDBC connection pool (use the built-in) --><!--
<property name="connection.pool_size">1</property>

--><!-- SQL dialect -->
<property name="dialect">
org.hibernate.dialect.MySQL5Dialect
</property>

<!--<Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache  -->
<property name="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>

<mapping class="hb.learn.model.User" />
</session-factory>
</hibernate-configuration>

------ For reference only ----------------------------------- ----
I configure the java web project where , after deleting all javaee 6libraries as long as there's a package, you can not go wrong , and this is how Nigeria ! ?
------ For reference only -------------------------------------- -
Dinga , which experts help me ah ......
------ For reference only ---------------------- -----------------
org.hibernate.HibernateException: Unable to get the default Bean Validation factor
This anomaly needs to be configured in the hibernate.cfg.xml configuration file:
none
------ For reference only ----------- ----------------------------
Thank upstairs selfless dedication , the use of this approach can really solve
hibernate tests reported problems such errors , thank you again !
------ For reference only -------------------------------------- -
7 floor right way . Spring3 + Hibernate3.6 + Junit4 can write unit tests.
------ For reference only -------------------------------------- - 7th floor

powerful
Why can explain it ?
------ For reference only -------------------------------------- -

hibernate by default will use the bean validation features, adding if the configuration file
none
This configuration is tell me NA hibernate bean validation function , of course, will not hibernate factory class initialization tests , and also not being given up !
------ For reference only -------------------------------------- -
much worse ! Thank Kazakhstan, taught the ~
------ For reference only ------------------------------- --------
powerful. . . . I am also the same mistake. . Now finally resolved
------ For reference only ----------------------------------- ----
badly, I'm looking for a long time do not know what wrong ? Thanks. .
------ For reference only -------------------------------------- -
So now , previously solved , looked up and guess

jsp page online editor was used ckedictor + ckfinder did not ?

I use ckedictor + ckfinder online page editor in the local test well , the picture of what functions can be achieved , why not upload it to the server after the upload picture function , and help us to see how going door prawn
web.xml configuration

ConnectorServlet
com.ckfinder.connector.ConnectorServlet

XMLConfig
/ WEB-INF/config.xml


debug
false

1


ConnectorServlet
<-! note the path where you want to place the path ckfinder and fully consistent with the job - >
/ ckfinder / core / connector / java / connector.java



10

config.xml configuration

true

yanjiusuo / uploadfile / <- where you want to save into their own ! path on it ->


1600
1200
80
UTF-8
false
CKFinder_UserRole
true
true
true
html, htm, xml, js

. svn
CVS


. *




% BASE_URL% files /
% BASE_DIR% files
0
7z, aiff, asf, avi, bmp, csv, doc, docx, fla, flv, gif, gz, gzip, jpeg, jpg, mid, mov, mp3, mp4, mpc, mpeg, mpg, ods, odt, pdf, png, ppt, pptx, pxd, qt, ram, rar, rm, rmi, rmvb, rtf, sdc, sitd, swf, sxc, sxw, tar, tgz, tif, tiff, txt, vsd, wav, wma, wmv, xls, xlsx, zip




% BASE_URL% images /
% BASE_DIR% images
0
bmp, gif, jpeg, jpg, png



% BASE_URL% flash /
% BASE_DIR% flash
0
swf, flv





*
*
/
true
true
true
true
true
true
true
true



true
% BASE_URL% _thumbs /
% BASE_DIR% _thumbs
false
100
100
80



imageresize
com.ckfinder.connector.plugins.ImageResize







fileeditor
com.ckfinder.connector.plugins.FileEditor



com.ckfinder.connector.configuration.ConfigurationPathBuilder
Content on this page

content :


------ Solution - -------------------------------------------
the project structure Screenshot sent to ,
------ Solution ------------------------------------- -------

  
    

The baseUrl set to http:// ip / yanjiusuo / uploadfile / Try
There is ie, you try to change chrom browser

ckfinder ckeditor latest version of the previous word is seemingly browser have a choice. This did not get to know how to get . Looking at the data
------ For reference only ----------------------------------- ----



------ For reference only ----- ----------------------------------
dizzy , too much eye

hibernate problem : intermediate table entity class you need to write ?

For example , I have a student table , there is a curriculum, is one to many relationship : each student can select multiple courses

Student hypothetical field : s_id, s_name
Course assumptions fields : c_id, c_name

middle table s_c assumptions fields : id, s_id, c_id

then hibernate in the middle of the table needs to be written this entity class do ?


------ Solution ------------------------------------ --------
write , do not write
------ Solution ------------------------ --------------------
No, just add the line corresponding annotation or xml configuration, if the table is automatically created by hibernate in the database to generate the corresponding an intermediate table
------ Solution ------------------------------------ --------


Each course can only be called when there is a student -to-many .



configured to -many do not need .
------ Solution ---------------------------------------- ----
do not remember the details , not long , but you do not see it on oneToMany like, you go to see hibernate many, many of these comments is how to use it
------ For reference only ---------------------------------------

  
Each course can only be called when there is a student -to-many .   
  
     
  
configured to -many do not need .  



is not written so that you can
Student category :
@Entity
@Table(name = "student", catalog = "db")
public class Student implements java.io.Serializable {

private Integer id;
private String name;
private String password;
private Boolean isDelete;
private Set<Course> Courses= new HashSet<Course>(0);

@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}

public void setId(Integer id) {
this.id = id;
}

@Column(name = "name")
public String getName() {
return this.name;
}

public void setName(String name) {
this.name = name;
}

@Column(name = "password")
public String getPassword() {
return this.password;
}

public void setPassword(String password) {
this.password = password;
}

@Column(name = "is_delete")
public Boolean getIsDelete() {
return this.isDelete;
}

public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}

@OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
public Set<Course> getCourses() {
return this.Courses;
}

public void setTCourses(Set<Course> Coursea) {
this.Courses= Courses;
}

}

Course categories:
@Entity
@Table(name = "course", catalog = "db")
public class Course implements java.io.Serializable {

private Integer id;
private String name;
private Boolean isDelete;

@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}

public void setId(Integer id) {
this.id = id;
}

@Column(name = "name")
public String getName() {
return this.name;
}

public void setName(String name) {
this.name = name;
}

@Column(name = "is_delete")
public Boolean getIsDelete() {
return this.isDelete;
}

public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}

}


I write it?
------ For reference only -------------------------------------- -

not write , it should be how to deal with?
------ For reference only -------------------------------------- -


wrong.
------ For reference only -------------------------------------- -
not , he will be generated automatically , try not to write, write bad trouble
------ For reference only --------------- ------------------------

I'm a good database design , and reflection is generated .

However , Hibernate automatically generates entity classes will be generated in the middle of the table , so I would like to ask , this middle of the table , it should be how to write ? Need to manually modify it?
------ For reference only -------------------------------------- -

  
wrong.  

can give pointers about it?
------ For reference only -------------------------------------- -
look anyway you like hibernate support

not write that many-

will write two one-
------ For reference only --------------------------- ------------
package com.hibernate;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "STUDENT", schema = "TEST")
public class Student implements java.io.Serializable {

// Fields

private String stid;
private String stname;
private Set<StudentCourse> studentCourses = new HashSet<StudentCourse>(0);


@Id
@Column(name = "STID", unique = true, nullable = false, length = 40)
public String getStid() {
return this.stid;
}

public void setStid(String stid) {
this.stid = stid;
}

@Column(name = "STNAME", length = 40)
public String getStname() {
return this.stname;
}

public void setStname(String stname) {
this.stname = stname;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "student")
public Set<StudentCourse> getStudentCourses() {
return this.studentCourses;
}

public void setStudentCourses(Set<StudentCourse> studentCourses) {
this.studentCourses = studentCourses;
}

}

package com.hibernate;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name = "COURSE", schema = "TEST")
public class Course implements java.io.Serializable {

// Fields

private String coid;
private String coname;
private Set<StudentCourse> studentCourses = new HashSet<StudentCourse>(0);

@Id
@Column(name = "COID", unique = true, nullable = false, length = 40)
public String getCoid() {
return this.coid;
}

public void setCoid(String coid) {
this.coid = coid;
}

@Column(name = "CONAME", length = 40)
public String getConame() {
return this.coname;
}

public void setConame(String coname) {
this.coname = coname;
}

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "course")
public Set<StudentCourse> getStudentCourses() {
return this.studentCourses;
}

public void setStudentCourses(Set<StudentCourse> studentCourses) {
this.studentCourses = studentCourses;
}

}

package com.hibernate;

import java.math.BigDecimal;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "STUDENT_COURSE", schema = "TEST")
public class StudentCourse implements java.io.Serializable {

// Fields

private StudentCourseId id;
private Course course;
private Student student;
private BigDecimal score;



@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name = "stid", column = @Column(name = "STID", nullable = false, length = 40)),
@AttributeOverride(name = "coid", column = @Column(name = "COID", nullable = false, length = 40)) })
public StudentCourseId getId() {
return this.id;
}

public void setId(StudentCourseId id) {
this.id = id;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "COID", nullable = false, insertable = false, updatable = false)
public Course getCourse() {
return this.course;
}

public void setCourse(Course course) {
this.course = course;
}

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "STID", nullable = false, insertable = false, updatable = false)
public Student getStudent() {
return this.student;
}

public void setStudent(Student student) {
this.student = student;
}

@Column(name = "SCORE", precision = 22, scale = 0)
public BigDecimal getScore() {
return this.score;
}

public void setScore(BigDecimal score) {
this.score = score;
}

}

package com.hibernate;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class StudentCourseId implements java.io.Serializable {

// Fields

private String stid;
private String coid;


public StudentCourseId() {
}

/** full constructor */
public StudentCourseId(String stid, String coid) {
this.stid = stid;
this.coid = coid;
}



@Column(name = "STID", nullable = false, length = 40)
public String getStid() {
return this.stid;
}

public void setStid(String stid) {
this.stid = stid;
}

@Column(name = "COID", nullable = false, length = 40)
public String getCoid() {
return this.coid;
}

public void setCoid(String coid) {
this.coid = coid;
}

public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof StudentCourseId))
return false;
StudentCourseId castOther = (StudentCourseId) other;

return ((this.getStid() == castOther.getStid()) || (this.getStid() != null
&& castOther.getStid() != null && this.getStid().equals(
castOther.getStid())))
&& ((this.getCoid() == castOther.getCoid()) || (this.getCoid() != null
&& castOther.getCoid() != null && this.getCoid()
.equals(castOther.getCoid())));
}

public int hashCode() {
int result = 17;

result = 37 * result
+ (getStid() == null ? 0 : this.getStid().hashCode());
result = 37 * result
+ (getCoid() == null ? 0 : this.getCoid().hashCode());
return result;
}

}

------ For reference only ----------------------------------- ----


doing is to the middle of the table is also the entity class , not the middle of the table there is no way to do entity classes ? Because the current scores in the middle of the table and no other attributes , just used the mapping .
------ For reference only -------------------------------------- - many
between them is actually a many to many , LZ you think it
------ For reference only ----------------- ----------------------
resolved

http://blog.csdn.net/xiaobiaobiao521/article/details/9123303

jsp nested iframe problem

 This post last edited by the beijinuo on 2014-01-06 20:19:29
ask a question, such as my JSP page nested Baidu 's login page, then how can do automatic login feature.
My iframe is nested under if there are other ways to achieve can also be pointing. Online .
nested page login method in JS , how to pass parameters as well as the next .
------ Solution ---------------------------------------- ----

Baidu's account was used to log in , but in my project it to automatically log on Baidu   If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces.
This is the Tencent QQ login interface provides : http://baike.baidu.com/view/5520251.htm
- ----- For reference only ---------------------------------------
own top!
------ For reference only -------------------------------------- -
Zaiding time , seeking support
------ For reference only ---------------------------- -----------

------ For reference only ----------------------------------- ----
you want to use Baidu 's account to log on to your site it .
------ For reference only -------------------------------------- -

I want to do auto- login feature another project in a JSP , the
For example, my a.jsp page embedded baidulogin.jsp page , when I visited a.jsp, automatic login Baidu
------ For reference only -------- -------------------------------
Baidu account you want to use your website or landing
want to use your website account login Baidu ( unlikely ) ?
still want to use your account login Baidu Baidu ?
------ For reference only -------------------------------------- -

---- - For reference only ---------------------------------------

Baidu's account was used to log in , but in my project to automatically log on Baidu only
------ For reference only ---------------- -----------------------

Baidu's account was used to log in , but in my project to automatically log on Baidu nothing more        If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces.   
This is the Tencent QQ login interface provides :    http://baike.baidu.com/view/5520251.htm  
Thank you very much , I have resolved
------ For reference only --------------------------- ------------

Baidu's account was used to log in , but in my project it to automatically log on Baidu            If you are using Baidu 's account to log on to your site , do not know Baidu has provided interfaces.     
This is the Tencent QQ login interface provides :      http://baike.baidu.com/view/5520251.htm          
Thank you very much , I have resolved   Results posted scattered points, my favorite.

Questions , questions about struts + spring configuration singleton , prototype

The action against the struts configuration of the spring , when spring bean is set in a single case , when set to the prototype.
------ Solution ---------------------------------------- ---- under normal circumstances action should
prototype because every action is necessary to request a new instance , if you set a single case so action can only handle one request a while , like Service, DAO examples of such single long enough, because all processing can share one instance

java gui rare characters displayed in the input frame

The current program input uncommon words , such as ying ( Anna ) of the word , it will appear as a frame
should ask what font to display properly set , the default is Arial
In addition , if you need to download the font package can.
------ Solution - -------------------------------------------
landlord is not used the components
------ For reference only awt package under -------------------------------- -------

Yes, used under awt , is to use the swing under it?
Can tell the next method .
------ For reference only ---------------------------------------

awt under there will be such a problem in the Chinese support, can be used
------ For reference only swing under ------------------- -------------------- in support of Chinese

awt occur under such a problem , you can use the swing under the  
If you do not swing down , then there can be any way around this? Because the program will be great changes , more trouble
------ For reference only ----------------------------- ---------- support of the Chinese

awt occur under such a problem , you can use the swing under the  
which class or how to use the swing , can give a DEMO
------ For reference only -------------------- -------------------

into swing changes will not be great at the beginning of each component is to add a J, and if you want to support follow awt Chinese very troublesome
------ For reference only ----------------------------------- ----
it otherwise would have been better with a swing after that there will be similar problems will be more troublesome
------ For reference only ----- ----------------------------------

with awt then how to set Font to make this characters display correctly , I tried simsun, dialog and so can not
Do you know which fonts can be set to what
------ For reference only -------------------------- -------------

into swing changes will not be great at the beginning of each component is to add a J, and if you want to support the Chinese follow awt very troublesome  
I have read, it seems that with the swing, but set the Font to Arial, this will not affect
In addition , said the Internet has changed font.properties of this document, but I do not know what should change the font suitable
------ For reference only ------------- --------------------------

into swing changes will not have much of each component is added at the beginning of a J if you want to support the Chinese follow awt very troublesome          
I have read, it seems that with the swing, but set the Font to Arial, this will not affect   
In addition , said the Internet has changed font.properties of this document, but I do not know which font should change the appropriate  
with the support of the Chinese swing itself does not need to change any thing , awt , then you must be a Chinese gbk your java class files must be encoded in order to display properly gbk , but are generally used utf-8 so do not use awt with swing

List collection using the sublist method paging

/ / ================ Data paging ==============
/ / data collection query after the object is a collection of the same user data after the interception
List obj = new ArrayList ();
/ / total number of data
int totalCount = 155;
/ / Total number of pages
int pageCount = 0;
/ / display the total number of page
int endNum = 20;
/ / current page
int startNum = 1;
/ * calculate the total number of pages that can be divided into * / case
if (totalCount% endNum> 0) / / Total page displays the total number of data and can not be divisible
{
pageCount = totalCount / endNum + 1;
}
else case / / total number of data can be displayed per page and the total number divisible
{
pageCount = totalCount / endNum;
}
if (totalCount> 0)
{
if (startNum <= pageCount)
{
if (startNum == 1) / / current page is the first page
{ Total
if (totalCount <= endNum) / / data is less than the number of data per page
{
/ / As the number of total data ( currently a lack of data , according to a display ) , so as not to appear abnormal array bounds
obj = obj.subList (0, totalCount);
}
else
{
obj = obj.subList (0, endNum);
}
}
else
{
/ / intercept the starting subscript
int fromIndex = (startNum - 1) * endNum;
/ / intercept deadline subscript
int toIndex = startNum * endNum;
/ * calculate interception deadline subscript * /
if ((totalCount - toIndex)% endNum> = 0)
{
toIndex = startNum * endNum;
}
else
{
toIndex = (startNum - 1) * endNum + (totalCount% endNum);
}
if (totalCount> = toIndex)
{
obj = obj.subList (fromIndex, toIndex);
}
}
}
else
{
obj = null;
}
------ Solution ----------------------------------- ---------
general tab are only query the current page or previous content will not put all the contents are investigated to
------ Solution ------- -------------------------------------
Yes, everything is checked , when the data a large amount of time ......
That is a disaster
------ Solution --------------------------------- -----------
you this is fake page ! ! ~ ~ ~ ~ I know that sometimes is forced ~ I also have a

public class ArrayPage {

/**总的结果集*/
private Object[] result = new Object[]{};
/**实际显示的结果集*/
private Object[] displayResult = new Object[]{};
/**起始查询索引*/
private int start;
/**每页显示多少*/
private int pageSize = 10;
/**当前页号*/
private int pageNo;
/**总页数*/
private int pageTotalNo;
/**总条数*/
private int totalCount;
/**是否是第一页*/
private boolean isFirstPage;
/**是否是最后一页*/
private boolean isLastPage;
/**上一页起始索引*/
private int previousPageStart;
/**下一页起始索引*/
private int nextPageStart;
/**最后一页起始索引*/
private int lastPageStart;

public ArrayPage() {
}

public ArrayPage(Object[] result) {

this.result = result;
}

public ArrayPage(Object[] result, int start, int pageSize) {
this(result);
this.start = start;
this.pageSize = pageSize;
}

public Object[] getResult() {
return result;
}

public void setResult(Object[] result) {
this.result = result;
}

/**
 * 获取当前起始索引(默认从0开始)
 * @return
 */
public int getStart() {
return start;
}

/**
 * 设置起始索引值
 * @param start
 */
public void setStart(int start) {
this.start = start;
}

/**
 * 获取每页显示大小
 * @return
 */
public int getPageSize() {
return pageSize;
}

/**
 * 设置每页显示条数
 * @param pageSize
 */
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

/**
 * 获取当前页号
 * @return
 */
public int getPageNo() {
return (this.start / this.pageSize) + 1;
}

/**
 * 获取总页数
 * @return
 */
public int getPageTotalNo() {
return this.getTotalCount() % this.pageSize == 0 ? this.getTotalCount() / this.pageSize : this.getTotalCount() / this.pageSize + 1;
}

/**
 * 获取总条数
 * @return
 */
public int getTotalCount() {
return this.getResult().length;
}

/**
 * 判断是否是最后一页
 * @return
 */
public boolean getIsLastPage() {
int expectedSize = this.getPageNo() * this.pageSize;
this.isLastPage = expectedSize >= this.getTotalCount() && expectedSize - this.pageSize <= this.getTotalCount() ;
return this.isLastPage;
}

/**
 * 判断是否是第一页
 * @return
 */
public boolean getIsFirstPage() {

return this.getPageNo() == 1;
}

/**
 * 获取上一页起始索引
 * @return
 */
public int getPreviousPageStart() {
return this.start - this.pageSize;
}

/**
 * 获取下一页起始索引
 */
public int getNextPageStart() {
return this.start + this.pageSize;
}

/**
 * 获取最后一页起始索引
 */
public int getLastPageStart() {
this.lastPageStart = (this.getPageTotalNo() - 1) * this.pageSize;
return this.lastPageStart;
}

/**
 * 获取实际需要显示的结果集
 * @return
 */
@SuppressWarnings("unchecked")
public Object[] getDisplayResult() {
Object[] t = new Object[10];
if(getIsLastPage()) {
int expectedSize = this.getPageNo() * this.pageSize;
t = new Object[this.getPageSize() - (expectedSize - this.getTotalCount())];
} else {
t = new Object[this.pageSize];
}
System.arraycopy(this.getResult(), this.start, t, 0, t.length);
this.displayResult = t;
return displayResult;
}

public static void main(String[] args) {
Object[] strs = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"};
ArrayPage page = new ArrayPage(strs, 0, 12);
System.out.println(Arrays.asList(page.getDisplayResult()));
System.out.println("总条数:" + page.getTotalCount());
System.out.println("当前第:" + page.getPageNo() + "页");
System.out.println("总页数:" + page.getPageTotalNo());
System.out.println("是否为最后一页:" + page.getIsLastPage());
}

}

------ Solution ------------------------------------- -------
paging is only checked once a page of data , so whether it is displayed in the results , or are good on another query speed .
So the real action lies in each page just check one of the data, rather than check out all the data , then you selectively display to the user.
------ Solution ---------------------------------------- ----
can use SQL paging, paging using JAVA why should it ?
------ Solution ---------------------------------------- ----
upstairs say directly in the database paging, so to receive data directly inside java and then show it wants .

------ For reference only ---------------------------------- -----
engaged ...... now I have so ashamed of his ignorance
database paging, paging framework like hibernate or take to find a page frame

Use Ajax to access servlet appear a strange question

Today, the project found that when doing servlet using Ajax connection , only the first run when connected to the servlet code , like a long time have not figured out , please help to see if this is in the end is how is it ?
I put the key code to paste ,

<body>
   <a href="javascript:del()">删除</a>
  </body>
  <script type="text/javascript">
  function del(){
var url="DeleteServlet";
xmlHttp=createXmlHttpRequest();
xmlHttp.onreadystatechange=process;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
  }
function process(){
if(xmlHttp.readyState==4){
if (xmlHttp.status==200) {
alert("x");
}
}
}
后面 省略 ……

DeleteServlet in on the word , System.out.println (" the delete ! " ) ;
Whenever I click Delete , the first played in the console ' executive Delete' and pop 'x', the second and third time , the console did not print out content, but 'x' was able to pop up in the end is how is this all about?
------ Solution ---------------------------------------- ----
delete no parameters ? Followed by a timestamp look .
------ Solution ---------------------------------------- ----
Ajax tips , followed by a time stamp prevents the browser cache data
------ For reference only ---------------- -----------------------
which property will not be xmlHttp is not set
------ For reference only ---------------------------------------
  The reply was deleted administrator at 2014-01-06 08:51:15

------ For reference only ---------------------------------- -----

the delete into delete the servlet code execution every time , I found Ajax request must not be the same for each url servlet code will be executed if the same would only perform the first
- ----- For reference only ---------------------------------------
you mean they do not write synchronization function , write directly configured servlet that DeleteServlet?
------ For reference only -------------------------------------- -

thanks, should be the caching issues, together with a time stamp after each will execute the code inside a servlet
------ For reference only ------ ---------------------------------

the delete into delete the servlet code execution every time , I found Ajax request url must not be the same for each servlet code will be executed if the same would only perform for the first time  
behind url add a new Date ()

Find using Spring Tool Suite predecessors.

Spring is our company uses Tool Suite, previously used MyEclipse, just started using this , many did not make things right . Really not used , who uses this development tools to help under busy. .
encountered the first problem ,. m folder where? Qiufa map.
------ Solution ---------------------------------------- ----
may be dependent on the warehouse did not find your stuff, you try another version .
------ Solution ---------------------------------------- ----
with them as with the eclipse , some of which are spring template , create a project is also more convenient.

sts maven 's own integration . Good update your pom.xml file , so it is still prompted to download jar if the download is complete .
available on the project right - property -mven clean select it under the clean-up.
general project in the pom.xml file has configured the others , basically no you what happened.

------ Solution ------------------------------------ --------
I also use this , send a message to me , I'll teach you .
------ For reference only -------------------------------------- -
maven repository ?


------ For reference only ---------------------------------- -----
morning that problem solved
encountered a new problem. . Weighs . . Just learning this is troublesome.

------ For reference only ----- ----------------------------------
encountered a lot of things , ah, weighs .
a problem is Setting.xml file in question .
have encountered maven automatically lead pack error problem .
------ For reference only -------------------------------------- -
never used ,
------ For reference only ---------------------------- -----------
I also use this information and you have to learn to share their experience you seek

Beg axis2 Times published to external network connection reset has answered

 This post last edited by javaee_ssh on 2011-05-16 01:55:00
axis2 due to the need to publish the project to both the external network and internal network ( the network calls for the two servers , intranet , extranet for calls outside the network ) . Network access calls webservice interface. Outside the network seems to be affected by firewalls or what limits access to many, will be reported connection reset exception ( but said there was no network restrictions do ) , a few times through the RPC, Axios normal visit, sometimes old reported abnormal
Description :
server :
spring, hibernate ...
web server : glassfish, using , axis2 deployment service.xml file using client PRC, AXIOM are not connected ( the program is connected with the PRC ) . But I can . Net and in the browser via the above address access , and return the correct message.
http:// domain / dataService / services / DataexchangeService / checkLoginuserCode = admin & password = admin

clients:
java swing, spring ...

exception as follows :
java.lang.RuntimeException: [was class java.net.SocketException] Connection reset
at com.ctc.wstx.util.ExceptionUtil.throwRuntimeException (ExceptionUtil.java: 18)
at com.ctc.wstx.sr.StreamScanner.throwLazyError (StreamScanner.java: 731)
at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3657)
at com.ctc.wstx.sr.BasicStreamReader.getText (BasicStreamReader.java: 809)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 289)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 250)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next (StAXOMBuilder.java: 252)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling (OMElementImpl.java: 337)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.findNextElementWithQName (OMChildrenQNameIterator.java: 96)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.hasNext (OMChildrenQNameIterator.java: 76)
at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName (OMElementImpl.java: 274)
at org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getRole (SOAP11FaultImpl.java: 136)
at org.apache.axis2.AxisFault.initializeValues ​​(AxisFault.java: 202)
at org.apache.axis2.AxisFault . (AxisFault.java: 196)
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext (Utils.java: 446)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse (OutInAxisOperation.java: 371)
at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisOperation.java: 417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl (OutInAxisOperation.java: 229)
at org.apache.axis2.client.OperationClient.execute (OperationClient.java: 165)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 540)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 521)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking (RPCServiceClient.java: 102)
at RPCClient.checkLogin (RPCClient.java: 48)
at RPCClient.main (RPCClient.java: 60)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read (SocketInputStream.java: 168)
at java.io.BufferedInputStream.read1 (BufferedInputStream.java: 256)
at java.io.BufferedInputStream.read (BufferedInputStream.java: 317)
at org.apache.commons.httpclient.ChunkedInputStream.read (ChunkedInputStream.java: 182)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at org.apache.commons.httpclient.AutoCloseInputStream.read (AutoCloseInputStream.java: 108)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at org.apache.axiom.om.util.DetachableInputStream.read (DetachableInputStream.java: 147)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at java.io.PushbackInputStream.read (PushbackInputStream.java: 169)
at java.io.FilterInputStream.read (FilterInputStream.java: 90)
at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365)
at com.ctc.wstx.io.UTF8Reader.read (UTF8Reader.java: 110)
at com.ctc.wstx.io.MergedReader.read (MergedReader.java: 101)
at com.ctc.wstx.io.ReaderSource.readInto (ReaderSource.java: 84)
at com.ctc.wstx.io.BranchingReaderSource.readInto (BranchingReaderSource.java: 57)
at com.ctc.wstx.sr.StreamScanner.loadMore (StreamScanner.java: 992)
at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary (BasicStreamReader.java: 4628)
at com.ctc.wstx.sr.BasicStreamReader.readCoalescedText (BasicStreamReader.java: 4126)
at com.ctc.wstx.sr.BasicStreamReader.finishToken (BasicStreamReader.java: 3701)
at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3649)
... 23 more
PRC connection

private final String srcTargetNameSpaces = "http://impl.webservice.dataexchange.jst.com";
private final String srcSrvcUrl = "http://域名/dataService/services/DataexchangeService";
//RPC
public String checkLogin(String userCode, String password)
throws Exception {
QName qname = new QName(srcTargetNameSpaces, "checkLogin");
Object param[] = new Object[] { userCode, password };
Object[] response = null;
try {
RPCServiceClient client = new RPCServiceClient();
Options options = client.getOptions();
options.setTo(new EndpointReference(srcSrvcUrl));
Class[] returnTypes = new Class[] { String.class };
response = client.invokeBlocking(qname, param, returnTypes);
client.cleanupTransport();
} catch (AxisFault e) {
logger.error(e);
throw new Exception(e);
}
return (String) response[0];
}

AXIOM

 private static EndpointReference targetEPR = 
        new EndpointReference("http://域名/dataService/services/DataexchangeService");

    public static OMElement checkLogin(String symbol, String price) {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace("http://impl.webservice.dataexchange.jst.com", "tns");

        OMElement method = fac.createOMElement("checkLogin", omNs);

        OMElement value1 = fac.createOMElement("userCode", omNs);
        value1.addChild(fac.createOMText(value1, symbol));
        method.addChild(value1);

        OMElement value2 = fac.createOMElement("password", omNs);
        value2.addChild(fac.createOMText(value2,price));
        method.addChild(value2);
        return method;
    }

    public static void main(String[] args) {
        try {
//            OMElement getPricePayload = getPricePayload("WSO");
            OMElement updatePayload = checkLogin("admin", "admin");
            Options options = new Options();
            options.setTo(targetEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

            ServiceClient sender = new ServiceClient();
            sender.setOptions(options);
            OMElement result =  sender.sendReceive(updatePayload);
            System.err.println("price updated");
//            OMElement result = sender.sendReceive(getPricePayload);

            String response = result.getFirstElement().getText();
            System.err.println("Current price of WSO: " + response);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

service.xml

<serviceGroup>
<service name="DataexchangeService" scope="application" targetNamespace="http://acl.common.jst.com">
<description>
POJO: AddressBook Service
    </description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</messageReceivers>
<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
</parameter>
<parameter name="SpringBeanName">jst_dataExchangeService</parameter>
<!-- 
<operation name="getUser">
<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
 -->
</service>
</serviceGroup>



Saturday , Sunday engage in two days , including the configuration environment , resolve the error . . . . . Really egg pain.
two connections should be no problem . . . This problem was impatient . . . We help about

------ Solution ------------------------------------ --------
I came to see you loose points
------ Solution -------------------- ------------------------
at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365)
here to do what ?

side of the socket closed.
------ For reference only -------------------------------------- -
their first top one
------ For reference only ------------------------------ ---------
  The reply was deleted on 2011-05-16 11:11:18 moderator

------ For reference only ---------------------------------- -----
  The reply was deleted at the moderator 2011-05-17 16:37:22

------ For reference only ---------------------------------- -----
to one of
------ For reference only --------------------------- ------------
above problem is caused by inconsistent standard http protocol . The check items removed ok. Then I would knot posted .
------ For reference only -------------------------------------- -
access points to the
------ For reference only ------------------------------ ---------
landlord problem solved? I encountered a problem and ask you exactly ah ... next is how to solve ah ! ! ! Urgent ! ! ! Thank
------ For reference only --------------------------------- ------
encountered the same problem, tangle a day yet to be resolved -
------ For reference only --------------- ------------------------
what caused the problem ?