Monday, October 18, 2010

Smooth surface reflection effect oval button making techniques


In Photoshop5.5 (or later) to create a new file, 120x80 size of the RGB mode, Contents set to Transparent (clear), layer1 filled white, add a layer to establish 40x40 round, center on the page, fill black



Figure 01

20x40 large rectangle with the selection tool to select half of the left circle, to the left 30 pixels, the same steps to move the right half of the circle to the right 30 pixels, which results in Figure 02



Figure 02

Two semi-circular in filling the gaps in the black, the size of the rectangle is 60x40, that the results shown in Figure 03



Figure 03

Foreground color set to # FF0033, background color is black, from top to bottom length for circular gradient effect, and then select the Select / Load Selection Select the oval, rectangular selection tool of Style now for Normal, 鎸夌潃 Alt key while long with a rectangular selection tool to select round, in the lower part of the majority, then the results shown in Figure 04



Figure 04

Add a layer, to select the part of the filling into the white, remove selected, will be moving down the long white 3 pixels, then use the rectangle select tool to select the white strip to the left, a few of its move to the right pixels, the same steps to indent the right side strip of a few pixels, which results in Figure 05



Figure 05

Select Select / Load Selection, select the white strip, choose Select / Modity / Smooth, dialogue panel, adding a layer of input 2 will be lower omitted (the eye point Layer panel icon), layer in the present work, Fill the selected part of the white, then the transparency of this layer is designed to Opacity: 40%, which results in Figure 06



Figure 06

Button write in the center of the appropriate size of the text, the text has left diagram of three-dimensional concave down, you can enlarge the picture, examine how it is made of, with no deep shadows of the last to complete



Figure 07






相关链接:



Burn pptx to dvd or cd in windows 7 for sharing on



WMV to MOV



Simple Four-strokes, cool music box my office you scouring millions of songs



SARFT issued the first batch of 3G licenses audio-visual



Community 2.0 My Community I call the shots



My Favorite Java And JavaScript



Zhou Kaixuan: No sex woman in Hong Kong



The battle with Ninetowns of Warcraft Account



Not Just Set Arbitrary Flash Player Screensaver



Storage Cartoons - Screen Savers



Recommend Audio Players



MPEG4 to WMV



OPTIONAL U disk watch "shell" scam



Flash To MPEG



BT has been closed, we see what?



Tuesday, October 12, 2010

Comparison of six agent approach


Traditional proxy, transparent proxy, plug-gw, Apache reverse proxy, IP masquerading, port forwarding comparison of six methods

The first part features a variety of proxy and packet rewriting the way the process

Squid proxy and transparent proxy tradition:

In Linux, the most widely used traditional proxy and transparent proxy is Squid. Default Squid configuration into the traditional agency approach. In this way, windows in the browser client to set the proxy server address and port number, the client actually very little work to be done. Only need to specify the proxy server IP address and port number can be, the other left to do all that to the proxy server. In this way a striking feature is the windows client browsing the Web, when entering a URL, DNS is also done by the proxy server. DNS resolution process is based on Linux server set up / etc / host.conf file parsing order of.
General of the order is to first find the / etc / hosts, then looking for DNS database bind. In this case, the interesting example is that if you set up a site for your internal network domain in a server, you first go to access the internal network server. If you set 192.168.11.3 www.yahoo.com then your browser can not access the internet to a yahoo site.
However, if you set the transparent proxy, then the resolution of the DNS and then the order will become windowshosts Linux, DNS database. No longer possible to check the Linux server / etc / hosts file.
Introduction of transparent proxy, see the article meets in another article "How to set the transparent proxy in Linux"

Traditional proxy and transparent proxy package rewriting process: see below

[PC] A [Linux squid server] B
__192.168.11.12_ |_____ 192.168.11.5__ | ___1.2.3.4_________Internet

A machine in the user's browser to set the proxy to 192.168.11.5, port number is 3128, through the B line.
If the access www.linuxforum.net, in fact if you set a proxy if the client browser only and Linux Squid server and the Internet to communicate and never talk on the www.linuxforum.net server, first of all by the squid proxy server
www.linuxforum.net parse (find / etc / host.conf in the resolution order, first / etc / hosts then DNS lookup)
For the IP address 202.106.124.185, the last by the proxy server instead of client IP address of the HTTP access, restore the information back to the squid cache in the first cache, and a copy to the client. Next time if the user or other users to access the same page, you can call from the squid cache to save time.
Transparent proxy process and the traditional agency similar to the difference between
1. DNS resolution process is different, as already mentioned
2. Transparent proxy gateway must be set to squid proxy server IP address, but the traditional agents do not need.
3. Transparent proxy need to set fire chain of input rules, and the rest of squid the same way as traditional agents.

plug-gw:
plug-gw is brought FWTK in general agent. Available to agents such as POP3, HTTP and other application layer services.

[PC] A [Linux POP3] C [Linux plug-gw] B
__192.168.11.12_ |______| 192.168.11.1____192.168.11.5__ | ___1.2.3.4__Internet

If there is a segment within the Linux POP3 server C (192.168.11.1), want external users to receive e-mail can be set in the machine B, the POP3 proxy plug-gw as follows:

