| 发表于:2007-09-26 15:09:10 楼主 |
package edu; import java.io.*; import javax.servlet.*; import javax.servlet.jsp.pagecontext; import javax.servlet.http.*; public class infobean { protected httpservletrequest request; public final void initialize(pagecontext pagecontext) throws servletexception { request = (httpservletrequest)pagecontext.getrequest(); } public string getinfo() { stringbuffer strbf = new stringbuffer(); strbf.append( "pathinfo: "); strbf.append(request.getrequesturi()); return strbf.tostring(); } } <%@ page contenttype= "text/html; charset=gbk " errorpage= " " %> <%request.setcharacterencoding( "gbk ");%> <%@ page language= "java " import= "edu.infobean " %> <html> <head> <meta http-equiv= "content-type " content= "text/html; charset=gbk "> <title> 页面信息 </title> </head> <body> <% infobean b1 = new infobean(); b1.initialize(pagecontext); string info = b1.getinfo(); out.println(info); %> </body "> </html> 怎么我在我的eclipse+myeclipse中的浏览器中输入 http://localhost:8080/mytest/1.jsp 说 无法显示网页 呢? |
|
|
|
|