溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!

          雪山飛鵠

          溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            215 Posts :: 1 Stories :: 674 Comments :: 0 Trackbacks

          #

          Tomcat的版本多的是亂入牛毛,本人一向喜歡用jstl/el表達式的,可是遇到多個版本的tomcat就會出現不解析EL表達式,原樣輸出的問題.

          解決思路:

             修改web.xml中聲明部分的schema版本為2.4

             jsp頁面中的<page>指令中添加isELIgnored="false"

          posted @ 2010-05-26 16:42 雪山飛鵠 閱讀(772) | 評論 (2)編輯 收藏

          Java code

          package com.velocity.test;
          import java.io.IOException;
          import java.io.StringWriter;

          import org.apache.velocity.Template;
          import org.apache.velocity.VelocityContext;
          import org.apache.velocity.app.Velocity;
          import org.apache.velocity.app.VelocityEngine;
          import org.apache.velocity.exception.MethodInvocationException;
          import org.apache.velocity.exception.ParseErrorException;
          import org.apache.velocity.exception.ResourceNotFoundException;


          public class VelocityTest {

           public static void main(String[] args) {
            
            
            try {
             Velocity.init();
            } catch (Exception e) {
             e.printStackTrace();
            }
            
            VelocityEngine engine=new VelocityEngine();
            engine.setProperty(Velocity.RESOURCE_LOADER, "class");
            engine.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
            
            VelocityContext context= new VelocityContext();
            context.put("name", "林心如");
            context.put("velocity", "Velocity");
            
            Template template = null;
            try {
             template = engine.getTemplate("velocity.vm","gbk");
            } catch (ResourceNotFoundException e) {
             e.printStackTrace();
            } catch (ParseErrorException e) {
             e.printStackTrace();
            } catch (Exception e) {
             e.printStackTrace();
            }
            
            StringWriter writer=new StringWriter();
            
            try {
             template.merge(context, writer);
             System.out.println(writer.toString());
            } catch (ResourceNotFoundException e) {
             e.printStackTrace();
            } catch (ParseErrorException e) {
             e.printStackTrace();
            } catch (MethodInvocationException e) {
             e.printStackTrace();
            } catch (IOException e) {
             e.printStackTrace();
            }
           }

          }


          Velocity 模版
          Hello $name ,
           this is my first $velocity !!!
          #set($sex="女")
          *******************************************
          $sex
          #**
           #set($a=true)
           
           #if($a)
            true
           #else
            false
           #end
           
           #set()
          *#

          Jar包支持
          avalon-logkit-2.1.jar
          commons-collections-3.2.1.jar
          commons-lang-2.4.jar
          oro-2.0.8.jar
          velocity-1.6.3.jar
          posted @ 2010-02-23 10:36 雪山飛鵠 閱讀(2411) | 評論 (1)編輯 收藏

          如何讓你遇見我
          在我最美麗的時刻 為這
          我已在佛前 求了五百年
          求他讓我們結一段塵緣
          佛于是把我化作一棵樹
          長 在你必經的路旁
          陽光下慎重地開滿了花
          朵朵都是我前世的盼望
          當你走近 請你細聽
          那顫抖的葉是我等待的熱情
          而 當你終于無視地走過
          在你身后落了一地的
          朋友啊 那不是花瓣
          是我凋零的心
          posted @ 2010-02-08 09:59 雪山飛鵠 閱讀(1752) | 評論 (1)編輯 收藏

          最近在調試xwiki的時候遇到java.lang.IllegalStateException異常,在google上baidu了一把
          經過分析查看jdk文檔終于找到了解決方案,在response.sendRedirect("")方法后加return語句即可:
          原因是在程序中兩次調用response.sendRedirect("")方法

          j2ee5.0中的介紹:

          sendRedirect

          void sendRedirect(java.lang.String location)
          throws java.io.IOException
          Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the servlet container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the servlet container root.

          If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

           

          Parameters:
          location - the redirect location URL
          Throws:
          java.io.IOException - If an input or output exception occurs
          java.lang.IllegalStateException - If the response was committed or if a partial URL is given and cannot be converted into a valid URL
          posted @ 2010-01-26 10:18 雪山飛鵠 閱讀(148012) | 評論 (12)編輯 收藏

              剛入手聯想Y450(TSI),給機子裝了win7中文旗艦版,在該環境下安裝myeclipse6.5,可是導入以前xp環境下的工程就一直出現正在構建工作空間,一直這么持續下去,直到最后出現未響應。汗,在網上搜了一把也沒找到結果。在這里貼出來,希望有遇到過的可以給俺指點指點,xp都用幾年了,實在是不想用xp了。哦忘了介紹下硬件配置了:酷睿T6600雙核處理器 2.2主頻 2G內存,我記得以前臺式機一G內存 AMD3000+還照樣跑myeclipse了,難道win7不支持myeclipse么,呵呵,這好像有點說不過去,畢竟Java老大哥是跨平臺的么,好了,不扯了,有誰遇到過,麻煩給解釋下。
              汗,解決了
              抓個圖來炫炫

          posted @ 2010-01-25 16:44 雪山飛鵠 閱讀(4043) | 評論 (10)編輯 收藏

          package com.poi.excel;

          import java.io.File;
          import java.io.FileNotFoundException;
          import java.io.FileOutputStream;
          import java.io.IOException;
          import java.util.ArrayList;
          import java.util.List;

          import org.apache.poi.hssf.usermodel.HSSFCell;
          import org.apache.poi.hssf.usermodel.HSSFRow;
          import org.apache.poi.hssf.usermodel.HSSFSheet;
          import org.apache.poi.hssf.usermodel.HSSFWorkbook;

          public class CreateExcel {
           
           public static void create()
           {
            //創建工作表
            HSSFWorkbook wb=new HSSFWorkbook();
            //創建第一個工作區
            HSSFSheet sheet=wb.createSheet("周工作報表");
            //創建標題行
            HSSFRow row=sheet.createRow(0);
            
            //創建第一行的第一個單元格
            HSSFCell cell=row.createCell(0);
            cell.setCellValue("序號");
            
            cell=row.createCell(1);
            cell.setCellValue("星期一");
           
            cell=row.createCell(2);
            cell.setCellValue("星期二");
            
            cell=row.createCell(3);
            cell.setCellValue("星期三");
            
            cell=row.createCell(4);
            cell.setCellValue("星期四");
            
            cell=row.createCell(5);
            cell.setCellValue("星期五");
            
            
            cell=row.createCell(6);
            cell.setCellValue("星期六");
            
            
            cell=row.createCell(7);
            cell.setCellValue("星期日");
            
            
            List list=new ArrayList();
            
            list.add("開會");
            
            list.add("下訂單");
            
            list.add("拜訪客戶");
            
            list.add("研討");
            
            list.add("再次拜訪");
            
            list.add("達成協議");
            
            list.add("簽署協議");
            
            for (int i = 0; i < list.size(); i++) {
             row=sheet.createRow(i+1);
             
             cell=row.createCell(0);
             cell.setCellValue(i+1);
             
             cell=row.createCell(1);
             cell.setCellValue(list.get(0).toString());
             
             cell=row.createCell(2);
             cell.setCellValue(list.get(1).toString());
             
             cell=row.createCell(3);
             cell.setCellValue(list.get(2).toString());
             
             cell=row.createCell(4);
             cell.setCellValue(list.get(3).toString());
             
             cell=row.createCell(5);
             cell.setCellValue(list.get(4).toString());
             
             cell=row.createCell(6);
             cell.setCellValue(list.get(5).toString());
             
             cell=row.createCell(7);
             cell.setCellValue(list.get(6).toString());
            }
            
            
            File f=new File("計劃書11.xls");
            
            try {
             wb.write(new FileOutputStream(f));
            } catch (FileNotFoundException e) {
             e.printStackTrace();
            } catch (IOException e) {
             e.printStackTrace();
            }
              
           }
           
           public static void main(String[] args) {
            CreateExcel.create();
           }
          }

          posted @ 2010-01-22 18:09 雪山飛鵠 閱讀(330) | 評論 (0)編輯 收藏


          謹以此文紀念逝去的SUN       
          此圖轉載自Java之父james gosling的blog  http://blogs.sun.com/jag/entry/so_long_old_friend
          只希望若干年后大家還記得世界上最經典的編程語言出自---SUN
          posted @ 2010-01-22 14:33 雪山飛鵠 閱讀(1938) | 評論 (1)編輯 收藏

          老公,我在日本找到工作了,你要好好學習,不要看AV哦~~~~
          posted @ 2010-01-14 18:06 雪山飛鵠 閱讀(1334) | 評論 (1)編輯 收藏

               摘要: 原理 struts2的自定義類型轉換機制為復雜類型的輸入輸出處理提供了便捷.struts2已經為我們提供了幾乎所有的primitive類型以及常用類型(如Date)的類型轉換器,我們也可以為我們自定義類添加自定義類型轉化器. struts2為我們提供了一個類型轉化器的入口: ognl.DefaultTypeConverter,或繼承org.apache.struts2.util.StrutsT...  閱讀全文
          posted @ 2010-01-12 14:37 雪山飛鵠 閱讀(10587) | 評論 (8)編輯 收藏

                  夫80后者, 初從文, 未及義務教育之免費, 不見高等學校之分配, 適值擴招, 過五關, 斬六將, 本碩相繼, 寒窗數載, 二十六乃成, 負債十萬。 覓生計, 背井離鄉, 東渡蘇浙,南下湖廣,西上志愿,北漂京都, 披星戴月, 秉燭達旦, 十年無休, 蓄十萬。 樓市暴漲, 無棲處, 購房金不足首付, 遂投股市, 翌年縮至萬余, 隨抑郁成疾, 入院一周, 傾其所有 病無果, 因欠費被逐院門。 尋醫保, 不合大病之規, 拒付, 帶病還。 友憐之,送三鹿奶粉,飲之,卒。
          posted @ 2010-01-10 12:05 雪山飛鵠 閱讀(1844) | 評論 (6)編輯 收藏

          僅列出標題
          共22頁: First 上一頁 14 15 16 17 18 19 20 21 22 下一頁 
          主站蜘蛛池模板: 无极县| 偃师市| 上饶市| 奉新县| 集安市| 县级市| 罗甸县| 德兴市| 巨鹿县| 南陵县| 苍溪县| 改则县| 新余市| 邵阳县| 甘孜县| 安顺市| 青冈县| 嘉荫县| 浙江省| 玉环县| 修水县| 文水县| 扎鲁特旗| 包头市| 山西省| 石阡县| 合山市| 瑞金市| 太仆寺旗| 合水县| 松溪县| 乌拉特前旗| 镇赉县| 德令哈市| 同心县| 晋州市| 日照市| 兰州市| 连云港市| 宁陵县| 永兴县|