Put the following line to / etc / rc.d / rc.local
/ Usr / local / etc / plug-gw-daemon 1.2.3.4:110-name plug-gw-pop3 & file / usr / local / etc / netperm-table has the following line
plug-gw-pop3: port 110 backup bin bin_old conf config crawler.tar.gz crawler_bin.tar.gz data eshow eshow_sitemap.html generate.sh google.html google.html.md5 log maint news: 10 news: 11 news: 12 news: 13 news: 14 news: 15 news: 16 news: 17 news: 18 news: 2 news: 3 news: 4 news: 5 news: 6 news: 7 news: 8 news: 9 outboundLinksMgr.sql seeds sitemap.html svn tasks tmp xml2dict-2008.6-tar.gz xml2dict-read-only-plug-to 192.168.11.1-port 110

The user to set the POP3 server outlook express address of 1.2.3.4. When the received message, the external interface of the B machine, the port 110 in 1.2.3.4 to accept user requests, subsequently plug-gw treatment, in-house segment, from 192.168.11.5 192.168.11.1 110 port on request. To the data collected by the 1.2.3.4 interface, copy to external users.

Apache reverse proxy.
Packet rewriting process and similar plug-gw

Note: The above stated three cases, the request process is in two separate in the middle usually squid proxy server or plug-gw, Apache server, data server, two network cards in the middle of the action to do copies, but the process of the two requests The source address is randomly assigned to high-end addresses are different. In 1024 and 65535. But in general, TCP / IP address assigned most of the random-end 1024 - 5000 allocation. For example: For the plug-gw is:
If an external dial-up user's IP address is 5.6.7.8. If the address and port as follows:
Source address and port number and destination address and port are:
5.6.7.8 1038 1.2.3.4 110
Request to be plug-gw rewritten as:
192.168.11.5 1045 192.168.11.1 110

Reply by 192.168.11.1 data is copied to the external customers.

But not all cases, the address of the source are randomly assigned to high-end 1024 - 5000. IP masquerading is the exception:

IP masquerading:

[PC] A [Linux MASQ server] B
__192.168.11.12_ |_____ 192.168.11.5__ | ___1.2.3.4_________Internet

Shown above, PC A through B camouflage Internet. To access www.linuxforum.net, when the package is disguised rewrite process is as follows:

Source address / port number and destination address / port number:
192.168.11.12 1047 202.106.124.185 80
Disguised the source after the address and port number and destination address / port number:
1.2.3.4 62334 202.106.124.185 80

Anti-back package for the
202.106.124.185 80 - 1.2.3.4 62334
Longer be re-written to PC A as:
202.106.124.185 80 - 192.168.11.12 1047

In general, IP source address is usually disguised> 60000, and in the 61000 - 64999 between.
The firewall maintains an IP masquerading comparison table. With the command / sbin / ipchains-M-L-n can be seen as:
[Root @ proxy etc] # / sbin / ipchains-M-L-n
IP masquerading entries
prot expire source destination ports
UDP 02:18.86 192.168.11.12 205.188.179.41 1215 (62615) -> 4000
TCP 17:03.20 192.168.11.12 205.188.248.57 1049 (62584) -> 80

Column from the ports you can control the source address of the match twice.

Port forwarding (port forwarding):
See the article meets in another article, "Using port forwarding to internal network to provide network services of external"

The second part of the way the various agents and the advantages and disadvantages of the application

The role of the various proxy methods:
1. IP masquerading, Squid proxy and transparent proxy for the traditional make no real IP address of LAN users to access Internet.
2. Apache reverse proxy, plug-gw general proxy, port forwarding for external users to access the LAN without real IP address of the server.

Advantages and disadvantages of various proxy methods:
1. Squid has the advantage of client requirements Henshao, as long as Liantong squid server. But the need for each machine are set to the proxy server IP address and port number
2. Squid transparent proxy does not need the advantages of each client are set proxy address and port and simplify client configuration. But the need for each client's default gateway are set to squid proxy server, and require the client to do DNS resolution
3. IP masquerading may be suitable for most application-layer services, unlike the squid only supports http and ftp. But customers also need to set the default gateway address of the firewall. And do not like squid with cache functionality
4. Plug-gw proxy the servers can be as HTTP, POP3, etc.. But the Apache reverse proxy can only reverse proxy http requests
5. Port forwarding for most services. Nothing to do with the specific application. And fast implementation in the kernel IP layer, application layer without requiring special services running. But may need to recompile the kernel.





Recommended links:



TS to MPG



Second-hand computers Xi'an China Merchants Plaza, more than 60 illegal businesses operating wit



Games Simulation Guide



About Distributed IDS



fastest Convert mov to iphone 3g/3gs



Guide LAUNCHERS And Task Managers



Auto auto parts order will be the first commercial capital of China held in SHIYAN



ICP license issue processing



MKV to FLV



Of "active Growth" Landing



Report Timers And Time Synch



"Rise" Magician / Swordsman Bred Guide



The right to use DAO or ADO to access Access 2000



Photoshop Production - wire and spark



How to motivate staff teams



RMVB to MP4



Monday, October 11, 2010

HR HR in the eyes of men and women


Today's society, businesses focus on human resource management is becoming more, HR has been promoted to corporate strategic partners, the industry's height. With the development of this industry, people have seen more and more women work in HR.

Speaking of sex, the industry appears to prefer women in HR, while the reality is that many foreign companies only use women as HR director, state-owned enterprises were mostly only use men to do the job. So, women compared with men, whether there is any kind of advantage? Most foreign companies choose to consider why women do HR, contrary state-owned enterprises?

To this end, we interviewed the HR director of the corporate sector, foreign CEOs and senior consultant with HR management of their personal experience, from the male point of view, frank about his views.

