日期:2014-05-18  浏览次数:20721 次

我是新手,帮帮我啊!
我这个程序有什么问题啊?
<%@   page   contentType= "text/html;charset=gb2312 "   %>
<%

 
    String   Name=request.getParameter( "userName ");
    String   Str=   "谢谢光临! ";
    Str+=Name;
    <center>
    out.println(Str);
    </center>
%>    
页面重定向操作
<%@   page   contentType= "text/html;charset=gb2312 "   %>
<html>
  <head>
    <title> Welcome </title>
  </head>
      <body>
        <jsp:forward   page= "Forward.jsp ">
            <jsp:param   name= "userName "   value= "Dianzi   keji   University "/>
        </jsp:forward>
      </body>
</html>    
以下是错误:
org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP

An   error   occurred   at   line:   2   in   the   jsp   file:   /Forward.jsp
Generated   servlet   error:
Syntax   error   on   token(s),   misplaced   construct(s)

An   error   occurred   at   line:   2   in   the   jsp   file:   /Forward.jsp
Generated   servlet   error:
Syntax   error   on   token(s),   misplaced   construct(s)

An   error   occurred   at   line:   2   in   the   jsp   file:   /Forward.jsp
Generated   servlet   error:
Syntax   error   on   token   "/ ",   delete   this   token


------解决方案--------------------
<%
String Name=request.getParameter( "userName ");
String Str= "谢谢光临! ";
Str+=Name;
<center>
out.println(Str);
</center>
%>
这一段怎么回事,我怎么没有看懂啊!
<center> 这样的html代码可能直接写到 <%%> 里面?!
------解决方案--------------------
jsp3.jsp
<%@ page contentType= "text/html; charset=GBK " %>
<jsp:forward page= "jsp4.jsp ">
<jsp:param name= "userName " value= "Dianzi keji University "/>
</jsp:forward>
jsp4.jsp
<%@ page contentType= "text/html; charset=GBK " %>
<%
String Name=request.getParameter( "userName ");
String Str= "谢谢光临! ";
Str+=Name;
System.out.println(Str);
%>
messages
..................
.......................
谢谢光临!Dianzi keji University

我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html