Topic: 请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我)

  Print this page

1.请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) Copy to clipboard
Posted by: 512mouse
Posted on: 2004-09-03 15:26

有如下jsp,html,java代码,我是从书上抄下来的,出现好多错误,有好多疑问,恳请前辈们解答。
1、My.html<html>
<head>
<title>Untitled Document</title>
</head>

<body bgcolor="#FFFFFF">
<form action="wordpro.jsp" method="POST">
Enter word:
<input type="text" name="word">
<select name="mode">
<option value="1" selected> Reverse</option>
<option value="2"> Spellcheck</option>
</select>
<input type="submit" name="Go" value="Submit">
</form>
</body>
</html>
2、wordpro.jsp
<jsp:userBean id="help" scope="request" class="projsp.beanSpellCheck"/>
<jsp:setProperty name="help" property="*"/>
<html>
<body>
YOU ENTER THE INPUT,<b><%=request.getParameter("word")%></b><br>
the processed output is:<br>
<%=Integer.parseInt(request.getParameter("mode"))==1
? help.reverse():""+help.check()%>
</body>
</html>
3、beanSpellCheck.java
package projsp;

public class beanSpellCheck{
private String word;
public beanSpellCheck(){}
public String reverse(){
return (new StringBuffer(word).reverse()).toString();
}

public boolean check(){
return true;
}
public String getWord(){
return word;
}
public void setWord(String aWord){
word=aWord;
}
}

2.Re:请教JSP的问题,555555555帮帮我吧,我刚学 [Re: 512mouse] Copy to clipboard
Posted by: 512mouse
Posted on: 2004-09-03 15:30

我把beanSpellCheck编译成.class文件之后,不知道放在哪,最后就放在和jsp,html一个目录下了(D:\Apache Tomcat 4.0\webapps\myapps).
然后:从浏览器http://localhost:8080/myapps/My.html中进入,输入几个字母,再点submit.出现一大堆错误如下:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.

An error occurred between lines: 7 and 8 in the jsp file: /wordpro.jsp

Generated servlet error:
D:\Apache Tomcat 4.0\work\Standalone\localhost\myapps\wordpro$jsp.java:73: Undefined variable or class name: help
? help.reverse():""+help.check());
^

An error occurred between lines: 7 and 8 in the jsp file: /wordpro.jsp

Generated servlet error:
D:\Apache Tomcat 4.0\work\Standalone\localhost\myapps\wordpro$jsp.java:73: Undefined variable or class name: help
? help.reverse():""+help.check());
^
2 errors, 1 warning

  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
  at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
  at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
..............................................
请各位XDJM帮帮偶

3.Re:请教JSP的问题,555555555帮帮我吧,我刚学 [Re: 512mouse] Copy to clipboard
Posted by: 512mouse
Posted on: 2004-09-03 16:43

555555555555555怎么没人理我啊,我的QQ是271035768,谁来帮帮我呀

4.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: 512mouse
Posted on: 2004-09-03 16:45

小妹感激不尽,作揖作揖........

5.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: nothing
Posted on: 2004-09-03 17:11

512mouse wrote:
小妹感激不尽,作揖作揖........


这句该一开始就说,,,早说呀!!

6.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: nothing] Copy to clipboard
Posted by: lichtung
Posted on: 2004-09-03 17:16

nothing wrote:
这句该一开始就说,,,早说呀!!


哈哈哈哈哈哈哈哈——————————

7.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: chengbd
Posted on: 2004-09-03 20:49

把beanSpellCheck.class文件放在你的web app的WEB-INF/classes/projsp目录下

8.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: star01cn
Posted on: 2004-09-08 17:33

哈哈
俺也是来
现在还没弄明白javabean怎么调用呢

9.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: bluice
Posted on: 2004-09-12 15:10

多看看书吧。

10.Re:请教JSP的问题,555555555帮帮我吧,我刚学(斑竹救我) [Re: 512mouse] Copy to clipboard
Posted by: simple_li
Posted on: 2004-09-13 15:24

先看看书吧!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923