Male HR director: Sex is not a problem

Lenovo Group, the Department of Enterprise IT Management HR director of homogeneous

HR industry tend to do the job of women, in fact, most companies as well. Lenovo, the proportion of men and women to do HR work is 4 or 3 锔?锔?6 7 men more than girls. The four senior HR managers are all women, including Qiao Jian, general manager of the Human Resources Department.

Personally, I think, as long as have the corresponding ability, characteristics, whether women or men, are the same, not too many differences. For example, with sense of responsibility, dedication, diligence, compliance with corporate requirements, etc., which is soft things, hard things, including the ability to work, mainly by the accumulation of acquired and training. These should all be gender neutral.

As the company's needs, I think looking from another in the two departments. The original network operator in the server management to do HR, I was the boss is a man, do something more vigorous and resolute. The boss is a woman now, relatively speaking, strong toughness, rigid enough. She does not directly tell you what the problem is likely to be tactful, consider some of the things in more detail, let you more easily convinced.

Lenovo actually a feature of all young people, including my boss, same age, had worked together. Not much difference in ability, we usually emphasize communication, no guidance and imperative forms of management, more is authorized to form, the proposed form and the form of discussion and staff communication. I approached the female boss and male bosses, many of them do practice, differences are not significant, female supervisors and male supervisors more similar. Because the association is rather special, emphasizing business-oriented and goal-oriented, and not the person.

Three elements of a management association, as a cadre with a team is the first, not going it alone, but stressed to lead a team, individual performance is not necessarily good is a good leader. With a team is the most important, a lot of ways, such as how to stimulate the enthusiasm of employees, how to keep them sustained combat, how to unite the ranks, we pull together. I think that women are the same as men, there is not much difference. Differences between women and men just for their own characteristics, the work is different. Such as administration, finance more suitable for women, may be it will promote women to engage in this work. But this is not absolute.

Men and women is a little different, to a certain age women with families, children, their work will change the attitude, not their own efforts have not led to more women being promoted to high position. She will work in the family and find a balance between both. Evaluation of the community also tend to men, that they can create more value, should do more than women.

Male veterans: that is the advantage of women in decision

Foreign-funded enterprises in Shanghai boss Zhang Zhonghua

Why should only use a woman to do HR, the first women from the work of the characteristics and advantages of talking about.

Personnel work, in particular the basic personnel is quite complicated: the input employee information, compensation and benefit calculations, payment of provident fund, etc., which require great patience and careful, as compared with men, women also possess this characteristics and willingness to engage in this work. Of course, this is not enough to become a good HR, also need to have enough speech capacity, infectious, coordination and listening ability.

From the gender perspective of women, her delicate nature, caring nature, strong communication skills, make her listen to the voices of staff time, seem more approachable, easy to narrow the distance with staff, relief work there contradiction. Resulting in staff because of busy work, when tired of the mentality, to motivate them; or poor communication between upper and lower case, well done the middle of the bridge, the staff and expect to collect up to reflect the higher level. Women's sensitive to the timely and accurate information on the lower right to capture and transfer, the company strategy and tactics can be timely adjusted.

At present foreign, women's share of HR Manager is relatively high, the promotion mechanism which also has some relationship. In general, foreign companies and personnel Commissioner / Assistant relatively high proportion of women, most of the female HR Manger is up for promotion from the post. For the company, she already had enough expertise to handle the corresponding transaction, the company operates more understanding. Compared with men, their career stability of the stronger, it is important for the company.

Female HR Manger help the boss has its advantages. Employers often take vigorous and resolute manner, he launched a policy, more often tough. At this time, women prominent advantage of the Huairou. Good communication and coordination of their policies more conducive to the implementation, such as a lubricant, reducing friction and the employment relationship, so the New Deal on businesses and individuals not to cause great losses.

In large enterprises, evenly divided between men and women in the HR-end. Either as male or female, in the professional development process, the height of what can be achieved, depending on the height of his professional personality, from this level, the gender factor is not the most important measure of the.

Consultant: This great strategic planning and corporate relations

Watson Wyatt, general manager of Beijing-way up

Only use a business man or a woman as a human resources director with a variety of factors, in addition to the characteristics and gender characteristics of the work caused by differences, stage of development with the enterprise, its life cycle, the composition of the management team, corporate culture, have a great relationship.

Usually if the business is in creating period, development period, it needs more human resources managers need to have forward-looking and innovative. When companies are in a period of stability and maturity, managers pay more attention to internal management and communication. The women's nature so that people recognized that they could play better at this stage the role of human resource managers. We say "Human resources management is a strategic partner", we should see different companies at different times require different people. In the more mature businesses, often say "women are more suitable for human resources" can be established , but in the expansion of or just starting out in business is different, and even some companies did not HR Director this position, this function concurrently by the CEOs.

As we all know, HR director of foreign companies only use women to play more, especially in some large multinational corporations. This is because the headquarters of foreign companies Yue Fei factory sound human resources management system, they can get a full set of human resource systems to China, but is required implementation capacity and ability to convey a stronger person to these things better, finer, more human and more suitable for China's national conditions, access to higher employee satisfaction.

I personally do not think that is the success of a company's executives, whether male or female, need to balance work and family relations. The difference is, women on the family may pay more, at this point, professional women less than men choice. In fact, this is also the business of human resources should be a problem: how to create a flexible work environment to help their female employees do a good job balancing work and family relations, as far as possible to give them more time to take care of the family. This is a lot to the company's value orientation, the key is an emphasis on employee satisfaction is not whether the expectations of the staff of the corporate identity.

