看板 java 關於我們 聯絡資訊
※ 引述《johnkuokuo@kkcity.com.tw (無言)》之銘言: : 關於pageContext這個物件,我看了很多有關於jsp的書.. : 好像都只在介紹這個物件的.setAttribute和getAttribute的用途 : 那在實務上這個物件有別的用法嗎 : 最近剛好看到一個程式的寫法,大致寫法如下: : : 在某個classA定義一個methodA接受pageContext物件 : ex:: void metodA(PageContext pageContext) : 然後在另外一隻jsp程式中呼叫classA中的methodA這個方法並傳入pageContext物件 : ex: method(pageContext); : 可是我在jsp裡面看根本沒有用到pageContext物件的任何方法,也沒有用到set和get方法 : 那到底傳過ClassA中methodA有什麼用呢? : 而且methodA裡面也沒用到這個物件,那幹麻要去接收,想了很久都想不懂。 : 可是那套軟體裡面有很多都這樣做法...不知道為啥要這麼作.. : 有沒有實務上類似的經驗,可以分享呢..謝謝!! 這裡有介紹pageContext是幹麻的。 http://www.javaworld.com.tw/jute/post/view?bid=6&id=50490&sty=3 主要就是用來當容器的, 而且現在沒用到不見得以後不會用上。XD -- String temp="relax"; | Life just like programing while(buringlife) String.forgot(temp); | to be right or wrong while(sleeping) brain.setMemoryOut(); | need not to say stack.push(life.running); | the compiler will stack.push(scouting.buck()); | answer your life stack.push(bowling.practice()); | Bone everything -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.27.68