Win a copy of Spring in Action (5th edition) this week in the Spring 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

HTTP Status 500 - An exception occurred processing JSP page  RSS feed

 
Ranch Hand
Posts: 174
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Im developing web based project using jsp and rest api with java.
I'm using netbeans 8.0.2 IDE and apache-tomcat-8.5.0.

this is my main jsp page:


<html>
   <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>JSP Page</title>
   </head>
   <body>
       <form class="customform" action="/user/GUI/insert.jsp">
           username:
           <input type="text" name="username" value="" />
           <input type="submit" value="submit" name="submit" />
       </form>
   </body>
</html>


then insert.jsp page in GUI folder:

<%@page import="entity.User"%>
<%@page import="presentation.calls"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.Set"%>
<%@ page import = "java.util.Map" %>
<jsp:useBean id="sample" scope="page" class="presentation.calls" />


<%
   
   calls obj = new calls();
   User use = new User(request.getParameter("username"));
   System.out.println("-------------------------------------------starting!------");
   use.setUsername(request.getParameter("username"));
   obj.insertData(use);
   System.out.println("------data goes--------------");
%>



then calls.java class in presentation package:


finally this is the insertData method in UserFacadeREST_JerseyClient.java class:



//this is automaticall generated bu rest client.



There are no any erors occur in the project and server also run well.
when i run the project this first appear :




but after enter a name and sumit ,it shows this ERROR:

HTTP Status 500 - An exception occurred processing JSP page /GUI/insert.jsp at line 23

type Exception report

message An exception occurred processing JSP page /GUI/insert.jsp at line 23

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

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /GUI/insert.jsp at line 23

20:     User use = new User(request.getParameter("username"));
21:     System.out.println("-------------------------------------------starting!------");
22:     use.setUsername(request.getParameter("username"));
23:     obj.insertData(use);
24:     System.out.println("------data goes--------------");
25: %>
26:


PLEASE SOME ONE HELP ME!

 
Rancher
Posts: 1915
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove java code from jsp page, it's a very old practice.  You should ideally have a servlet for this purpose.  As far as the error is concerned, you seem to have some issues with insertData method.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!