Objectively speaking, the capacity of the community for women still exist some prejudice, so women Benshen to work harder, they often pay more than men hard, before it and the men in the same position, and therefore the more cherish Gongzuojikuai These are very respectable people. HR do a female worker, or a successful career woman, I think, in addition to playing their own in affinity, communication skills, meticulous care for our staff's advantage in terms, but also Xuehui or higher from a strategic point of view the point of view look at the problem. Particularly in growth in some periods of the companies, play a supplementary company CEOs, to achieve corporate objectives of the role, becoming a strategic business partner, Zhe Yang cause increase even more.

In addition, both male and female, between work and home must maintain a balance. A successful HR manager, in addition to the use of human resources tools very skillful, the staff itself is an example, your behavior, attitudes, values will affect everyone. In this and values, the female HR should also note that the life and work is not a contradiction, which will be able to find a balance.






相关链接:



The face of OOXML, how can we do?



VOB To MPG



Essays on CMMI [1]



Printing Machinery "pioneers", "English Education" story



Jinan Stone 400 points for the hot phone PROMOTIONS



ASF Converter



Comparison of CMM And CMMI



Juric: Human Resource Practitioners In China Lags Behind India



Specialist Font Tools



VOB to Zune



mrpii and Enterprise management



Compare 0



The first Part of the Win32 debugging API



"NBA 2K10" My player - do not modify the top center of the achievements are not DELEGATED



Review FTP Servers



How do we Advertise for white-collar?



Tuesday, September 28, 2010

Balanced and non-equilibrium GIS GIS


Geospatial and GIS is the cross product of IT, GIS in the "G" and "IS" represent the two crossed the knowledge and skills. The development of GIS software technology, must consider two kinds of knowledge and technology balance and coordination.

The development of GIS software in history, there have been G and IS a serious lack of coordination, imbalance in the development process. GIS software of some serious "partial subjects", or too much emphasis on one of the Geospatial ability to ignore IT capabilities, or re-IT light Geospatial.

One is light weight Geospatial and IT, "Gis", uppercase "G", lowercase "is". "Gis" software can be called the expert GIS, a powerful, but difficult to use, difficult to master. This GIS is highbrow, only a few experts in the field of land will be used, and this is no less than professional GIS has long coat off because, seriously hampered the application of GIS to promote.

Earlier work in GIS with industry feel about this: the early use of high-end GIS software is very difficult to learn the price very high. Ten years ago, even in the birthplace of the Chinese Academy of Sciences of China Institute of GIS, the proficient use of GIS software of a foreign people, but also one of the few. At that time, master the operation of a GIS software, who may become well-known academic experts in the industry.

Even today, some GIS Geospatial software also over the design capacity, and the relative lack of capacity in IT and software costs continue to maintain a high level of learning. Moreover, the IT architecture often make mistakes, not only mislead consumers, GIS software development unit is also constantly changing as the deviation of the software architecture R & D to pay the extra costs.

The other is the heavy and light Geospatial IT's "gIS", lowercase "g", uppercase "IS". To be distinguished, "gIS" software is often easy to operate, even without a professional to learn skills, also easy to learn and use. However, insufficient capacity to learn, can not meet the large-scale application projects, and the demand for high-end applications is the low-end entry-level GIS software.

GIS applications in China for a long period of time, "gIS" software for easy to learn and very popular, not only of many schools teaching the early GIS software, and large-scale application in many industries, in order to make the popularization of GIS an outstanding contribution. But with the increase in the level of industrial applications, many entry-level flat on the "gIS" software applications can not meet the higher demand.

Uneven development of GIS software capabilities, leading to polarization of GIS software, once seriously, many application software selection unit in the GIS when faced with such embarrassment: "gIS" software easy to learn, but insufficiency, "Gis" powerful, But the learning costs and maintenance costs are too high, hard to find a bed of roses in the GIS software.

Encountered "non-equilibrium GIS" embarrassment, we call balanced "GIS", uppercase "G" and uppercase "IS". Barrel Theory tells us that a bucket can hold much water, depending on the height of the shortest piece of board. GIS software to identify and compensate for the short board, coordinated and balanced development of the Geospatial GIS capabilities and IT capabilities in order to more effectively promote rapid and healthy development of GIS technology.

Balanced and non-equilibrium GIS GIS








Recommended links:



seek and find 2



Own way to the poor poorer between-MP3 and TAPE transcription DIY



Games Arcade evaluation



PRD employment "upward", "Labor Shortage" moved to the Mainland



BOE Holdings East TPV regulators have not yet ratified Difficult



DivX to MPEG



The most Beloved of five welfare workers



Text Or Document Editors Catalogs



Proper way to make money: to be a know how to "lose money," the dealer



Audio adjustment so Simple



SYSCTL command



Dell notebook CASE for the core trial Xiamen



Shop Development



MP4 to 3G2



FLV to VOB



Monday, September 13, 2010

Jia Peng Lei: "diversity" denatured


"I have a dream" - Many Chinese companies have said that fun is a lot of people say objective is "China's GE". Either Founder or Haier, Lenovo, whether or BOE, but there are numerous, fewer successes than failures.

The failure of diversification, I think there is no fixed answer. Culture is not fixed, the water has no fixed form. Specific to each business practice not to mention the process of diversification of the problem, even a large environment, I am afraid that their feelings are not the same. This is the hottest with the current international trend similar to, anyone can call international, but really made a few more?

