This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

how to solve the http error 500

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTP Status 500 -

type Exception report

message

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

exception

org.apache.jasper.JasperException: /result.jsp (line: 1, column: 18) quote symbol expected
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:222)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:183)
org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:479)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:420)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:190)
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:119)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:193)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
BeerSelect.doPost(BeerSelect.java:18)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.
Apache Tomcat/7.0.27
my jsp code is below
<%@ page import=”java.util.*” %>
<html>
<body>
<h1 align=”center”>Beer Recommendations JSP</h1>
<p>
<%
List styles = (List)request.getAttribute(“styles”);
Iterator it = styles.iterator();
while(it.hasNext()) {
out.print(“<br>try: “ + it.next());
}
%>
</body>
</html>
my servlet code is below
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class BeerSelect extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
String c = request.getParameter("color");
BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
// response.setContentType("text/html");
// PrintWriter out = response.getWriter();
// out.println("Beer Selection Advice<br>");
request.setAttribute("styles",result);
RequestDispatcher view =
request.getRequestDispatcher("result.jsp");
view.forward(request, response);
}
}
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may think that this line:


has a quote mark at line 1 column 18 but in truth it is one of those CURSED microsoft word smart quotes.

I determined this by using UltraEdit 32 - a programmer's editor - that shows the hex value actually is 0x94

Illustrating once again why Word is a bad choice for programming.

Bill
 
a k m shamsudoha
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks to william brogden for your reply
It works nicely
thank you very much.
 
That is a really big piece of pie for such a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!