作者TonyQ (骨头)
看板java
标题Re: [JSP ] 请问如何将搜寻与javaBean共同使用??
时间Mon Apr 2 19:28:18 2007
※ 引述《longlyheart (longlyheart)》之铭言:
: 小弟我写了一个搜寻网页,想要请问:
: 如何将写在网页里面的资料库移出来变成一个Bean??
: 以下是我的程式码:
: </body>
: 大约就是以上try里面的东西,希望可以改成由Bean汇入
: 但是Bean不支援System.out.println这种东西....
: 所以写了几个Bean都没办法达到同样的效果,请各位大大指导>"<
你弄错了,System.out.println是consolo,
你看到的out 是属於 JspWriter 类别。
你所需要的是在 JavaBean里面把你要print的字串接起来,
在JSP里调用JavaBean时透过 <%= %> 或 out.println()
去接你的JavaBean回传的字串,而不是直接在JavaBean里面print字串。
--
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