Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

jsp±íµ¥ÖÐÓжà¸ö°´Å¥Ôõôµ÷ÓÃServletʵÏÖ²»Í¬µÄ¹¦ÄÜ


Âé·³ÁË¡£¡£°ïÎÒ¿´¿´£¡
jap£º

<input type="submit" name="Submit" id="a" value="±£´æ" />
<input type="submit" name="Submit"  id="b" value="ÐÞ¸Ä" /> 
<input type="submit" name="Submit" id="c" value="ɾ³ý" />


servlet£º

String value=(String)request.getParameter("submit");
if(value.equals("±£´æ"))
        {response.sendRedirect("a.jsp");}
      else if(value.equals("ÐÞ¸Ä"))
        {response.sendRedirect("b.jsp");}
        else
        {response.sendRedirect("c.jsp");}

ÊÔÁ˺ܾö¼ÊÇ˵´íÎó£º

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
luru.luruxiugai.doPost(luruxiugai.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.


Ïà¹ØÎÊ´ð£º

¹ØÓÚÔÚJSPÖÐscriptµÄÒýÓÃ

ÏÂÃæcategoryTreeCont.jsp ´úÂë
----------------------------------------
Java code:

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
< ......

ÇóÖújspÖÐÔËÐÐJavabeanÎÊÌâ

SetGetPropertytest.jspÔ´´úÂëÈçÏ£¬Ð»Ð»´ó¼ÒǰÀ´°ï棬ͬʱף´ó¼ÒÖÐÇï¿ìÀÖ
<%@ page c%>
<HTML>
<HEAD>
<TITLE>setProperty¶¯×÷ÓëgetProperty¶¯×÷·¶Àý </TITLE> ......

jspµ÷ÓÃJavaBean tomcat³öÏîÎÊÌâ

package tom.jiafei;

public class Student {
String name=null;
long number;
double weight,height;
public String getName() {
return name;
}
public void setName(Strin ......

jspÌø×ª

ÎÒµãºóÍËʱÊǿհ×Ò³Ãæ
ÐèˢвÅÄÜÏÔʾ
Õâ¸öÔõô´¦Àí°¡
Çë´ó¼Ò°ï°ïæ
°ÑÎÊÌâ˵µÄÏêϸһЩ£¬ÕâÑùÓÐÖúÓÚÎÊÌâµÄ»Ø¸´£¬¼°´ð°¸µÄ׼ȷÐÔ£¡

ÎÒ¾õµÃÊÇÄãµÄä¯ÀÀÆ÷Æ÷µÄÎÊÌâ°É£¬ÎÒÒÔǰÓöµ½¹ýÕâÑùµÄÎÊÌ⣬°ÑIEµÄËùÓÐÊôÐÔÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