首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

新手求教如何输出helloword

2012-04-16 
新手求教怎么输出helloword?用myeclipse 10 新建一个jsp页面HTML code%@ page languagejava importj

新手求教怎么输出helloword?
用myeclipse 10 新建一个jsp页面

HTML code
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <base href="<%=basePath%>">        <title>My JSP 'index.jsp' starting page</title>    <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <!--    <link rel="stylesheet" type="text/css" href="styles.css">    -->  </head>    <body>  <%  System.out.println ("helloworld"); %>为什么这里没有输出?    This is my JSP page. <br>  </body></html>



[解决办法]
jsp内置对象out

直接使用out.print();
[解决办法]
1.你用System.out.println();这个是在控制台打印。所以页面上不会有

<%out.print("hello world");%>这个是表示在页面上输出hello world字符
[解决办法]
探讨

改了一样没有任何输出啊

[解决办法]
探讨

1.你用System.out.println();这个是在控制台打印。所以页面上不会有

<%out.print("hello world");%>这个是表示在页面上输出hello world字符

[解决办法]
直接写个hello world就行了啊,,

[解决办法]

[解决办法]
方法1
HTML code
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <base href="<%=basePath%>">        <title>My JSP 'index.jsp' starting page</title>    <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <!--    <link rel="stylesheet" type="text/css" href="styles.css">    -->  </head>    <body>  <%  out.println ("helloworld"); %>    This is my JSP page. <br>  </body></html>
[解决办法]
探讨

HTML code

<% System.out.print ("helloworld"); //这个不会输出


out.print ("helloworld");// 这个可以
这2个有什么差别? 命名空间不同?
%>


[解决办法]
探讨
用myeclipse 10 新建一个jsp页面

HTML code


<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+requ……

[解决办法]
低级问题 不屑回答 路过
[解决办法]
csdn被学生占领了,csdn要挂了。我的csdn密码也让曝光了,09以前的人,还有木有,有木有!
[解决办法]
探讨

HTML code

<% System.out.print ("helloworld"); //这个不会输出
out.print ("helloworld");// 这个可以
这2个有什么差别? 命名空间不同?
%>

[解决办法]
直接写个hello world不就行了,如果真要那么写,这么写是正确的<%out.print("hello world");%>
[解决办法]
探讨

直接写个hello world就行了啊,,

[解决办法]
支持LZ,刚开始学习都是艰难的,加油
[解决办法]
恩 , 开始学就是成功,别介意别人的看法,
自己多学多问就行了
[解决办法]
[color=#FF0000]hehe[/color]
[解决办法]

[解决办法]
在jsp页面输出是用out.print ("helloworld");---输出到页面
而在java代码里采用System.out.print ("helloworld");---输出到控制台

[解决办法]
探讨
引用:

1.你用System.out.println();这个是在控制台打印。所以页面上不会有

<%out.print("hello world");%>这个是表示在页面上输出hello world字符
正解

[解决办法]
System.out.println ("helloworld"); %>为什么这里没有输出?
介个是系统打印,要用out.print("才能够打印出来哦")
[解决办法]
探讨

HTML code

<% System.out.print ("helloworld"); //这个不会输出
out.print ("helloworld");// 这个可以
这2个有什么差别? 命名空间不同?
%>

[解决办法]
<%="hello world"%>
[解决办法]
<% out.println ("helloworld"); %>
[解决办法]
慢慢学习,刚开始都这样.加油..
[解决办法]
<%out.print();%> 和 <%=...%>是等效的。
[解决办法]
楼主基础薄弱啊
jsp=html+servlet
先看看jsp的基础吧,不要先写
[解决办法]
这个我会。。。谁也不许跟我抢!!!!

热点排行