我用eclipse3.3+myeclipse6+tomcat5.5写了这个中文字符转换的jsp.输入姓名后点提交却出错~JSP程序源代码:<%@ page contentType="text/html; charset=gb2312" %><%! 
public String codeToString(String str)
{//处理中文字符的函数
String s=str;
try
{
byte tempB[]=s.getBytes("ISO-8859-1");
s=new String(tempB);
return s;
}
cath(Exception e)
{
return s;
}
}
%><html>
<body>
<form action="chineseStringExample1.jsp" name="form1" method="post">
请输入你的姓名:
<input type="text" name="username">
<input type="submit" name="submit" value="提交">
</form>
<br>
<%
if(request.getParameter("username")==null)
out.println("你没有输入姓名!");
else
out.println("你的姓名为:"+codeToString(request.getParameter("username")));
%>
  </body>
</html>
点提交后浏览器错误信息:
HTTP Status 404 - /WebRoot/chineseStringExample1.jsp--------------------------------------------------------------------------------type Status reportmessage /WebRoot/chineseStringExample1.jspdescription The requested resource (/WebRoot/chineseStringExample1.jsp) is not available.
--------------------------------------------------------------------------------Apache Tomcat/5.5.23

解决方案 »

  1.   

    文件名字我都用复制拉~而且也是在同一目录的~还有一个页面,怎么我感觉一用request.getParameter就这样啊~
      

  2.   

    message /WebRoot/chineseStringExample1.jsp 红色的部分不要
      

  3.   

    晕,错拉,这个本来就是一个文件嘛,没有2个文件,2个文件的用到request的也是一样的错~
      

  4.   

    HTTP Status 404 - /WebRoot/chineseStringExample1.jsp -------------------------------------------------------------------------------- type Status report message /WebRoot/chineseStringExample1.jsp description The requested resource (/WebRoot/chineseStringExample1.jsp) is not available. 表示网页不可用WebRoot/为myeclipse6默认的目录在输入浏览器 这个不要
      

  5.   

    我的工程的目录就建的是tomcat下的webapps\WebRoot下,不打WebRoot路径不对直接就显示不出来网页~
      

  6.   

    你说清楚来

    我的工程的目录就建的是tomcat下的webapps\WebRoot下,不打WebRoot路径不对直接就显示不出来网页
    ???
    你tomcat webapps\有什么
      

  7.   

    就是我的工程就直接保存在tomcat/webapps/下的我新建的文件夹WebRoot下。
     Webapps下有.myeclipse  jsp-examples  ROOT  src  tomcat-docs webdav  WebRoot这些文件夹,还有.classpath    .classpath   .project 我真的感觉是一用request.getParameter就出问题~~~其他页面都好好的~~~
      

  8.   

    晕倒 怎么这样去做啊
    无语了你的工作空间怎么在webapps/下应该在其他地方在部署过去