Negative association can be called a typical diversified. However, if we try to find a typical reason, I am afraid will make us think. Shouted slogans from the diversification to the official declaration of the 2001 failure of the 2004 variety, in fact, Lenovo's performance did not decline significantly because of diversification, at best marking time. Why, then, it will become a classic? Because the prominent position, or the limelight too fresh? During that period, Lenovo's acquisition of dazzling movement, want to become another "IBM" the ambition to write in the forehead.

The way in finding the process of growing up, not just think diversity is found in section diameter. Should be on diversification, Founder Group, is the most famous. In its heyday, but even the Founder Group, when the family can not remember the number of its companies.

China's GE, is the Founder Group chairman Wei Xin is currently still say a word until today. Wei Xin said that all the eggs are placed in IT industry, the risk is too high. He wanted to do a larger chassis, and then a layer of a layer of the pyramid base. Now, the pyramid of the tower bottom already have IT, medical, pharmaceutical, beverage, steel, securities, finance, rare earth, playgrounds and other kinds of bricks.

In fact, if we look at the major shareholder of Lenovo - Lenovo Holdings today's development trend, perhaps they will understand, times are different, understanding of diversity has changed.

Legend Holdings is now one of the most powerful, although Liu's exposure has been a little boom. In its subsidiary, IT, distribution, real estate, logistics, food, auto parts, air cast so good momentum emerged. Moreover, all the basic operations in various fields have become the blue chip stocks, Liu's vision and courage is commendable.

Lenovo Group, the diversity of the year, it is not really diversified? We take a look, it has done, whether software, hardware, services, finance, consulting, etc., while looking confused, in fact, are in the IT circles round and round. This is not not a good way, because among the countless different businesses can complement each other well. Unfortunately, selling Lenovo PC descent beyond the control of these relationships. Only one control to - a face difficulties, we are faced with difficulties, become "trouble the same as" good brothers.

Some people asked, Liu able to control the current diversity of Legend Holdings, are beyond the control of wound up on the Lenovo? Does not seem entirely human reason, or on the "diversity" to understand wrong. However, we can not say that the road on the way, how to get to the next step is hard to say. However, we only know that the stand point of Legend Holdings, is the internationalization and diversification have made a "stage victory", is indeed gratifying.






Recommended links:



video mpg



Infomation File And Disk Management



Reviews Dial Up And Connection Tools



Spring Independent WAP wait POLICY



Giant Imperial Shi Yuzhu set foot on "the journey"



Recommend Registry Tools



Compare Office Suites And Tools



Flv To Mp4 Converter



GRAPHIC Norton Ghost



Detailed analysis: with your easy to understand the concept of InnoDB



Flv to wmv



video format for ps3



2005 Nanjing International Exhibition printing equipment and supplies



ICBC Amendment



Kaspersky: alert, "Fantasy Westward Journey" Daohao Trojan havoc



Tuesday, July 20, 2010

Using the seven combat the Heart Jakarta Struts


Editor's note: When the author Chuck Cavaness (with a "Programming Jakarta Struts" book) where the network after the company decided to use Struts framework, Chuck has spent several months studying how to use it to build the company's applications. This article is described the use of Struts in the course of a number of hard-earned experience and insights. If you are responsible for development through the jsp and servlet Web applications, Java programmers, and is also considering building Struts-based method, then here you will find many valuable insights as well as information.

1. Only when it is necessary to consider expanding Struts Framework

A good framework has many advantages, first of all, it must be able to meet the foreseeable needs of the users. This Struts application for the Web provides a common framework, so developers can focus on how to solve real business issues. Secondly, a good framework must also be able to provide expanded where appropriate interface for the application to extend the framework to better adapt to the user's actual needs.

If the Struts framework on any occasion, any project can well meet the demand, that is great. But in fact, not a framework that claim to do this. There must be some demand for a particular application framework developers can not be foreseen. Therefore, the best way is to provide sufficient expansion interface allows developers to adjust the struts to better meet their specific requirements.

In the Struts framework, there is a lot for expansion and customization. Almost all of the configuration class can be replaced with a customized version, this simple change it as long as the Struts configuration file can be done.

Other components such as the ActionServlet and RequestProcessor can also use a custom version of the place. Even in Struts 1.1 new features have also extended the principle in accordance with the design. For example, in the exception handling mechanism allows users to customize the exception handling on the handle to the application system to better respond to the error occurred.

Adjustable features such as a framework it is more suitable for your application to a large extent the same time also affected the project development results. First, as your application is based on an existing mature and stable framework such as Struts, discovered during testing will greatly reduce the number of errors, but also can shorten the development time and reduce resource inputs. Because you no longer need to invest in developing the basis of the power used to write framework code.

However, to achieve more functionality is to spend a greater price. We must be careful to avoid unnecessary abuse of scalability, Struts is the core package with a lot of kit form, and they have provided a lot of functionality has been achieved. So do not blindly expanding Struts framework, should determine if other means can use the existing functionality to achieve. Written decision must be confirmed before expanding Struts code does not achieve the function you want. Otherwise, chaos will lead to duplication of functions have to spend extra effort will remove it.

2. Use exception handling statement

To define the logic of the application process, mature experience is recommended in the code, the use of allocation methods to achieve, not coded in the program code. In J2EE, the examples abound. EJB from achieving the security and transaction behavior to describe the JMS message and the destination of the relationship between the number of run-time processes are defined in procedures outside.

