Example 1:
The Code is as follows: Click Update to jump to this page and an error is returned !! Experts help you !! If this parameter is not included, no error is returned! However, the arttiel parameter must be included! <% @ Page contenttype = "text/html; charset = gb2312" Language = "Java" Import = "Java. SQL. * "errorpage =" "%> <% @ include file =" connection. JSP "%> <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML>
Question added:
This error is returned when the parameter (arttiel) is included. If the parameter is removed, it will be okay, but this parameter must be used !! Out. println ("<SCRIPT> alert ('Update successful! '); Document. Location =/"sousuo. jsp? Arttiel = <% = arttiel %>/"; </SCRIPT>"); if you write it as follows, you can get this parameter, however, an error is returned if you change to <% = %>! Out. println ("<SCRIPT> alert ('Update successful! '); Document. Location =/"sousuo. jsp? Arttiel = 1/"; </SCRIPT> ");
Best Answer
<% = %> Is used to copy data in HTML. Out. println ("<SCRIPT> alert ('Update successful! '); Document. Location =/"sousuo. jsp? Arttiel = "+ arttiel +"/"; </SCRIPT> ");
Example 2:
Org. Apache. Jasper. jasperexception: Unable to compile class for JSP:
An error occurred at line: 38 in the JSP file:/jsrz/admin/showrz. jsp
String Literal is not properly closed by a double-quote
35: Statement _ SMT = con. createstatement ();
36: resultset _ rs;
37: String _ SQL;
38: _ SQL = "select * From rzbody where name = '" + name + "';
39: _ rs = _smt.exe cutequery (_ SQL );
Best Answer
Quotation marks _ SQL = "select * From rzbody where name = '" + name + "'" are missing "'";