jsp ´«stringÀàÐͲÎÊý
ÎÒµÄÒ»¸öjsp²¿·Ö´úÂ룬ÆäÖÐidÊÇÉÏÒ»¸öÒ³Ãæ´«¹ýÀ´µÄ²ÎÊý£¨Êý¾Ý¿â²éѯµÃµ½µÄ¶¯Ì¬Êý¾Ý£©£º
String id;
try
{
id= request.getParameter("id");
}catch(Exception e){
id="wrong";
}
%>
<%
String DBURL="jdbc:postgresql://localhost/postgres";
String user="postgres";
String password="postgres";
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
String sqlString1=null;
try{
Class.forName("org.postgresql.Driver").newInstance();
con=DriverManager.getConnection(DBURL,user,password);
}catch(ClassNotFoundException e){
out.println("ClassNotFoundException:"+e.getMessage());
}
if(id!="wrong"){
sqlString1="select office_id,company_name,line_1_label_address,line_2_label_address,line_3_label_address,line_4_label_address,line_5_label_address,postal_code,telephone,facsimile,email from xinaddress where company_name="+id;
ÎÒÔËÐÐʱ£¬ÎÒ´ÓÉÏÒ»¸öÒ³Ãæ½øÕâ¸öÒ³ÃæÊ±×ÜÊdzöÏÖ´íÎó£¬
˵
SQL Exception!:ERROR: syntax error at or near "Shipping"
µ«ÊÇÎÒÈç¹û´«µÄ²ÎÊýÊÇintÀàÐÍʱ
ÉÏÃæÓÃ
int id;
try
{
id= Integer.parseInt(request.getParameter("id"));
}catch(Exception e){
id=0;
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÓÃSTRUTS £¬×öÁËÒ»¸öJSPÒ³Ãæ£¬Ìá½»ºóûÓдæÈëÊý¾Ý¿â¡£
JSP´úÂëÈçÏ£º
aa.jsp´úÂë
<%@ page contentType="text/html;charset=gb2312" language="java"%>
<%@ taglib uri=" ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
ÎÒÏëÓÃjavabeanʵÏÖ¼ÆÊý
´úÂëÈçÏ£º
ComputerCount.java
package tom.jiafei;
import java.io.*;
public class ComputerCount{
int number=0;
boolean iscome=false;
File file=new ......
Ò»¸öÃû³Æ,ÐèÒªÊäÈëµÄ£¬Ò»¸öÏÂÀ²Ëµ¥£¬Ñ¡ÔñµÄ£¬¸ù¾ÝÕâÁ½¸ö½øÐÐÄ£ºý²éѯ¡£ÔÚ·þÎñÆ÷¶ËÎÞÂÛÊäÈëÓë·ñ£¬¶¼Äܵóö²éѯ½á¹û¡£
µ«ÊÇ·ÃÎʵϰ£¬Ö»ÓÐÔÚÊäÈëÃû³ÆµÄʱºò£¬ÔÙÑ¡ÔñÏÂÀ²Ëµ¥²ÅÄܲéѯ£¬Èô²»ÊäÈëÃû³Æ£¬Ö»Ñ¡ÔñÏÂÀ²Ëµ ......
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ãæ½«²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......