Nw BBS 壬天堂世界

 找回密码
 注册
搜索
热搜: 资料集合
查看: 1624|回复: 15
收起左侧

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

[复制链接]
发表于 2007-5-22 13:23:18 | 显示全部楼层 |阅读模式
就当帮助你们提升点英文阅读把,我懒的再转回中文了。
Forum: Assignment discussion
Date: Tue May 22 2007 15:15
Author: Mao, Chen  <[email=Chen.X.Mao@student.uts.edu.au?Subject%3DHow%20to%20us%20out.println%28String%20text%29%20in%20jsp%20when%20mix%20http%20tag%20with%20jsp%20tag%3F%20%28posted%20in%20discussion%20board%20-%20Assignment%20discussion%29]Chen.X.Mao@student.uts.edu.au[/email]>
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方面的

青蛙,真遗憾呢
回复

使用道具 举报

 楼主| 发表于 2007-5-22 13:31:26 | 显示全部楼层
原帖由 帕伽索斯 于 2007-5-22 13:29 发表
猪皮是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>



具体自己悟吧
回复

使用道具 举报

 楼主| 发表于 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太硬了
回复

使用道具 举报

 楼主| 发表于 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 :(



中中再接再厉!!!

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

使用道具 举报

 楼主| 发表于 2007-5-22 14:55:41 | 显示全部楼层
原帖由 帕伽索斯 于 2007-5-22 14:28 发表
牛你居然这么快帮他了= =

你是坏人!没有爱!!!
回复

使用道具 举报

发表于 2007-5-22 14:58:08 | 显示全部楼层
发现了,青蛙肯定在帮小MM -0-
回复

使用道具 举报

发表于 2007-5-22 15:00:11 | 显示全部楼层
原来青蛙在借花献佛
回复

使用道具 举报

 楼主| 发表于 2007-5-22 15:01:26 | 显示全部楼层
原帖由 中中 于 2007-5-22 14:58 发表
发现了,青蛙肯定在帮小MM -0-

你胡说把,我们这个系没有小MM只有老女人,已经有性伴侣(PARTNER)了
话说那女的是东欧血统,那名字,VXXXXXXVIA,我硬是签到的时候木有记住。
你在帮我,不是帮MM,如果你真帮MM呢我看在你没有牛嫂的情况下会直接让你跟MM聊的,所以不用YY了……
回复

使用道具 举报

发表于 2007-5-22 15:42:40 | 显示全部楼层
原来青蛙喜欢东欧的熟女,怪不得那个什么福建MM,房东女儿阿什么的放在那里
回复

使用道具 举报

发表于 2007-5-22 15:43:34 | 显示全部楼层
原来青蛙喜欢有经验,有伴侣的[wdb35]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|Nw壬天堂世界 ( 京ICP备05022083号-1 京公网安备11010202001397号 )

GMT+8, 2024-10-11 01:18 , Processed in 0.150735 second(s), 3 queries , Redis On.

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表