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