Struts Creator from the beginning this approach, by configuring Struts configuration file to customize the application run-time aspects. This is a new feature in version 1.1 on continuity, including the new exception handling features. In the Struts framework previous versions, developers had to deal with their own Struts application error occurred in the situation. In the latest version, the situation had changed greatly, Struts Framework offers a built-called ExceptionHandler class, class action for system default handling errors generated by the operation. This is a technique in the framework we mention one of many scalable interfaces.

Struts default will generate a ActinError ExceptionHandler class object and stored in the appropriate range (scope) object. This allows JSP pages using the wrong class to remind the user any problems. If you think this does not meet your needs, you can easily implement your own ExcepionHandler class.

Specific custom exception handling methods and mechanisms

To customize your own exception handling mechanism, the first step is to inherit org.apache.struts.action.ExceptionHandler class. This class has two ways to cover, one excute () the other is storeException (). In most cases, only covers one of the excute () method. The following is ExceptionHandler class excute () method declaration:



public ActionForward execute (Exception ex,
ExceptionConfig exConfig,
ActionMapping mapping,
ActionForm formInstance,
HttpServletRequest request,
HttpServletResponse response
) Throws ServletException;

As you can see, this method has several parameters, including the original exception. Method returns an ActionForward object for exception handling end of the controller class will be taken to a place where the request must be forwarded.

Of course, you can achieve any treatment, but in general, we must examine the thrown exception, and for the type of exception for a particular treatment. By default, the system of exception handling function is to create an error message, and forwards the request to the configuration file specified place. Custom exception handling is a common example of nested exception handling. Assuming that the exception contains a nested exception, these nested exception but also contains other exceptions, so we have to override the original execute () method, write error messages for each exception.

Once you have created your own ExceptionHandler class, it should be in the Struts configuration file, part of the statement of the class to let Struts know to use your custom exception handling to replace the default exception handling.

You can configure your own class for Action Mapping ExceptionHandler specific part or all of the Action object. If it is used for a specific part of the Action Mapping in the element configuration. If you want this class for all the Action objects can be specified in the element. For example, suppose we create an exception handling class CustomizedExceptionHandler for all of the Action class, the element defined as follows:


handler = "com.cavaness.storefront.CustomizedExceptionHandler"
key = "global.error.message"
path = "/ error.jsp"
scope = "request"
type = "java.lang.Exception" />

The element can be set for many properties. In this article, the most important attribute than handler property, handler attribute is inherited from the definition of a subclass of ExceptionHandler full name. If the attribute is not defined, Struts will use their default values. Of course, other attributes are also important, but if you want to override the default exception handling, then, handler is undoubtedly the most important attribute.

Finally, it should point out is that you can have different exception handling class to handle different exceptions. In the above example, CustomizedExceptionHandler to deal with any subclass of java.lang.Exception. In fact, you can define multiple exception handling classes, each specializing in different exception tree. The following XML fragment to explain how to configure to achieve this.


handler = "com.cavaness.storefront.CustomizedExceptionHandler"
key = "global.error.message"
path = "/ error.jsp"
scope = "request"
type = "java.lang.Exception" />

handler = "com.cavaness.storefront.SecurityExceptionHandler"
key = "security.error.message"
path = "/ login.jsp"
scope = "request"
type = "com.cavaness.storefront.SecurityException" />

Here, if an exception is thrown, struts framework will attempt to find in the configuration file ExceptionHandler, if not found, then the struts will be along the exception of the parent chain until they found a layer up to find matches so far. Therefore, we can define a hierarchical relationship structure exception handling, in the configuration file has reflected this.

3. Use of application modules (Application Modules)

Struts 1.1, a new feature is the application module concept. Struts application module allows a single application is divided into several modules, each module has its own Struts configuration file, JSP page, Action and so on. This new feature is the large and medium sized development team to solve the most complained about a problem that in order to better support parallel development allows multiple configuration files, rather than a single configuration file.

Note: In the early beta versions, this feature is known as sub-applications (sub-applications), recently renamed the purpose is to reflect their more logical division of labor.

Obviously, when many developers together to participate in a project, a single Struts configuration file is easy to cause resource conflicts. Struts application module allows classification according to functional requirements, in many cases has proved so closer to reality. For example, suppose we want to develop a typical store applications. Component can be divided into modules such as catalog (Catalog), customer (customer), customer service (customer service), order (order), etc.. Each module can be distributed to a different directory, so each part is easy to locate resources to help develop and deploy. Figure 1 shows the application's directory structure.

Figure 1. A typical application's directory structure stores



Note: If you do not need to project into multiple modules, Struts framework supports a default application module. This makes the application can also be created under the 1.0 version, portable, because the application automatically as the default application module.

In order to use multi-application module functionality, you must perform the following preparation steps:

鈥?for each application module to create a separate Struts configuration file.

鈥?Web deployment descriptor Web.xml configuration file.

鈥?Use org.apache.struts.actions.SwitchAction to achieve the jump between the program modules.

Create separate Struts configuration file

Each Struts application module must have its own profile. Allowed to create their own independent of other modules, Action, ActionForm, exception handling and more.

Continue to store the application above example, we can create the following configuration files: a file named struts-config-catalog.xml, including catalog (Catalog), items (products list), and other related functions and inventory configuration information; another file called struts-config-order.xml, includes order (order) and order tracking (order tracking) setting. The third configuration file is struts-config.xml, which contains the default application module is a general feature.

Configuring Web deployment descriptor

