• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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: 1878
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!