Ginar 发表于 2007-5-22 13:23:18

水渠万能 谁懂JSP?我看好猪皮and/or中中!!!

就当帮助你们提升点英文阅读把,我懒的再转回中文了。
Forum: Assignment discussionDate: Tue May 22 2007 15:15Author: Mao, Chen<Chen.X.Mao@student.uts.edu.au>Subject: How to us out.println(String text) in jsp when mix http tag with jsp tag?
I tried hard and found one way to directly DOM parse the coming text from server. Tests in BlueJ environment confirmed that all printed messages were fine with the right recipe information.
When I moved these pure java code into jsp pattern, one tricky problem happened. I cannot directly use the System.out.println(String text); code anymore. I must use the http tags:

<html>
<body>
<% out.println(text);%>
</body>
</html>
This would be fine if all my printed messages are generated in a sequence order.However, since some the messages to be printed are orginally generated within a loop, I cannot wait until all the java code to be executed then use the http tag to print them all at once. I have got to find my way to do some code, then print, then do some code again...
I have tried all what I can but still cannot find my way, any help would be thankful!

帕伽索斯 发表于 2007-5-22 13:29:39

猪皮是asp的,牛是C方面的

青蛙,真遗憾呢

Ginar 发表于 2007-5-22 13:31:26

原帖由 帕伽索斯 于 2007-5-22 13:29 发表 http://bbs.newwise.com/images/common/back.gif
猪皮是asp的,牛是C方面的

青蛙,真遗憾呢
帕哥!我真该死,忘记还有你的存在ORZ……

应援团魂状:HELP!!!!!!!!!!!!!!!!!!!!

中中 发表于 2007-5-22 13:50:59

<html>   
<body>   
<%!   
      class   Hello{   
private   String   hello="";   
public   Hello()   {   
          hello="Hello   World!";   
    }   
public   String   getHello()   {   
      return   hello;   
}   
      }   
%>   
   
<%   
      Hello   hello   =   new   Hello();   
%>   
<h1>   
<%=   hello.getHello()   %>   
</h1>   
</body>   
</html>



具体自己悟吧

Ginar 发表于 2007-5-22 13:52:56

学习ING

中中 发表于 2007-5-22 13:53:30

青蛙去CSDN的JAVA的WEB开发区吧,有很多资料的

帕伽索斯 发表于 2007-5-22 14:28:31

牛你居然这么快帮他了= =

原始恶魔 发表于 2007-5-22 14:31:02

可惜从来没人问VHDL相关问题

中中 发表于 2007-5-22 14:32:39

VHDL太硬了

Ginar 发表于 2007-5-22 14:54:42

Forum: Assignment discussion
Date: Tue May 22 2007 16:44
Author: Mao, Chen<Chen.X.Mao@student.uts.edu.au>
Subject: Re: How to us out.println(String text) in jsp when mix http tag with jsp tag?


--------------------------------------------------------------------------------

I posted my question into another discussion board and got the answer to my original question:

if you want to "print" out the information anytime you want in your jsp file, you must at the very first create the http tags and put all your java code into that. for instance:

<http start>

<java start>

          blah blah blah

          class String getName() // this class should return the name string

<java end>

<%=the get method you want to use %>

<http end>

------------------------------------------------------------------------------------

Note that I am not willing to share any single bit of code but the above thing is the most appropriated way I can find...

Because the <%= > means to "print" the information you cannot write the getter classes as with the void type, which indicates that these getter classes must be of some return type.

My question is: how to return some information while you are inside a loop?

Say:
public class String getSomething()
{

       for(start end interval)

      {

             code text = blah blah blah;

             return text;

      }
}



This wouldn't work :(



中中再接再厉!!!

我吃饭去了 晚上还要上课= =

Ginar 发表于 2007-5-22 14:55:41

原帖由 帕伽索斯 于 2007-5-22 14:28 发表 http://bbs.newwise.com/images/common/back.gif
牛你居然这么快帮他了= =
你是坏人!没有爱!!!

中中 发表于 2007-5-22 14:58:08

发现了,青蛙肯定在帮小MM -0-

原始恶魔 发表于 2007-5-22 15:00:11

原来青蛙在借花献佛

Ginar 发表于 2007-5-22 15:01:26

原帖由 中中 于 2007-5-22 14:58 发表 http://bbs.newwise.com/images/common/back.gif
发现了,青蛙肯定在帮小MM -0-
你胡说把,我们这个系没有小MM只有老女人,已经有性伴侣(PARTNER)了
话说那女的是东欧血统,那名字,VXXXXXXVIA,我硬是签到的时候木有记住。
你在帮我,不是帮MM,如果你真帮MM呢我看在你没有牛嫂的情况下会直接让你跟MM聊的,所以不用YY了……

原始恶魔 发表于 2007-5-22 15:42:40

原来青蛙喜欢东欧的熟女,怪不得那个什么福建MM,房东女儿阿什么的放在那里

中中 发表于 2007-5-22 15:43:34

原来青蛙喜欢有经验,有伴侣的
页: [1]
查看完整版本: 水渠万能 谁懂JSP?我看好猪皮and/or中中!!!