In earlier versions of Struts, we Web.xml Struts configuration file to specify the path. Fortunately, this did not change, contribute to backward compatibility. But for many application modules, we need to increase the Web deployment descriptor in the new profile settings.

For the default application (including an earlier version of Struts), Struts framework document in Web.xml find the element with the config for load Action mapping applications and other settings. As an example, the following XML fragment shows a typical element:


config> / param-name>
/ WEB-INF/struts-config.xml

Note: If you can not find the elements in the existing "config" keyword, Struts framework will default to using the / WEB / struts-config.xml

In order to support multiple application modules (Struts 1.1 for new features), additional elements must be increased. And the default element is different, additional elements corresponding to each application module, you must config / xxx in the form of naming, in which the string xxx represents the name of the module only. For example, in store application example, the element can be defined as follows (note the bold part):



config
/ WEB-INF/struts-config.xml


config / catalog
/ WEB-INF/struts-config.xml


config / order
/ WEB-INF/struts-config.xml


The first element corresponds to the default application module. The second and third elements represent the non-default application module catalog and order.

When the Struts application is loaded, it first loads the default application module's configuration file. And then look with a string config / xxx form of additional initialization parameters. For each additional parsing configuration files and loaded into memory also. This step is complete, users can use it freely config / string back is to call the name of the corresponding application module.

Between multiple application module class called Action

For each application module to create a separate configuration file, we will likely need to call different modules Action. To do this you must use the Struts framework provides the SwitchAction class. Struts will automatically add the name of the module will be applied to the URL, just like Struts application is automatically added as the name added to the URL. Application module is a framework for a new expansion, contributed to a parallel team development. If your team is small then I need to use this feature, do not be modular. Of course, even if only one module, the system is still the same operation.

4. The WEB-INF JSP into JSP source code after the protection

To better protect your JSP to prevent unauthorized access and peep, a good way to store the page file in the Web application WEB-INF directory.

JSP developer will generally their page file stored in the Web application corresponding subdirectory. A typical store application directory structure shown in Figure 2. With the catalog (Catalog) related to JSP is saved in the catalog subdirectory. Customer associated with the JSP, JSP associated with orders and so on stored in accordance with this method.

Figure 2. JSP based on different functions are placed in different directory



Problem with this approach is the page file is easy to see the source code was stolen, or direct calls. Some situations this may not be a big problem, but in certain cases it may constitute a security risk. Users can direct calls to bypass the JSP Struts the controller is also a problem.

To reduce the risk, you can move the page file to the WEB-INF directory. Servlet-based statement, WEB-INF is not a public document as a Web application as part of the tree. Thus, WEB-INF directory of resources is not a direct service to customers. We can still use the WEB-INF directory of the JSP page to provide views to the customer, the customer can not directly request access to JSP.

Using the previous example, Figure 3 shows the JSP page will be moved to WEB-INF directory of the directory structure after

Figure 3. JSP stored in the WEB-INF directory of more secure



If the JSP page file moved to the WEB-INF directory, when the page is called to be the "WEB-INF" to the URL. For example, in a Struts configuration file for a logoff action to write a Action mapping. JSP path which must be "WEB-INF" at the beginning. As follows:

path = "/ logoff"
type = "org.apache.struts.webapp.example.LogoffAction">


This method Struts under any circumstances be regarded as a good way to practice. Is the only technique to note is that you must be a JSP and Struts action link. Even if the Action is only a very basic simple JSP, always to call a Action, then it calls the JSP.

Finally, a note that not all containers will support this feature. Early versions of WebLogic can not explain Servlet declarations and therefore can not provide support, it was reported in the new version has been improved. In summary, before you check your Servlet container.

5. Prebuilt Action class to use to enhance development efficiency

Struts framework with several prebuilt Action class, using them can greatly save development time. One of the most useful is org.apache.struts.actions.ForwardAction and org.apache.struts.actions.DispatchAction.

Use ForwardAction

In the application, may be often as long as the Action forwards to a JSP object situation. Mentioned in the previous point in Action called by the JSP is always a good habit. Action, if we do not have to perform any business logic, but would like to follow the words from the Action to access the page, you can use ForwardAction, it allows you to remove the Action class to create a number of empty. The advantage of using ForwardAction not create your own Action class, you need to do is in the Struts configuration file to configure a Action mapping.

For example, suppose you have a JSP file index.jsp, and can not directly invoke the page, to let the program through an Action class is called, then you can create the following Action mapping to achieve this:



As you see, when / home is called, will call ForwardAction and to forward the request to the index.jsp page.

Further discuss the adoption of an Action class is not directly forwarded to a page of the case, we must note that we still use elements of the forward attribute to achieve the objectives forward. Then elements are defined as follows:


path = "/ home"
forward = "/ index.jsp">


Of the above methods can save you time and help reduce the number of documents required for an application.

Use DispatchAction

DispatchAction is contained in another Struts can save a lot of development time of Action class. And the other provides only a single Action class execute () method to achieve a single business different, DispatchAction allows you to write more than a single Action class and business-related way. This reduces the number of Action classes, and the related business method together makes maintenance easier.

To use the function DispatchAction need to create a class of their own, through inheritance DispatchAction be abstract. To be provided for each business method must have a specific method signature. For example, we want to provide a method to realize the shopping cart to add the list of goods to create a class ShoppingCartDispatchAction provide the following methods:

