• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 500 - An exception occurred processing JSP page

 
chamini prashakthi
Ranch Hand
Posts: 106
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!

 
Swastik Dey
Rancher
Posts: 1721
8
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!