What a sorrowful day! I was fortunate to crack the Jive Forum 3.0.9, I decided to use this good Dongdong in my company's website, so I spent another terrible experience accompanied by me with frustration and discouragement, 5555555555555, dream in? ? ? Along with even, terrible java Chinese shows the problem!
We can't let him have always used the e-text menu and content when using Jive Forum. Fortunately, this stuff is too powerful, even in the toss of Jive Forum, it is too profiting by his perfect and clear design route. It is terrible, and I don't know how the foreigner is long. At his concession, he is thinking about how to Chinese.
Let's talk about the complete Chinese work of Jive Forums.
The first step: JIVE Forums' content: I see that Jive Forum has been fully considered in the design, which is for a variety of languages, we can feel the full use of XML in jive foreums, all All configurations are based on XML, and in structure, there is also a happy consideration, and the culture in his content is relatively simple.
After the Jive Forum is installed, there are two places in the system management interface that need to be modified. First, there is a Change Locale Settings option in the Locale Settings under Global Settings, we are in Locale: In the Time, in Time ZONE: Select GMT 8: 0 Asia Shanghai CST, in Character Set: User Specified: Enter GB2312 or GBK in it, even GB2312, this step is not very simple.
Second, in Global Features Select SEARCHSTTINGS, this option is the configuration you use when you search, select Indexer Type: Double-Byte (Asian Languages) under Search Indexing Set: To support Chinese search capabilities.
After the above two steps, there is another step to do, that is, modify your jive_config.xml in this XML
I use MySQL, but other databases are not added, see the installation instructions, this place is in the description. Ha ha. . . After these works are completed, you can perform other configurations of Jive Forum, such as adding categories, what to add, new content should be Chinese, no need to modify any Tomcat configuration.
Note: If you have modified the Chinese content before you have added, even if you modify it, you can't display normal, you need to delete it from the new addition! Because I used the e-text symbol ISO-8859-1 at that time, the added content was already turned into garbled in the database.
Ok, now there is a Chinese content, I am afraid enough. If you want to use a perfect Jive Forum, you should be all interfaces!
Don't worry about it, do you always think that you are doing this JSP page before doing this step? It's really simple, and it is even if it will lose a modified desire. I think this is the mission of the art. How can this spam programmer can do such a low level of work?
But even this error is too big. If you let the art to go to the Chinese JSP page may be able to use, but will give him a tiredness, and you may also give the jive forums to death, because this Jive Forum is too Terrier, I think now I am still shaking!
Let's talk about the thorough forums now!
The second step work:
Jive Forum's design determines his power, fully reflected in the JSP code, we will see
This is some of these. Properties:
global.post_reply = released a new reply global.previous_page = Previous global.remember_me = remember their global.replies_to_this_message = reply to this message global.search_forum = Search Forum global.the_forum_you_posted_in = The forum you posted inglobal.the_last_page_you_visited = The last page you visited.global.the_main_forums_page = The main forums pageglobal.the_message_you_created = The message you createdglobal.the_topic_you_created = The topic you createdglobal.the_topic_you_posted_in = The topic you posted in
It seems that this trick is more vicious, I am failed in my proud! After the modification of some.Properties, after the new packaging into JAR, the result of the run is very discouraged, because changed E text, becoming Chinese? ? ? When I start, I still feel that it is not a JSP page character set problem, but I am not right, I add a section, what kind of Dongdong Chinese can display, why is the modified .Properties in the PROPERTIES? I am worried, I think about it for a long time, I will sleep for a while, but in my dreams, I was the teeth dance? ? ? Wake up. I didn't give up, but I still can't solve it after N times. I have been suspected of the reason for the JPS page finally gave up. After many people find and think, I judge that there should be problems in these.Properties files, And in the Jiveforums package, there is a French file .properties file, their content is just like jive_i18n.properties, but it seems to have a different language. It seems that JIVE is not ready to use the Chinese! He didn't think about the Chinese interface at all, it seems that he solved it.
So even the loss of loss of pain, and the painful anti-compilation work was carried out under the psychology of the fight. Even in the suffering, once again, the failure makes it clutch the confidence, I put down the work in my hands, picked up the little prostitute "咿, 咿,", huh, huh. . . Even now unemployment is a temporary babysitter at home, and there is nothing to relax and relax.
She is seven months old, she doesn't know what she wants to say in my pregnancy, but I feel so strong, she reached out again and again, I will grab my website. The net card is scored. The obvious obstruction, but she didn't give up, or so moving, and there is a touch of touch, what is this? Don't you understand the truth? I don't understand if I have a big two-year adult? What is difficult? I don't advance these so-called difficulties have always been my difficulties, and is it difficult to have in the past?
I wake up, I shaken my spirit, from the new beginning of hard analysis, finally I found the problem, a Java's old child, that is, Jive forums must not consider Chinese characters when they are from .properties. But use the default ISO-8859-1, so will it appear? ? ? The result, even find some of the code in the JSP page, found that these values have used COM / JIVESoftware / util / localeutils.class class, and I used JAD to compile it to know that I am looking to the place, before Always hover in some of the Class under Base.
So I even started analyzing this class from the new beginning, I found the problem of the problem, haha. . . Can't stand it! It turned out that in this class, I didn't think about Chinese. I even added a conversion function in this class. When I returned a function value, I was converted to OK.
Below is an even added code after adding modified:
Package com.jivesoftware.UTIL;
import com.jivesoftware.base *;. import java.text *;. import java.util *;. import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import com.jivesoftware.base.JiveGlobals; // Reference Classes of Package Com.JiveSoftware.UTIL: // Cookieutils
Public class localeutils {
PRIVATE LOCALEUTILS () {}
public static Locale localeCodeToLocale (String localeCode) {Locale locale = null; if (localeCode = null!) {String language = null; String country = null; String variant = null; if (! localeCode = null) {StringTokenizer tokenizer = new StringTokenizer (Localecode, "_"); if (tokenizer.hasmoreToKens ()) {language = tokenizer.nextToken (); if (tokenizer.hasmoretoKens ()) {Country = tokenizer.nextToken (); ifkenizer.hasmoreToKens ()) Variant = tokenizer.nextToken ();}}} locale = new locale (language, country == null? ": country, variant == null?": variant);} Return Locale;
public static String [] [] getTimeZoneList () {if (timeZoneList == null) synchronized (timeZoneLock) {if (timeZoneList == null) {Date now = new Date (); String timeZoneIDs [] = TimeZone.getAvailableIDs (); locale jiveLocale = JiveGlobals.getLocale (); timeZoneList = new String [timeZoneIDs.length] [2]; for (int i = 0; i public static Locale getUserLocale (HttpServletRequest request, User user) {Locale locale = null; if (! user = null) {if ( "true" .equals (JiveGlobals.getJiveProperty ( "skin.default.usersChooseLocale"))) {Locale userLocale = localeCodeToLocale (user.getProperty ( "jiveLocale")); if (userLocale = null!) locale = userLocale;}} else if ( "true" .equals (JiveGlobals.getJiveProperty ( "skin.default.usersChooseLocale"))) { cookie cookie = CookieUtils.getCookie (request, "jiveLocale"); if (! cookie = null) {Locale userLocale = localeCodeToLocale (cookie.getValue ()); if (userLocale = null!) locale = userLocale;}} if (locale ! = null) Return Locale; Else Return jiveglobals.getlocale ();} public static Timezone getTimezone (HttpservletRequest Request, U ser user) {TimeZone timeZone = JiveGlobals.getTimeZone (); String timeZoneID = null; if (user = null) {timeZoneID = user.getProperty ( "jiveTimeZoneID");!} else {Cookie cookie = CookieUtils.getCookie (request, " JivetimezoneID "); if (cookie! = null) TimezoneId = cookie.getValue ();} if (timezoneid! = null) TimeZone = Timezone.getTimezone (TimezoneId);} private static String getTimeZoneName (String zoneID, Date now, Locale locale) {TimeZone zone = TimeZone.getTimeZone (zoneID); StringBuffer buf = new StringBuffer (); int offset = zone.getRawOffset (); if (zone.inDaylightTime (now) && zone.usedaylighttime ()) Offset = 0x36EE80; if (Offset <0) BUF.Append ("GMT-"); Else Buf.Append ("GMT "); Offset = Math.Abs (Offset); int hours = Offset / 0x36ee80; int minutes = (offset% 0x36ee80) / 60000; buf.append (hours) .append ("::"); if (Minutes <10) BUF.Append ("0"). append (minutes); Else BUF.Append (Minutes); buf.append ("-") .Append ('_', '') .Replace ('/', '')). Append (""); buf.append (zone.GetDisPlayName (True, 0, Locale) .replace ('_', '') .Replace ('/', '')); return buf.tostring ();} public static resourcebundle getResourceBundle (String BaseName, Locale Locale) {RETURN RE SourceBundle.getBundle (BaseName, Locale); // Even the Chinese conversion function added public static String toChinese (String strvalue) {try {if (strvalue == null) return null; else {strvalue = new String (strvalue.getBytes ( "ISO8859_1"), "GBK"); return strvalue;}} catch (Exception e) {return null;}} public static String getLocalizedString (String key) {return getLocalizedString (key, JiveGlobals.getLocale (), null);} public static String getLocalizedString (String key, Locale locale) {return getLocalizedString (key, locale, null);} public static String GetLocalizedString (String Key, List Arguments) {Return getLocalizedstring (key, jiveglobals.getlocale (), arguments);} public static String getLocalizedString (String key, Locale locale, List arguments) {if (key == null) throw new NullPointerException ( "Key can not be null"); if (locale == null) locale = JiveGlobals.getLocale (); String Value = ""; ResourceBundle bundle = resourcebundle.getbundle ("jive_i18n", local); try {value = bundle.getstring (key); } Catch (MissingResourceException MRE) {log.error ("missing resource for key:" key "in locale" locale.tostring ()); value = "";} if (arguments! = Null) {messageformat messageformat = New MessageFormat (""); MessageFormat.SetLocale (Bundle.getLocale ()); MessageFormat.ApplyPattern (value); try {java.text.format Formats [] = messageformat.getformats (); for (int i = 0; i Arguments.size ()> i) {Object Val = arguments.get (i); if (val instanceof string) {Numberformat NBRFMT = (NumberFormat) Format; try {val = nbrfmt.parse (String); arguments. Set (i, val);} catch (parseException e) {log.error (e);}}}} value = messageformat.format ((object)))))));} catch (IllegalGumentexception E ) {Log.Error ("Unable to format resource string for key:" key ", argument type not supported"); value = " "}} Return tochinese (value); // Even the place to modify} Public static string getLocalizedNumber (long Number) {Return Numberformat.getInstance (). format (number); Public Static String getLocalizedNumber (long Number, Locale Locale) {Return NumberFormat.GetInstance (local) .format (Number); Public static string getLocalizedNumber (double number) {return number (). format (number);} Public Static String getLocalizedNumber (double number, locale locale) {return number. form (number) .format (Number); Private static string timezonelist [] [] = null; private static object timezonelock = new object (); private static final string resourcebasename = "jive_i18n"; Haha. . . Agiminated a tochinese function, it is copied online, hehe. . . . Then the GetLocalizedString function returned to the value, it is Return tochinese (value); so that this occasion is used to compile the Class from the newly compiled, with JAR from the new package, cover the original JAR package, after running Tomcat, I have shown me. Cute Chinese. Summary: Doing anything is the most normal, only under heavy difficulties, my life is extremely cute and beautiful, and the two-sidedness of things is the basis of our analysis problem solving the problem, when we are moving the brain, After calm down, the problem solving is always cute to jump to us. It turns out that our problem is because our ignorance has appeared, the brothers and sisters look at this world with a peaceful mindset, then this bit is so much Beautiful and cute, hehe. . . It is still no longer IT.