public ActionForward addItem (ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception;
So, this class may also need a deleteItem () method from the customer's shopping cart to delete the list of goods, there clearCart () method to clear shopping cart, etc.. Then we can set these methods in a single Action class, no method is provided for each one Action class.

In a method called ShoppingCartDispatchAction inside, just in the URL provided in the method name as a parameter value. That is, call addItem () method of the URL might look like:

http://myhost/storefront/action/cart?method=addItem

Parameter specifies which method to call methods in ShoppingCartDispatchAction. The name parameter can be any configuration, where the use of "method" is just one example. The name parameter can be set on their own Struts configuration file.

6. Using dynamic ActionForm

In the Struts framework in, ActionForm object is used to packing HTML form data (including request), and returns back to dynamic display to the user's data. They must be fully JavaBean, and inheritance. Struts ActionForm class inside the same time, the user can selectively override the default method of the two.

This feature can save a lot of time, because it can help to automatically verify the performance of layers. ActionForm only drawback is that the HTML form must be generated for different number of ActionForm class to save the data. For example, if there is a page that contains the user's registration information, another page will contain the user agent's information, you need two different ActionForm class. This is in large application systems can lead to excessive ActionForm class. Struts 1.1 have made a good improvement, the introduction of the concept of dynamic ActionForm class

DynaActionForm through the Struts framework in the class and its subclasses can implement dynamic ActionForm, dynamic ActionForm allows you to complete the ActionForm Struts configuration file all the configuration; applications no longer need to create specific ActionForm class. Specific configuration is: in the Struts configuration file by adding an element, the type attribute set to DynaActionForm or a sub-class of its full name. The following example creates a dynamic ActionForm named logonForm, it contains two instance variables: username and password.

name = "logonForm"
type = "org.apache.struts.action.DynaActionForm">



Dynamic ActionForm can be used for Action classes and JSP, use the same ActionForm with the ordinary, and only a small difference. If you use ordinary ActionForm objects you need to get and set methods to provide access and set data. In the example above, we need to provide getUsername () and setUsername () method to obtain and set the username variable, and likewise a pair of methods used to obtain and set the password variable.

Here we use the DynaActionForm, it will be the variable stored in a Map class object, so you must use DynaActionForm class get (name) and set (name) method, the parameter name is the name to access the instance variables. For example, in the username to access DynaActionForm value, you can use a similar code:

String username = (String) form.get ("username");


As the value stored in a Map object, so remember the get () method returns the Object Type object to do the mandatory conversion.

DynaActionForm several useful subclasses. One of the most important thing is DynaValidatorForm, this dynamic with the use ActionForm and Validator Validator public to provide automatic verification package. This feature allows you to specify the validation rules outside the code. Combination of the two properties to developers who will be very attractive.

7. Using visual tools

Since Struts 1.0 distribution has appeared in a number of visualization tools to help create, modify and maintain the Struts configuration file. Configuration file itself is XML-based format, in medium and large development applications will be increased to become very awkward. In order to facilitate the management of these files, once the large file you can not clear the time recommendations try to use one tool to assist in the development of a GUI. Commercial and open source tools have many, Table 1 lists the available tools and their related links, from where you can get more information.

Table 1. Struts GUI Tools

The nature of the application site
Adalon Business Software http://www.synthis.com/products/adalon
Easy Struts open source http://easystruts.sourceforge.net/
Struts Console free http://www.jamesholmes.com/struts/console
JForms Business Software http://www.solanasoft.com/
Camino Business Software http://www.scioworks.com/scioworks_camino.html
Struts Builder Open Source http://sourceforge.net/projects/rivernorth/
StrutsGUI free http://www.alien-factory.co.uk/struts/struts-index.html


Related Resources

To obtain a more comprehensive list of Struts GUI tools (including free and commercial), please visit the Struts resource page.






相关链接:



Converting mov to wmv



Merry MP3 Sound to RA Editing



ps3 FORMAT



Comment Dictionaries Education



AVI To IPhone Converter For MAC



Digital CDA Midi MP2 to M4P Creator



convert avi to wmv free download



Hope DVD FLV to PS3



Convert Aac To Mp3



Youtube TO FLV Now



WorldCup Flash To Mobile



Kingsoft WPS fans will debut Citation Shanghai Book Fair



Good Games BOARD



Friday, July 9, 2010

MP3 EZlib Music Library/Playlist Manager

EZlib is a Free MP3 Music Library and Playlist Manager

Features:
(1) Custom-Query on 14 ID3v2 tag fields and file dates
(2) Single and mass ID3v2 tag update
(3) Four user-defined, custom ID3v2 tag fields
(4) Four user-defined music rating fields plus tempo
(5) Pictures (add/delete/display)
(6) Automatic lyrics search
(7) Playlist creation and maintenance
(8) Playlist tweaking at runtime
(9) Songwriter's aid
(10) Rename music files to match ID3v2 tag fields
(11) Rename music files with a numeric prefix for CD writing in playlist order
(12) Print functions
(13) Built-in, high quality MP3 player
(14) Small and fast



Recommand Link:



Avi Converter



Wondershare DVD to iPhone Suite for Mac



Languages Education REPORT



Basic Or VB Or VB DotNet Comments



RA PSP to MP3



convert mp3 to aac



Youtube to Flash Pro



Youtube FLV To PS3 Top Rated



Digital CD Audio WAVE To Music Copying



convert .flac To mp3



for you Flash Tools



Youtube Movie TO AVI Freeware



Happiness AAC VQF to ID3 Manager



Lenogo DVD To Zune Converter Four



avi to m4v